LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "ParticleInventoryService.h"
Classes | |
struct | ParticleInventoryServiceConfig |
Public Types | |
using | provider_type = ParticleInventory |
Private Member Functions | |
void | priv_PrepEvent (const art::Event &evt, art::ScheduleContext) |
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 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 |
Definition at line 42 of file ParticleInventoryService.h.
Definition at line 52 of file ParticleInventoryService.h.
cheat::ParticleInventoryService::ParticleInventoryService | ( | const ParticleInventoryServiceConfig & | config, |
art::ActivityRegistry & | reg | ||
) |
Definition at line 39 of file ParticleInventoryService.cc.
References fhicl::ParameterSet::get(), cheat::ParticleInventory::ParticleInventory(), priv_PrepEvent(), and art::ActivityRegistry::sPreProcessEvent.
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().
|
inherited |
Definition at line 35 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().
std::set< int > cheat::ParticleInventoryService::GetSetOfEveIds | ( | ) | const |
Definition at line 204 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::GetSetOfEveIds().
std::set< int > cheat::ParticleInventoryService::GetSetOfTrackIds | ( | ) | const |
Definition at line 197 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::GetSetOfTrackIds().
|
inlineinherited |
Definition at line 223 of file ParticleInventory.h.
|
inlineinherited |
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::ParticleInventoryService::MCTruthToParticles_Ps | ( | art::Ptr< simb::MCTruth > const & | mct | ) | const |
Definition at line 188 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::MCTruthToParticles_Ps().
Referenced by lcvn::AssignLabels::GetTopology().
const std::vector< art::Ptr< simb::MCTruth > > & cheat::ParticleInventoryService::MCTruthVector_Ps | ( | ) | const |
Definition at line 145 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::MCTruthVector_Ps().
const sim::ParticleList & cheat::ParticleInventoryService::ParticleList | ( | ) | const |
Definition at line 138 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::ParticleList().
Referenced by cheat::CheckBackTracking::analyze(), larg4::LArG4Ana::analyze(), pfpf::PFPAna::analyze(), cluster::ClusterAna::analyze(), opreco::OpticalRecoAna::analyze(), cluster::DBclusterAna::analyze(), hit::HitFinderAna::analyze(), cluster::ClusterTrackAna::analyze(), NuShowerEff::analyze(), opdet::SimPhotonCounter::analyze(), cheat::RecoCheckAna::CheckRecoEvents(), cheat::RecoCheckAna::CheckRecoVertices(), simfilter::FilterPrimaryPDG::filter(), shower::LArPandoraShowerCheatingAlg::GetTrueParticleMap(), ems::MCinfo::Info(), evd::SimulationDrawer::MCTruthVectors2D(), DUNE::NeutrinoShowerEff::processEff(), DUNE::MuonTrackingEff::processEff(), DUNE::NeutrinoTrackingEff::processEff(), vertex::VertexCheater::produce(), shwf::ShowerCheater::produce(), trkf::TrackCheater::produce(), cluster::ClusterCheater::produce(), and trkf::TrackKalmanCheater::produce().
|
inlineinherited |
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 91 of file ParticleInventoryService.h.
const art::Ptr< simb::MCTruth > & cheat::ParticleInventoryService::ParticleToMCTruth_P | ( | const simb::MCParticle * | p | ) | const |
Definition at line 180 of file ParticleInventoryService.cc.
References simb::MCParticle::TrackId(), and TrackIdToMCTruth_P().
Referenced by NuShowerEff::analyze().
|
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().
|
inherited |
A function to make both PrepTrackIdToMCTruthIndex and PrepMCTruthList run when both are needed.
|
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().
|
inherited |
A function to prepare and cache a map of TrackIds and MCTruth object indicies from fMCTruthList.
Referenced by priv_PrepTrackIdToMCTruthIndex().
|
private |
Definition at line 76 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::CanRun().
Referenced by priv_PrepEvent(), priv_PrepMCTruthList(), priv_PrepParticleList(), and priv_PrepTrackIdToMCTruthIndex().
|
inlineprivate |
Definition at line 113 of file ParticleInventoryService.h.
Referenced by priv_PrepMCTruthList().
|
inlineprivate |
Definition at line 112 of file ParticleInventoryService.h.
Referenced by priv_PrepParticleList().
|
private |
Definition at line 64 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::ClearEvent(), priv_CanRun(), priv_PrepMCTruthList(), priv_PrepParticleList(), and priv_PrepTrackIdToMCTruthIndex().
Referenced by ParticleInventoryService(), and Rebuild().
|
private |
Definition at line 114 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::PrepMCTruthList(), priv_CanRun(), and priv_MCTruthListReady().
Referenced by priv_PrepEvent().
|
private |
Definition at line 82 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::PrepParticleList(), priv_CanRun(), and priv_ParticleListReady().
Referenced by priv_PrepEvent().
|
private |
Definition at line 98 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::PrepTrackIdToMCTruthIndex(), priv_CanRun(), and priv_TrackIdToMCTruthReady().
Referenced by priv_PrepEvent().
|
inlineprivate |
Definition at line 114 of file ParticleInventoryService.h.
References DECLARE_ART_SERVICE.
Referenced by priv_PrepTrackIdToMCTruthIndex().
|
inline |
Definition at line 53 of file ParticleInventoryService.h.
References tca::evt.
void cheat::ParticleInventoryService::Rebuild | ( | const art::Event & | evt | ) |
Definition at line 58 of file ParticleInventoryService.cc.
References art::ScheduleContext::invalid(), and priv_PrepEvent().
Referenced by cheat::BackTrackerLoader::produce(), and cheat::PhotonBackTrackerLoader::produce().
|
inline |
Definition at line 64 of file ParticleInventoryService.h.
Referenced by cluster::DBclusterAna::analyze(), and cluster::ClusterCheater::produce().
int cheat::ParticleInventoryService::TrackIdToEveTrackId | ( | int | tid | ) | const |
Definition at line 175 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::TrackIdToEveTrackId().
Referenced by nnet::RawWaveformDump::analyze(), and nnet::RawWaveformClnSigDump::analyze().
|
inlineinherited |
Definition at line 254 of file ParticleInventory.h.
Referenced by cheat::BackTracker::HitToEveTrackIDEs(), and TrackIdToEveTrackId().
|
inline |
Definition at line 81 of file ParticleInventoryService.h.
Referenced by lar_pandora::LArPandoraInput::CreatePandoraMCParticles().
|
inlineinherited |
Definition at line 246 of file ParticleInventory.h.
const art::Ptr< simb::MCTruth > & cheat::ParticleInventoryService::TrackIdToMCTruth_P | ( | int | id | ) | const |
Definition at line 168 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::TrackIdToMCTruth_P().
Referenced by pfpf::PFPAna::analyze(), cluster::ClusterAna::analyze(), cluster::ClusterTrackAna::analyze(), opreco::OpticalRecoAna::get_MC_particle_origin(), tca::GetOrigin(), evd::SimulationDrawer::MCTruthVectors2D(), and ParticleToMCTruth_P().
|
inherited |
Definition at line 65 of file ParticleInventory.cc.
References util::abs(), cheat::ParticleInventory::fMCTObj, cheat::ParticleInventory::MCTObjects::fMCTruthList, and cheat::ParticleInventory::MCTObjects::fTrackIdToMCTruthIndex.
Referenced by cheat::ParticleInventory::MCTruthToParticles_Ps(), cheat::ParticleInventory::ParticleToMCTruth_P(), and TrackIdToMCTruth_P().
|
inlineinherited |
Definition at line 225 of file ParticleInventory.h.
|
inlineinherited |
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 74 of file ParticleInventoryService.h.
Referenced by nnet::RawWaveformDump::analyze(), and nnet::RawWaveformClnSigDump::analyze().
|
inlineinherited |
Definition at line 239 of file ParticleInventory.h.
const simb::MCParticle * cheat::ParticleInventoryService::TrackIdToMotherParticle_P | ( | int | id | ) | const |
Definition at line 161 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::TrackIdToMotherParticle_P().
Referenced by NuShowerEff::analyze(), and shower::TCShowerTemplateMaker::showerProfileTrue().
|
inherited |
Definition at line 59 of file ParticleInventory.cc.
References util::abs(), sim::ParticleList::EveId(), cheat::ParticleInventory::fParticleList, and cheat::ParticleInventory::TrackIdToParticle_P().
Referenced by TrackIdToMotherParticle_P().
|
inline |
Definition at line 68 of file ParticleInventoryService.h.
|
inlineinherited |
Definition at line 233 of file ParticleInventory.h.
const simb::MCParticle * cheat::ParticleInventoryService::TrackIdToParticle_P | ( | int | id | ) | const |
Definition at line 154 of file ParticleInventoryService.cc.
References cheat::ParticleInventory::TrackIdToParticle_P().
Referenced by NuShowerEff::analyze(), trkf::TrackAna::analyze(), trkf::TrackAna::anaStitch(), DUNE::NeutrinoShowerEff::checkCNNtrkshw(), cheat::RecoCheckAna::FillResults(), lcvn::AssignLabels::GetNeutralDaughterHitsRecursive(), lcvn::AssignLabels::GetProtoDUNEBeamInteractionType(), ems::MCinfo::Info(), cluster::ClusterCheater::produce(), t0::MCTruthT0Matching::produce(), shower::TCShowerTemplateMaker::showerProfileTrue(), shower::TCShowerAnalysis::truthMatcher(), DUNE::NeutrinoShowerEff::truthMatcher(), DUNE::NeutrinoTrackingEff::truthMatcher(), and DUNE::MuonTrackingEff::truthMatcher().
|
inherited |
Definition at line 46 of file ParticleInventory.cc.
References sim::ParticleList::end(), sim::ParticleList::find(), and cheat::ParticleInventory::fParticleList.
Referenced by cheat::ParticleInventory::TrackIdToMotherParticle_P(), and TrackIdToParticle_P().