LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "ParticleInventoryService.h"
Classes | |
struct | ParticleInventoryServiceConfig |
Public Types | |
using | provider_type = ParticleInventory |
Private Member Functions | |
void | priv_PrepEvent (const art::Event &evt) |
void | priv_PrepParticleList (const art::Event &evt) |
void | priv_PrepMCTruthList (const art::Event &evt) |
void | priv_PrepTrackIdToMCTruthIndex (const art::Event &evt) |
bool | priv_CanRun (const art::Event &evt) const |
bool | priv_ParticleListReady () |
bool | priv_MCTruthListReady () |
bool | priv_TrackIdToMCTruthReady () |
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 |
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 |
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 |
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 |
Definition at line 32 of file ParticleInventoryService.h.
Definition at line 43 of file ParticleInventoryService.h.
cheat::ParticleInventoryService::ParticleInventoryService | ( | const ParticleInventoryServiceConfig & | config, |
art::ActivityRegistry & | reg | ||
) |
Definition at line 47 of file ParticleInventoryService_service.cc.
References fhicl::ParameterSet::get(), cheat::ParticleInventory::ParticleInventory(), priv_PrepEvent(), and art::ActivityRegistry::sPreProcessEvent.
Referenced by provider().
cheat::ParticleInventoryService::ParticleInventoryService | ( | fhicl::ParameterSet const & | pset, |
art::ActivityRegistry & | reg | ||
) |
|
inherited |
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 priv_CanRun(), and cheat::ParticleInventory::TrackIdToMCTruthReady().
|
inherited |
Definition at line 38 of file ParticleInventory.cc.
References sim::ParticleList::clear(), cheat::ParticleInventory::fMCTObj, cheat::ParticleInventory::MCTObjects::fMCTruthList, cheat::ParticleInventory::fParticleList, and cheat::ParticleInventory::MCTObjects::fTrackIdToMCTruthIndex.
Referenced by priv_PrepEvent(), and cheat::ParticleInventory::TrackIdToMCTruthIndex().
std::set< int > cheat::ParticleInventoryService::GetSetOfEveIds | ( | ) |
Definition at line 181 of file ParticleInventoryService_service.cc.
References DEFINE_ART_SERVICE, and cheat::ParticleInventory::GetSetOfEveIds().
Referenced by ParticleToMCTruth().
|
inherited |
Definition at line 113 of file ParticleInventory.cc.
References sim::ParticleList::EveId(), cheat::ParticleInventory::fParticleList, and cheat::ParticleInventory::GetSetOfTrackIds().
Referenced by GetSetOfEveIds(), cheat::BackTracker::GetSetOfEveIds(), cheat::PhotonBackTracker::GetSetOfEveIds(), and cheat::ParticleInventory::ParticleToMCTruth().
std::set< int > cheat::ParticleInventoryService::GetSetOfTrackIds | ( | ) |
Definition at line 175 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::GetSetOfTrackIds().
Referenced by ParticleToMCTruth().
|
inherited |
Definition at line 104 of file ParticleInventory.cc.
References sim::ParticleList::begin(), sim::ParticleList::end(), and cheat::ParticleInventory::fParticleList.
Referenced by cheat::ParticleInventory::GetSetOfEveIds(), GetSetOfTrackIds(), cheat::BackTracker::GetSetOfTrackIds(), cheat::PhotonBackTracker::GetSetOfTrackIds(), and cheat::ParticleInventory::ParticleToMCTruth().
|
inlineinherited |
Definition at line 218 of file ParticleInventory.h.
References cheat::ParticleInventory::fMCTObj, and cheat::ParticleInventory::MCTObjects::fMCTruthList.
|
inlineinherited |
A simple check to determine if the MCTruthList has already been prepared and cached or not.
Definition at line 201 of file ParticleInventory.h.
References cheat::ParticleInventory::fMCTObj, and cheat::ParticleInventory::MCTObjects::fMCTruthList.
Referenced by priv_MCTruthListReady().
const std::vector< const simb::MCParticle * > cheat::ParticleInventoryService::MCTruthToParticles_Ps | ( | art::Ptr< simb::MCTruth > const & | mct | ) |
Definition at line 167 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::MCTruthToParticles_Ps().
Referenced by ParticleToMCTruth().
|
inherited |
Definition at line 92 of file ParticleInventory.cc.
References cheat::ParticleInventory::fParticleList, and cheat::ParticleInventory::TrackIdToMCTruth_P().
Referenced by MCTruthToParticles_Ps(), and cheat::ParticleInventory::ParticleToMCTruth().
const std::vector< art::Ptr< simb::MCTruth > > & cheat::ParticleInventoryService::MCTruthVector_Ps | ( | ) |
Definition at line 126 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::MCTruthVector_Ps().
Referenced by ParticleToMCTruth().
|
inherited |
Definition at line 87 of file ParticleInventory.cc.
References cheat::ParticleInventory::fMCTObj, and cheat::ParticleInventory::MCTObjects::fMCTruthList.
Referenced by MCTruthVector_Ps(), and cheat::ParticleInventory::ParticleToMCTruth().
const sim::ParticleList & cheat::ParticleInventoryService::ParticleList | ( | ) |
Definition at line 120 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::ParticleList().
Referenced by cheat::CheckBackTracking::analyze(), opreco::OpticalRecoAna::analyze(), larg4::LArG4Ana::analyze(), pfpf::PFPAna::analyze(), cluster::ClusterAna::analyze(), cluster::DBclusterAna::analyze(), hit::HitFinderAna::analyze(), opdet::SimPhotonCounter::analyze(), cheat::RecoCheckAna::CheckRecoEvents(), cheat::RecoCheckAna::CheckRecoVertices(), simfilter::FilterPrimaryPDG::filter(), tca::TrajClusterAlg::GetHitCollection(), ems::MCinfo::Info(), tca::MCParticleListUtils::MakeCheatShower(), tca::TruthMatcher::MatchTrueHits(), tca::TruthMatcher::MatchTruth(), tca::MCParticleListUtils::PrimaryElectronPFPID(), tca::MCParticleListUtils::PrimaryElectronStart(), tca::MCParticleListUtils::PrimaryElectronTjID(), DUNE::NeutrinoShowerEff::processEff(), DUNE::NeutrinoTrackingEff::processEff(), DUNE::MuonTrackingEff::processEff(), vertex::VertexCheater::produce(), shwf::ShowerCheater::produce(), trkf::TrackCheater::produce(), cluster::ClusterCheater::produce(), trkf::TrackKalmanCheater::produce(), provider(), tca::TruthMatcher::StudyPiZeros(), and tca::TruthMatcher::StudyShowerParents().
|
inlineinherited |
Definition at line 215 of file ParticleInventory.h.
References cheat::ParticleInventory::fParticleList.
Referenced by cheat::PhotonBackTracker::OpHitToEveTrackSDPs(), and ParticleList().
|
inlineinherited |
A simple check to determine if the ParticleList has already been prepared for this event or not.
Definition at line 200 of file ParticleInventory.h.
References sim::ParticleList::empty(), and cheat::ParticleInventory::fParticleList.
Referenced by priv_ParticleListReady().
|
inline |
Definition at line 74 of file ParticleInventoryService.h.
References GetSetOfEveIds(), GetSetOfTrackIds(), MCTruthToParticles_Ps(), MCTruthVector_Ps(), ParticleToMCTruth_P(), priv_CanRun(), priv_PrepEvent(), priv_PrepMCTruthList(), priv_PrepParticleList(), and priv_PrepTrackIdToMCTruthIndex().
|
inlineinherited |
Definition at line 241 of file ParticleInventory.h.
References cheat::ParticleInventory::GetSetOfEveIds(), cheat::ParticleInventory::GetSetOfTrackIds(), cheat::ParticleInventory::MCTruthToParticles_Ps(), cheat::ParticleInventory::MCTruthVector_Ps(), and cheat::ParticleInventory::ParticleToMCTruth_P().
const art::Ptr< simb::MCTruth > & cheat::ParticleInventoryService::ParticleToMCTruth_P | ( | const simb::MCParticle * | p | ) |
Definition at line 160 of file ParticleInventoryService_service.cc.
References simb::MCParticle::TrackId(), and TrackIdToMCTruth_P().
Referenced by ParticleToMCTruth(), and TrackIdToMCTruth().
|
inherited |
Definition at line 81 of file ParticleInventory.cc.
References simb::MCParticle::TrackId(), and cheat::ParticleInventory::TrackIdToMCTruth_P().
Referenced by cheat::ParticleInventory::ParticleToMCTruth(), and cheat::ParticleInventory::TrackIdToEveTrackId().
|
inherited |
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". |
|
inherited |
A function to load and cache the MCTruthList of the event.
Referenced by priv_PrepMCTruthList(), and cheat::ParticleInventory::TrackIdToMCTruthReady().
|
inherited |
A function to make both PrepTrackIdToMCTruthIndex and PrepMCTruthList run when both are needed.
Referenced by cheat::ParticleInventory::TrackIdToMCTruthReady().
|
inherited |
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 priv_PrepParticleList(), and cheat::ParticleInventory::TrackIdToMCTruthReady().
|
inherited |
A function to prepare and cache a map of TrackIds and MCTruth object indicies from fMCTruthList.
Referenced by priv_PrepTrackIdToMCTruthIndex(), and cheat::ParticleInventory::TrackIdToMCTruthReady().
|
private |
Definition at line 80 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::CanRun().
Referenced by ParticleToMCTruth(), priv_PrepEvent(), priv_PrepMCTruthList(), priv_PrepParticleList(), and priv_PrepTrackIdToMCTruthIndex().
|
inlineprivate |
Definition at line 99 of file ParticleInventoryService.h.
References cheat::ParticleInventory::MCTruthListReady().
Referenced by priv_PrepMCTruthList().
|
inlineprivate |
Definition at line 98 of file ParticleInventoryService.h.
References cheat::ParticleInventory::ParticleListReady().
Referenced by priv_PrepParticleList().
|
private |
Definition at line 69 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::ClearEvent(), priv_CanRun(), priv_PrepMCTruthList(), priv_PrepParticleList(), and priv_PrepTrackIdToMCTruthIndex().
Referenced by ParticleInventoryService(), ParticleToMCTruth(), and Rebuild().
|
private |
Definition at line 104 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::PrepMCTruthList(), priv_CanRun(), and priv_MCTruthListReady().
Referenced by ParticleToMCTruth(), and priv_PrepEvent().
|
private |
Definition at line 85 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::PrepParticleList(), priv_CanRun(), and priv_ParticleListReady().
Referenced by ParticleToMCTruth(), and priv_PrepEvent().
|
private |
Definition at line 95 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::PrepTrackIdToMCTruthIndex(), priv_CanRun(), and priv_TrackIdToMCTruthReady().
Referenced by ParticleToMCTruth(), and priv_PrepEvent().
|
inlineprivate |
Definition at line 100 of file ParticleInventoryService.h.
References DECLARE_ART_SERVICE, and cheat::ParticleInventory::TrackIdToMCTruthReady().
Referenced by priv_PrepTrackIdToMCTruthIndex().
|
inline |
Definition at line 44 of file ParticleInventoryService.h.
References ParticleInventoryService(), ParticleList(), and Rebuild().
void cheat::ParticleInventoryService::Rebuild | ( | const art::Event & | evt | ) |
Definition at line 64 of file ParticleInventoryService_service.cc.
References priv_PrepEvent().
Referenced by cheat::BackTrackerLoader::produce(), cheat::PhotonBackTrackerLoader::produce(), and provider().
|
inline |
Definition at line 56 of file ParticleInventoryService.h.
References cheat::ParticleInventory::SetEveIdCalculator(), and TrackIdToParticle_P().
Referenced by cluster::DBclusterAna::analyze(), and cluster::ClusterCheater::produce().
int cheat::ParticleInventoryService::TrackIdToEveTrackId | ( | const int & | tid | ) | const |
Definition at line 155 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::TrackIdToEveTrackId().
Referenced by TrackIdToMCTruth().
|
inline |
Definition at line 68 of file ParticleInventoryService.h.
References ParticleToMCTruth_P(), TrackIdToEveTrackId(), and TrackIdToMCTruth_P().
Referenced by lar_pandora::LArPandoraInput::CreatePandoraMCParticles().
|
inlineinherited |
Definition at line 233 of file ParticleInventory.h.
References cheat::ParticleInventory::TrackIdToMCTruth_P().
const art::Ptr< simb::MCTruth > & cheat::ParticleInventoryService::TrackIdToMCTruth_P | ( | int const & | id | ) |
Definition at line 148 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::TrackIdToMCTruth_P().
Referenced by cluster::ClusterAna::analyze(), pfpf::PFPAna::analyze(), opreco::OpticalRecoAna::get_MC_particle_origin(), tca::TrajClusterAlg::GetHitCollection(), tca::GetOrigin(), tca::TruthMatcher::MatchTrueHits(), ParticleToMCTruth_P(), TrackIdToMCTruth(), and TrackIdToMotherParticle().
|
inherited |
Definition at line 67 of file ParticleInventory.cc.
References cheat::ParticleInventory::fMCTObj, cheat::ParticleInventory::MCTObjects::fMCTruthList, and cheat::ParticleInventory::MCTObjects::fTrackIdToMCTruthIndex.
Referenced by cheat::ParticleInventory::MCTruthToParticles_Ps(), cheat::ParticleInventory::ParticleToMCTruth_P(), cheat::ParticleInventory::TrackIdToMCTruth(), TrackIdToMCTruth_P(), and cheat::ParticleInventory::TrackIdToMotherParticle().
|
inlineinherited |
Definition at line 220 of file ParticleInventory.h.
References cheat::ParticleInventory::ClearEvent(), cheat::ParticleInventory::fMCTObj, cheat::ParticleInventory::MCTObjects::fTrackIdToMCTruthIndex, and cheat::ParticleInventory::TrackIdToParticle_P().
|
inlineinherited |
A simple check to determine if the TrackIdToMCTruth map has been prepared or not.
Definition at line 202 of file ParticleInventory.h.
References cheat::ParticleInventory::CanRun(), cheat::ParticleInventory::fMCTObj, cheat::ParticleInventory::MCTObjects::fTrackIdToMCTruthIndex, cheat::ParticleInventory::PrepMCTruthList(), cheat::ParticleInventory::PrepMCTruthListAndTrackIdToMCTruthIndex(), cheat::ParticleInventory::PrepParticleList(), and cheat::ParticleInventory::PrepTrackIdToMCTruthIndex().
Referenced by priv_TrackIdToMCTruthReady().
|
inline |
Definition at line 64 of file ParticleInventoryService.h.
References TrackIdToMCTruth_P(), and TrackIdToMotherParticle_P().
|
inlineinherited |
Definition at line 229 of file ParticleInventory.h.
References cheat::ParticleInventory::TrackIdToMCTruth_P(), and cheat::ParticleInventory::TrackIdToMotherParticle_P().
const simb::MCParticle * cheat::ParticleInventoryService::TrackIdToMotherParticle_P | ( | int const & | id | ) |
Definition at line 141 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::TrackIdToMotherParticle_P().
Referenced by tca::TruthMatcher::MatchTrueHits(), TrackIdToMotherParticle(), and TrackIdToParticle().
|
inherited |
Definition at line 61 of file ParticleInventory.cc.
References sim::ParticleList::EveId(), cheat::ParticleInventory::fParticleList, and cheat::ParticleInventory::TrackIdToParticle_P().
Referenced by cheat::ParticleInventory::TrackIdToMotherParticle(), TrackIdToMotherParticle_P(), and cheat::ParticleInventory::TrackIdToParticle().
|
inline |
Definition at line 60 of file ParticleInventoryService.h.
References TrackIdToMotherParticle_P(), and TrackIdToParticle_P().
|
inlineinherited |
Definition at line 225 of file ParticleInventory.h.
References cheat::ParticleInventory::TrackIdToMotherParticle_P(), and cheat::ParticleInventory::TrackIdToParticle_P().
const simb::MCParticle * cheat::ParticleInventoryService::TrackIdToParticle_P | ( | int const & | id | ) |
Definition at line 134 of file ParticleInventoryService_service.cc.
References cheat::ParticleInventory::TrackIdToParticle_P().
Referenced by trkf::TrackAna::analyze(), trkf::TrackAna::anaStitch(), DUNE::NeutrinoShowerEff::checkCNNtrkshw(), cheat::RecoCheckAna::FillResults(), ems::MCinfo::Info(), cluster::ClusterCheater::produce(), t0::MCTruthT0Matching::produce(), SetEveIdCalculator(), TrackIdToParticle(), DUNE::NeutrinoShowerEff::truthMatcher(), DUNE::NeutrinoTrackingEff::truthMatcher(), and DUNE::MuonTrackingEff::truthMatcher().
|
inherited |
Definition at line 48 of file ParticleInventory.cc.
References sim::ParticleList::end(), sim::ParticleList::find(), and cheat::ParticleInventory::fParticleList.
Referenced by cheat::ParticleInventory::TrackIdToMCTruthIndex(), cheat::ParticleInventory::TrackIdToMotherParticle_P(), cheat::ParticleInventory::TrackIdToParticle(), and TrackIdToParticle_P().