113 #ifndef SIM_MCTruthParticleList_H
114 #define SIM_MCTruthParticleList_H
116 #include "nusimdata/SimulationBase/MCParticle.h"
126 class MCTruthEveIdCalculator;
134 typedef std::map<int,const simb::MCParticle*>
list_type;
167 friend std::ostream&
operator<<
214 void Cut(
const double& );
223 auto iParticle =
find(trackID);
224 return (iParticle !=
end()) && (iParticle->second !=
nullptr);
233 std::vector<const simb::MCParticle*>
GetPrimaries()
const;
235 const simb::MCParticle*
Primary(
const int )
const;
284 void Add(
const simb::MCParticle*
value );
298 friend std::ostream&
operator<<
303 int EveId (
const int trackID )
const;
329 {
return m_MCTruthParticleList.find(
abs(key)); }
331 {
return m_MCTruthParticleList.find(
abs(key)); }
333 {
return m_MCTruthParticleList.upper_bound(
abs(key)); }
335 {
return m_MCTruthParticleList.upper_bound(
abs(key)); }
337 {
return m_MCTruthParticleList.lower_bound(
abs(key)); }
339 {
return m_MCTruthParticleList.lower_bound(
abs(key)); }
341 {
return m_MCTruthParticleList.at(
std::abs(key)); }
343 {
return m_MCTruthParticleList.at(
std::abs(key)); }
354 #endif // SIM_MCTruthParticleList_H
void swap(MCTruthParticleList &other)
std::vector< const simb::MCParticle * > GetPrimaries() const
list_type::const_iterator const_iterator
void Archive(const key_type &key)
Removes the particle from the list, keeping minimal info of it.
int GetMotherOf(const key_type &key) const
This function seeks for the exact key, not its absolute value.
list_type::reverse_iterator reverse_iterator
primaries_type::const_iterator primaries_const_iterator
MCTruthParticleList MakeCopy() const
Returns a copy of this object.
list_type::size_type size_type
const simb::MCParticle * Primary(const int) const
list_type m_MCTruthParticleList
Sorted list of particles in the event.
iterator upper_bound(const key_type &key)
list_type::const_reverse_iterator const_reverse_iterator
MCTruthParticleList & operator=(const MCTruthParticleList &rhs)=delete
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
list_type::difference_type difference_type
archive_type m_archive
archive of the particles no longer among us
int EveId(const int trackID) const
friend std::ostream & operator<<(std::ostream &output, const MCTruthParticleList &)
list_type::value_type value_type
mapped_type const & operator[](const key_type &key) const
std::set< int > primaries_type
std::unique_ptr< MCTruthEveIdCalculator > m_eveIdCalculator
mapped_type const & Particle(const size_type) const
void AdoptEveIdCalculator(MCTruthEveIdCalculator *) const
list_type::mapped_type mapped_type
list_type::key_compare key_compare
int NumberOfPrimaries() const
list_type::key_type key_type
iterator find(const key_type &key)
primaries_type::iterator primaries_iterator
archived_info_type(int pid)
void Add(const simb::MCParticle *value)
std::map< int, const simb::MCParticle * > list_type
void insert(const simb::MCParticle *value)
reverse_iterator rbegin()
archived_info_type(simb::MCParticle const *part)
iterator lower_bound(const key_type &key)
size_type erase(const key_type &key)
archived_info_type(simb::MCParticle const &part)
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
list_type::allocator_type allocator_type
mapped_type at(const key_type &key)
virtual ~MCTruthParticleList()
std::map< int, archived_info_type > archive_type
primaries_type m_primaries
const key_type & TrackId(const size_type) const
bool IsPrimary(int trackID) const
archived_info_type()=default
list_type::iterator iterator
bool HasParticle(int trackID) const
Returns whether we have this particle, live (with full information)
bool KnownParticle(int trackID) const
Returns whether we have had this particle, archived or live.