LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "ParticleInventory.h"
Classes | |
struct | MCTObjects |
A simple struct to contain the MC Truth information. More... | |
struct | ParticleInventoryConfig |
FHICL Validation Object This struct is used for loading the fhicl configuration. More... | |
Public Member Functions | |
ParticleInventory (const ParticleInventoryConfig &config) | |
ParticleInventory (const fhicl::ParameterSet &pSet) | |
ParticleInventory (ParticleInventory const &)=delete | |
template<typename Evt > | |
void | PrepEvent (const Evt &evt) |
Function to set up the ParticleInventory state for an event. This is a function to tell the ParticleInventory to prepare itself to work with a particular event. More... | |
bool | ParticleListReady () const |
A simple check to determine if the ParticleList has already been prepared for this event or not. More... | |
bool | MCTruthListReady () const |
A simple check to determine if the MCTruthList has already been prepared and cached or not. More... | |
bool | TrackIdToMCTruthReady () const |
A simple check to determine if the TrackIdToMCTruth map has been prepared or not. More... | |
template<typename Evt > | |
void | PrepParticleList (const Evt &evt) const |
A function to load the ParticleList and cache it This function will find the particle list and load it for later use. Ideally this would would be used for a "lazy" loading of the backtracker, but this does not work in the current setup of art. More... | |
template<typename Evt > | |
void | PrepTrackIdToMCTruthIndex (const Evt &evt) const |
A function to prepare and cache a map of TrackIds and MCTruth object indicies from fMCTruthList. More... | |
template<typename Evt > | |
void | PrepMCTruthList (const Evt &evt) const |
A function to load and cache the MCTruthList of the event. More... | |
template<typename Evt > | |
void | PrepMCTruthListAndTrackIdToMCTruthIndex (const Evt &evt) const |
A function to make both PrepTrackIdToMCTruthIndex and PrepMCTruthList run when both are needed. More... | |
template<typename Evt > | |
bool | CanRun (const Evt &evt) const |
A short function to check if use of the backtracker is appropriate or not based on the type of input file. This function simply checks to see if the file loaded is real data, or MC Simulation, as backtracking on real data makes no sense. If one does try to backtrack real data, this will throw and exception. More... | |
const sim::ParticleList & | ParticleList () const |
void | SetEveIdCalculator (sim::EveIdCalculator *ec) |
const std::vector< art::Ptr< simb::MCTruth > > & | MCTruthList () const |
const std::map< int, int > & | TrackIdToMCTruthIndex () const |
void | ClearEvent () |
const simb::MCParticle * | TrackIdToParticle_P (int const &id) const |
simb::MCParticle | TrackIdToParticle (int const &id) const |
const simb::MCParticle * | TrackIdToMotherParticle_P (int const &id) const |
simb::MCParticle | TrackIdToMotherParticle (int const &id) const |
const art::Ptr< simb::MCTruth > & | TrackIdToMCTruth_P (int const &id) const |
simb::MCTruth | TrackIdToMCTruth (int const &id) const |
int | TrackIdToEveTrackId (const int &tid) const |
const art::Ptr< simb::MCTruth > & | ParticleToMCTruth_P (const simb::MCParticle *p) const |
simb::MCTruth | ParticleToMCTruth (const simb::MCParticle *p) const |
const std::vector< art::Ptr< simb::MCTruth > > & | MCTruthVector_Ps () const |
std::vector< const simb::MCParticle * > | MCTruthToParticles_Ps (art::Ptr< simb::MCTruth > const &mct) const |
std::set< int > | GetSetOfTrackIds () const |
std::set< int > | GetSetOfEveIds () const |
Private Attributes | |
sim::ParticleList | fParticleList |
MCTObjects | fMCTObj |
art::InputTag | fG4ModuleLabel |
std::string | fEveIdCalculator |
bool | fOverrideRealData |
Definition at line 174 of file ParticleInventory.h.
cheat::ParticleInventory::ParticleInventory | ( | const ParticleInventoryConfig & | config | ) |
Definition at line 21 of file ParticleInventory.cc.
Referenced by cheat::ParticleInventoryService::ParticleInventoryService().
cheat::ParticleInventory::ParticleInventory | ( | const fhicl::ParameterSet & | pSet | ) |
Definition at line 28 of file ParticleInventory.cc.
|
delete |
bool cheat::ParticleInventory::CanRun | ( | const Evt & | evt | ) | const |
A short function to check if use of the backtracker is appropriate or not based on the type of input file. This function simply checks to see if the file loaded is real data, or MC Simulation, as backtracking on real data makes no sense. If one does try to backtrack real data, this will throw and exception.
Referenced by cheat::ParticleInventoryService::priv_CanRun().
void cheat::ParticleInventory::ClearEvent | ( | ) |
Definition at line 35 of file ParticleInventory.cc.
References sim::ParticleList::clear(), fMCTObj, cheat::ParticleInventory::MCTObjects::fMCTruthList, fParticleList, and cheat::ParticleInventory::MCTObjects::fTrackIdToMCTruthIndex.
Referenced by cheat::ParticleInventoryService::priv_PrepEvent().
std::set< int > cheat::ParticleInventory::GetSetOfEveIds | ( | ) | const |
Definition at line 115 of file ParticleInventory.cc.
References sim::ParticleList::EveId(), fParticleList, and GetSetOfTrackIds().
Referenced by cheat::ParticleInventoryService::GetSetOfEveIds(), and cheat::PhotonBackTracker::GetSetOfEveIds().
std::set< int > cheat::ParticleInventory::GetSetOfTrackIds | ( | ) | const |
Definition at line 105 of file ParticleInventory.cc.
References sim::ParticleList::begin(), sim::ParticleList::end(), and fParticleList.
Referenced by GetSetOfEveIds(), cheat::ParticleInventoryService::GetSetOfTrackIds(), and cheat::PhotonBackTracker::GetSetOfTrackIds().
|
inline |
Definition at line 223 of file ParticleInventory.h.
|
inline |
A simple check to determine if the MCTruthList has already been prepared and cached or not.
Definition at line 206 of file ParticleInventory.h.
References util::empty().
std::vector< const simb::MCParticle * > cheat::ParticleInventory::MCTruthToParticles_Ps | ( | art::Ptr< simb::MCTruth > const & | mct | ) | const |
Definition at line 93 of file ParticleInventory.cc.
References fParticleList, and TrackIdToMCTruth_P().
Referenced by cheat::ParticleInventoryService::MCTruthToParticles_Ps().
const std::vector< art::Ptr< simb::MCTruth > > & cheat::ParticleInventory::MCTruthVector_Ps | ( | ) | const |
Definition at line 87 of file ParticleInventory.cc.
References fMCTObj, and cheat::ParticleInventory::MCTObjects::fMCTruthList.
Referenced by cheat::ParticleInventoryService::MCTruthVector_Ps().
|
inline |
Definition at line 220 of file ParticleInventory.h.
Referenced by cheat::PhotonBackTracker::OpHitToEveTrackSDPs(), and cheat::ParticleInventoryService::ParticleList().
|
inline |
A simple check to determine if the ParticleList has already been prepared for this event or not.
Definition at line 205 of file ParticleInventory.h.
|
inline |
Definition at line 258 of file ParticleInventory.h.
const art::Ptr< simb::MCTruth > & cheat::ParticleInventory::ParticleToMCTruth_P | ( | const simb::MCParticle * | p | ) | const |
Definition at line 80 of file ParticleInventory.cc.
References simb::MCParticle::TrackId(), and TrackIdToMCTruth_P().
void cheat::ParticleInventory::PrepEvent | ( | const Evt & | evt | ) |
Function to set up the ParticleInventory state for an event. This is a function to tell the ParticleInventory to prepare itself to work with a particular event.
evt | The event the ParticleInventory should work with. *Note. This use breaks the multithreading model because the service has a "state". |
void cheat::ParticleInventory::PrepMCTruthList | ( | const Evt & | evt | ) | const |
A function to load and cache the MCTruthList of the event.
Referenced by cheat::ParticleInventoryService::priv_PrepMCTruthList().
void cheat::ParticleInventory::PrepMCTruthListAndTrackIdToMCTruthIndex | ( | const Evt & | evt | ) | const |
A function to make both PrepTrackIdToMCTruthIndex and PrepMCTruthList run when both are needed.
void cheat::ParticleInventory::PrepParticleList | ( | const Evt & | evt | ) | const |
A function to load the ParticleList and cache it This function will find the particle list and load it for later use. Ideally this would would be used for a "lazy" loading of the backtracker, but this does not work in the current setup of art.
Referenced by cheat::ParticleInventoryService::priv_PrepParticleList().
void cheat::ParticleInventory::PrepTrackIdToMCTruthIndex | ( | const Evt & | evt | ) | const |
A function to prepare and cache a map of TrackIds and MCTruth object indicies from fMCTruthList.
Referenced by cheat::ParticleInventoryService::priv_PrepTrackIdToMCTruthIndex().
|
inline |
Definition at line 221 of file ParticleInventory.h.
|
inline |
Definition at line 254 of file ParticleInventory.h.
Referenced by cheat::BackTracker::HitToEveTrackIDEs(), and cheat::ParticleInventoryService::TrackIdToEveTrackId().
|
inline |
Definition at line 246 of file ParticleInventory.h.
const art::Ptr< simb::MCTruth > & cheat::ParticleInventory::TrackIdToMCTruth_P | ( | int const & | id | ) | const |
Definition at line 65 of file ParticleInventory.cc.
References util::abs(), fMCTObj, cheat::ParticleInventory::MCTObjects::fMCTruthList, and cheat::ParticleInventory::MCTObjects::fTrackIdToMCTruthIndex.
Referenced by MCTruthToParticles_Ps(), ParticleToMCTruth_P(), and cheat::ParticleInventoryService::TrackIdToMCTruth_P().
|
inline |
Definition at line 225 of file ParticleInventory.h.
|
inline |
A simple check to determine if the TrackIdToMCTruth map has been prepared or not.
Definition at line 207 of file ParticleInventory.h.
|
inline |
Definition at line 239 of file ParticleInventory.h.
const simb::MCParticle * cheat::ParticleInventory::TrackIdToMotherParticle_P | ( | int const & | id | ) | const |
Definition at line 59 of file ParticleInventory.cc.
References util::abs(), sim::ParticleList::EveId(), fParticleList, and TrackIdToParticle_P().
Referenced by cheat::ParticleInventoryService::TrackIdToMotherParticle_P().
|
inline |
Definition at line 233 of file ParticleInventory.h.
const simb::MCParticle * cheat::ParticleInventory::TrackIdToParticle_P | ( | int const & | id | ) | const |
Definition at line 46 of file ParticleInventory.cc.
References sim::ParticleList::end(), sim::ParticleList::find(), and fParticleList.
Referenced by TrackIdToMotherParticle_P(), and cheat::ParticleInventoryService::TrackIdToParticle_P().
|
private |
Definition at line 288 of file ParticleInventory.h.
|
private |
Definition at line 281 of file ParticleInventory.h.
|
mutableprivate |
Definition at line 279 of file ParticleInventory.h.
Referenced by ClearEvent(), MCTruthVector_Ps(), and TrackIdToMCTruth_P().
|
private |
Definition at line 289 of file ParticleInventory.h.
|
mutableprivate |
Definition at line 273 of file ParticleInventory.h.
Referenced by ClearEvent(), GetSetOfEveIds(), GetSetOfTrackIds(), MCTruthToParticles_Ps(), TrackIdToMotherParticle_P(), and TrackIdToParticle_P().