Public Types | |
typedef std::map< int, sim::Particle * > | list_type |
typedef list_type::key_type | key_type |
typedef list_type::mapped_type | mapped_type |
typedef list_type::value_type | value_type |
typedef list_type::iterator | iterator |
typedef list_type::const_iterator | const_iterator |
typedef list_type::reverse_iterator | reverse_iterator |
typedef list_type::const_reverse_iterator | const_reverse_iterator |
typedef list_type::size_type | size_type |
typedef list_type::difference_type | difference_type |
typedef list_type::key_compare | key_compare |
typedef list_type::allocator_type | allocator_type |
Static Public Member Functions | |
static void | AdoptEveIdCalculator (EveIdCalculator *) |
Private Types | |
typedef std::set< int > | primaries_type |
typedef primaries_type::iterator | primaries_iterator |
typedef primaries_type::const_iterator | primaries_const_iterator |
Private Attributes | |
list_type | fParticleList |
Sorted list of particles in the event. More... | |
primaries_type | fPrimaries |
Sorted list of the track IDs of primary particles. More... | |
Friends | |
ParticleNavigator | operator+ (const int &value, const ParticleNavigator &list) |
std::ostream & | operator<< (std::ostream &output, const ParticleNavigator &) |
A container for particles generated during an event simulation. It acts like a map<int,Particle*> but with additional features:
Methods to access the list of primary particles in the event: sim::ParticleNavigator particleList = // ...; int numberOfPrimaries = particleList->NumberOfPrimaries(); for ( int i = 0; i != numberOfPrimaries; ++i ) { sim::Particle* particle = particleList->Primary(i); ... } There's also a simple test: int trackID = // ...; if ( particleList->IsPrimary(trackID) ) {...}
(Aside: note that particleList[i] does NOT give you the "i-th" particle in the list; it gives you the particle whose trackID is "i".)
Definition at line 76 of file ParticleNavigator.h.
typedef list_type::allocator_type sim::ParticleNavigator::allocator_type |
Definition at line 92 of file ParticleNavigator.h.
typedef list_type::const_iterator sim::ParticleNavigator::const_iterator |
Definition at line 86 of file ParticleNavigator.h.
typedef list_type::const_reverse_iterator sim::ParticleNavigator::const_reverse_iterator |
Definition at line 88 of file ParticleNavigator.h.
typedef list_type::difference_type sim::ParticleNavigator::difference_type |
Definition at line 90 of file ParticleNavigator.h.
typedef list_type::iterator sim::ParticleNavigator::iterator |
Definition at line 85 of file ParticleNavigator.h.
typedef list_type::key_compare sim::ParticleNavigator::key_compare |
Definition at line 91 of file ParticleNavigator.h.
typedef list_type::key_type sim::ParticleNavigator::key_type |
Definition at line 82 of file ParticleNavigator.h.
typedef std::map<int,sim::Particle*> sim::ParticleNavigator::list_type |
Definition at line 81 of file ParticleNavigator.h.
typedef list_type::mapped_type sim::ParticleNavigator::mapped_type |
Definition at line 83 of file ParticleNavigator.h.
|
private |
Definition at line 197 of file ParticleNavigator.h.
|
private |
Definition at line 196 of file ParticleNavigator.h.
|
private |
Definition at line 195 of file ParticleNavigator.h.
typedef list_type::reverse_iterator sim::ParticleNavigator::reverse_iterator |
Definition at line 87 of file ParticleNavigator.h.
typedef list_type::size_type sim::ParticleNavigator::size_type |
Definition at line 89 of file ParticleNavigator.h.
typedef list_type::value_type sim::ParticleNavigator::value_type |
Definition at line 84 of file ParticleNavigator.h.
sim::ParticleNavigator::ParticleNavigator | ( | ) |
Definition at line 37 of file ParticleNavigator.cxx.
|
explicit |
|
virtual |
Definition at line 49 of file ParticleNavigator.cxx.
References clear().
sim::ParticleNavigator::ParticleNavigator | ( | const ParticleNavigator & | rhs | ) |
Definition at line 57 of file ParticleNavigator.cxx.
References clear(), HTMLTools::entry(), fParticleList, and insert().
ParticleNavigator sim::ParticleNavigator::Add | ( | const int & | offset | ) | const |
Definition at line 189 of file ParticleNavigator.cxx.
References simb::MCParticle::AddDaughter(), simb::MCParticle::AddTrajectoryPoint(), d, simb::MCParticle::Daughter(), fParticleList, MECModelEnuComparisons::i, insert(), simb::MCParticle::Mass(), simb::MCParticle::Momentum(), simb::MCParticle::Mother(), simb::MCParticle::NumberDaughters(), simb::MCParticle::NumberTrajectoryPoints(), PandAna.reco_validation.add_data::offset, simb::MCParticle::PdgCode(), simb::MCParticle::Polarization(), simb::MCParticle::Position(), simb::MCParticle::Process(), fillBadChanDBTables::result, simb::MCParticle::SetPolarization(), confusionMatrixTree::t, and simb::MCParticle::TrackId().
Referenced by nuesand::FillNueSandbox::GetECF(), operator+(), ParticleNavigator(), g4n::ParticleListAction::PreTrackingAction(), and cheat::BackTracker::Rebuild().
|
inline |
Definition at line 177 of file ParticleNavigator.h.
References AdoptEveIdCalculator(), clear(), erase(), EveId(), insert(), operator<<, output, and trackID.
|
static |
Set a pointer to a different eve ID calculation. The name begins with "Adopt" because it accepts control of the ponters; do NOT delete the pointer yourself if you use this method.
Definition at line 367 of file ParticleNavigator.cxx.
Referenced by Add(), and EveId().
|
inline |
|
inline |
|
inline |
Definition at line 136 of file ParticleNavigator.h.
References fParticleList.
Referenced by cheat::TestTrackIds::analyze(), ve::VertexEva::analyze(), ddt::SMMEff::analyze(), ddt::SMMADC::analyze(), mcchk::ShowerAnaCheck::analyze(), zcl::SMMTriggerAna::analyze(), mcchk::MonopoleAna::analyze(), mcchk::CosmicAna::analyze(), vf::TrackEva::analyze(), zcl::MMCheater::analyze(), zcl::FmmTriggerAna::analyze(), zcl::FmmTrackerValidation::analyze(), ddt::SlicerEva::analyze(), zcl::FastMMStudy::analyze(), ddt::SuperDDTEva::analyze(), htk::HoughTrack::analyze(), g4n::ParticleListAction::EndOfEventAction(), bsf::BremShowerFilter::findShowerByTruth(), g4n::ParticleListAction::GetList(), evd::MCTrueView::LoadEvent(), evd::SimulationDrawer::MCTruthTrajectoriesAnyD(), sim::operator<<(), novaddt::UpMuAna::populateFLSmap(), zcl::SMMCluster::produce(), and cheat::MCCheater::produce().
|
inline |
void sim::ParticleNavigator::clear | ( | ) |
Definition at line 270 of file ParticleNavigator.cxx.
References fParticleList, fPrimaries, and MECModelEnuComparisons::i.
Referenced by Add(), ncs::NCAna::analyze(), g4n::ParticleListAction::BeginOfEventAction(), operator=(), ParticleNavigator(), cheat::BackTracker::Rebuild(), and ~ParticleNavigator().
void sim::ParticleNavigator::Cut | ( | const double & | cut | ) |
Apply an energy threshold cut to the particles in the list, removing all those that fall below the cut.
Definition at line 94 of file ParticleNavigator.cxx.
References simb::MCParticle::E(), erase(), fParticleList, and MECModelEnuComparisons::i.
|
inline |
Definition at line 146 of file ParticleNavigator.h.
References fParticleList.
Referenced by mono::Monopole::analyze().
|
inline |
Definition at line 138 of file ParticleNavigator.h.
References fParticleList.
Referenced by cheat::TestTrackIds::analyze(), ve::VertexEva::analyze(), ddt::SMMEff::analyze(), ddt::SMMADC::analyze(), zcl::SMMTriggerAna::analyze(), mcchk::ShowerAnaCheck::analyze(), mcchk::MonopoleAna::analyze(), mcchk::CosmicAna::analyze(), vf::TrackEva::analyze(), zcl::MMCheater::analyze(), zcl::FmmTriggerAna::analyze(), ddt::SlicerEva::analyze(), zcl::FmmTrackerValidation::analyze(), zcl::FastMMStudy::analyze(), ddt::SuperDDTEva::analyze(), htk::HoughTrack::analyze(), g4n::ParticleListAction::EndOfEventAction(), bsf::BremShowerFilter::findShowerByTruth(), sn::SupernovaMCCluster::GetDaughters(), g4n::ParticleListAction::GetList(), evd::MCTrueView::LoadEvent(), evd::SimulationDrawer::MCTruthTrajectoriesAnyD(), sim::operator<<(), sim::ParticleHistory::ParticleHistory(), novaddt::UpMuAna::populateFLSmap(), g4n::ParticleListAction::PostTrackingAction(), g4n::ParticleListAction::PreTrackingAction(), evd::SimulationDrawer::PrintParticleAndOffspring(), cheat::ClusterCheater::produce(), zcl::SMMCluster::produce(), cheat::MCCheater::produce(), and cheat::BackTracker::TrackIDToParticle().
|
inline |
ParticleNavigator::size_type sim::ParticleNavigator::erase | ( | const key_type & | key | ) |
Definition at line 286 of file ParticleNavigator.cxx.
References HTMLTools::entry(), and fParticleList.
Referenced by Add(), and Cut().
Definition at line 341 of file ParticleNavigator.cxx.
References AdoptEveIdCalculator(), and sim::EveIdCalculator::Init().
Referenced by Add(), calib::ParticleCorrections::analyze(), showere::ShowerEnergyAna::analyze(), slid::LIDTraining::analyze(), showere::ShowerEnergyFilterMC::filter(), filter::TruthFilter::produce(), cheat::MCCheater::produce(), and cheat::BackTracker::TrackIDToMotherParticle().
Definition at line 149 of file ParticleNavigator.h.
References fParticleList.
Referenced by cheat::TestTrackIds::analyze(), cheat::CheckBackTracking::CheckTrackIdToParticle(), sn::SupernovaMCCluster::GetDaughters(), cheat::BackTracker::MCTruthToParticles(), sim::ParticleHistory::ParticleHistory(), g4n::ParticleListAction::PostTrackingAction(), g4n::ParticleListAction::PreTrackingAction(), evd::SimulationDrawer::PrintParticleAndOffspring(), cheat::ClusterCheater::produce(), and cheat::BackTracker::TrackIDToParticle().
|
inline |
void sim::ParticleNavigator::insert | ( | sim::Particle * | value | ) |
These two methods (insert and Add) do the same thing:
Definition at line 242 of file ParticleNavigator.cxx.
References fParticleList, fPrimaries, simb::MCParticle::Process(), simb::MCParticle::TrackId(), and trackID.
Referenced by Add(), at(), operator=(), and ParticleNavigator().
bool sim::ParticleNavigator::IsPrimary | ( | int | trackID | ) | const |
Definition at line 143 of file ParticleNavigator.cxx.
References fPrimaries.
Referenced by cheat::TestTrackIds::analyze(), mcchk::LeptonAna::analyze(), sim::ParticleHistory::ParticleHistory(), and cvn::ProngClassify().
|
inline |
Definition at line 154 of file ParticleNavigator.h.
References fParticleList, findDuplicateFiles::key, and operator[]().
int sim::ParticleNavigator::NumberOfPrimaries | ( | ) | const |
Definition at line 149 of file ParticleNavigator.cxx.
References fPrimaries.
Referenced by mcchk::LeptonAna::analyze(), ncs::NCAna::analyze(), sn::SupernovaMCCluster::BuildInteractionTrackIDMap(), trk::CosmicTrackAna::FillEventMCTruthHistograms(), murem::MuonRemove::FillTruthInfo(), tut::TutFilter::filter(), nuesand::FillNueSandbox::GetECF(), evd::SimulationDrawer::MCTruthLongText(), tut::TutProducer::produce(), murem::MuonRemove::RemoveByEfficiency(), and murem::MuonRemove::RemoveByTruth().
|
inline |
Definition at line 124 of file ParticleNavigator.h.
References Add(), and parse_dependency_file_t::list.
ParticleNavigator & sim::ParticleNavigator::operator= | ( | const ParticleNavigator & | rhs | ) |
Definition at line 73 of file ParticleNavigator.cxx.
References clear(), HTMLTools::entry(), fParticleList, and insert().
ParticleNavigator::mapped_type sim::ParticleNavigator::operator[] | ( | const key_type & | key | ) | const |
Be careful when using operator[] here! It takes the track ID as the argument: sim::ParticleNavigator partList; const sim::Particle* = partList[3]; The above line means the particle with trackID==3, NOT the third particle in the list! Use partList.Particle(3) if you want to get the particles by index number instead of track ID. Note that this only works in a const context. Use the insert() or Add() methods to add a new particle to the list.
Definition at line 330 of file ParticleNavigator.cxx.
References fParticleList, and MECModelEnuComparisons::i.
Referenced by at(), and lower_bound().
ParticleNavigator::mapped_type sim::ParticleNavigator::operator[] | ( | const key_type & | key | ) |
This non-const version of operator[] does NOT permit you to insert Particles into the list. Use Add() or insert() for that.
Definition at line 320 of file ParticleNavigator.cxx.
References fParticleList, and MECModelEnuComparisons::i.
ParticleNavigator::mapped_type sim::ParticleNavigator::Particle | ( | const size_type | index | ) | const |
Definition at line 127 of file ParticleNavigator.cxx.
References fParticleList, and MECModelEnuComparisons::i.
Referenced by ncs::GenieTruth::analyze(), murem::MuonRemove::FillTruthInfo(), skim::EvaluatorNumuCCpi::KeepEventSlices(), filter::TruthFilter::produce(), murem::MuonRemove::RemoveByEfficiency(), and murem::MuonRemove::RemoveByTruth().
ParticleNavigator::mapped_type sim::ParticleNavigator::Particle | ( | const size_type | index | ) |
Definition at line 135 of file ParticleNavigator.cxx.
References fParticleList, and MECModelEnuComparisons::i.
const sim::Particle * sim::ParticleNavigator::Primary | ( | const int | index | ) | const |
Definition at line 155 of file ParticleNavigator.cxx.
References HTMLTools::entry(), fParticleList, fPrimaries, and trackID.
Referenced by mmc::Validation::analyze(), mcchk::LeptonAna::analyze(), mono::SlowMonopoleAna::analyze(), mono::Monopole::analyze(), ncs::NCAna::analyze(), sn::SupernovaMCCluster::BuildInteractionTrackIDMap(), trk::CosmicTrackAna::FillEventMCTruthHistograms(), murem::MuonRemove::FillTruthInfo(), tut::TutFilter::filter(), mono::EventSelector::filter(), nuesand::FillNueSandbox::GetECF(), evd::SimulationDrawer::MCTruthLongText(), tut::TutProducer::produce(), murem::MuonRemove::RemoveByEfficiency(), and murem::MuonRemove::RemoveByTruth().
sim::Particle * sim::ParticleNavigator::Primary | ( | const int | index | ) |
Definition at line 172 of file ParticleNavigator.cxx.
References HTMLTools::entry(), fParticleList, fPrimaries, and trackID.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 145 of file ParticleNavigator.h.
References fParticleList.
Referenced by mmc::Validation::analyze(), mono::SlowMonopoleAna::analyze(), mono::Monopole::analyze(), ncs::GenieTruth::analyze(), murem::MuonRemove::FillTruthInfo(), mono::EventSelector::filter(), skim::EvaluatorNumuCCpi::KeepEventSlices(), sim::operator<<(), murem::MuonRemove::RemoveByEfficiency(), and murem::MuonRemove::RemoveByTruth().
|
inline |
Definition at line 147 of file ParticleNavigator.h.
References fParticleList.
const ParticleNavigator::key_type & sim::ParticleNavigator::TrackId | ( | const size_type | index | ) | const |
Definition at line 119 of file ParticleNavigator.cxx.
References fParticleList, and MECModelEnuComparisons::i.
Referenced by ncs::GenieTruth::analyze().
|
inline |
|
friend |
Definition at line 231 of file ParticleNavigator.cxx.
|
friend |
|
private |
Sorted list of particles in the event.
Definition at line 193 of file ParticleNavigator.h.
Referenced by Add(), begin(), clear(), Cut(), empty(), end(), erase(), find(), insert(), lower_bound(), operator=(), operator[](), Particle(), ParticleNavigator(), Primary(), rbegin(), rend(), size(), swap(), TrackId(), and upper_bound().
|
private |
Sorted list of the track IDs of primary particles.
Definition at line 198 of file ParticleNavigator.h.
Referenced by clear(), insert(), IsPrimary(), NumberOfPrimaries(), and Primary().