LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Example analyzer module. More...
Classes | |
struct | Config |
Public Types | |
using | Parameters = art::EDAnalyzer::Table< Config > |
using | ModuleType = EDAnalyzer |
Public Member Functions | |
AnalysisExample (Parameters const &config) | |
Constructor: configures the module (see the Config structure above) More... | |
virtual void | beginJob () override |
virtual void | beginRun (const art::Run &run) override |
virtual void | analyze (const art::Event &event) override |
void | doBeginJob (SharedResources const &resources) |
void | doEndJob () |
void | doRespondToOpenInputFile (FileBlock const &fb) |
void | doRespondToCloseInputFile (FileBlock const &fb) |
void | doRespondToOpenOutputFiles (FileBlock const &fb) |
void | doRespondToCloseOutputFiles (FileBlock const &fb) |
bool | doBeginRun (RunPrincipal &rp, ModuleContext const &mc) |
bool | doEndRun (RunPrincipal &rp, ModuleContext const &mc) |
bool | doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc) |
bool | doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc) |
bool | doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed) |
ModuleDescription const & | moduleDescription () const |
void | setModuleDescription (ModuleDescription const &) |
std::array< std::vector< ProductInfo >, NumBranchTypes > const & | getConsumables () const |
void | sortConsumables (std::string const ¤t_process_name) |
std::unique_ptr< Worker > | makeWorker (WorkerParams const &wp) |
template<typename T , BranchType BT> | |
ViewToken< T > | consumesView (InputTag const &tag) |
template<typename T , BranchType BT> | |
ViewToken< T > | mayConsumeView (InputTag const &tag) |
Protected Member Functions | |
std::string const & | processName () const |
bool | wantAllEvents () const noexcept |
bool | wantEvent (ScheduleID id, Event const &e) const |
Handle< TriggerResults > | getTriggerResults (Event const &e) const |
ConsumesCollector & | consumesCollector () |
template<typename T , BranchType = InEvent> | |
ProductToken< T > | consumes (InputTag const &) |
template<typename Element , BranchType = InEvent> | |
ViewToken< Element > | consumesView (InputTag const &) |
template<typename T , BranchType = InEvent> | |
void | consumesMany () |
template<typename T , BranchType = InEvent> | |
ProductToken< T > | mayConsume (InputTag const &) |
template<typename Element , BranchType = InEvent> | |
ViewToken< Element > | mayConsumeView (InputTag const &) |
template<typename T , BranchType = InEvent> | |
void | mayConsumeMany () |
Private Attributes | |
art::InputTag | fSimulationProducerLabel |
art::InputTag | fHitProducerLabel |
The name of the producer that created hits. More... | |
art::InputTag | fClusterProducerLabel |
int | fSelectedPDG |
PDG code of particle we'll focus on. More... | |
double | fBinSize |
For dE/dx work: the value of dx. More... | |
TH1D * | fPDGCodeHist |
PDG code of all particles. More... | |
TH1D * | fMomentumHist |
momentum [GeV] of all selected particles More... | |
TH1D * | fTrackLengthHist |
true length [cm] of all selected particles More... | |
TTree * | fSimulationNtuple |
tuple with simulated data More... | |
TTree * | fReconstructionNtuple |
tuple with reconstructed data More... | |
geo::GeometryCore const * | fGeometryService |
pointer to Geometry provider More... | |
double | fElectronsToGeV |
conversion factor More... | |
int | fTriggerOffset |
(units of ticks) time of expected neutrino event More... | |
The variables that will go into both n-tuples. | |
int | fEvent |
number of the event being processed More... | |
int | fRun |
number of the run being processed More... | |
int | fSubRun |
The variables that will go into the simulation n-tuple. | |
int | fSimPDG |
PDG ID of the particle being processed. More... | |
int | fSimTrackID |
GEANT ID of the particle being processed. More... | |
double | fStartXYZT [4] |
(x,y,z,t) of the true start of the particle More... | |
double | fEndXYZT [4] |
(x,y,z,t) of the true end of the particle More... | |
double | fStartPE [4] |
(Px,Py,Pz,E) at the true start of the particle More... | |
double | fEndPE [4] |
(Px,Py,Pz,E) at the true end of the particle More... | |
int | fSimNdEdxBins |
Number of dE/dx bins in a given track. More... | |
std::vector< double > | fSimdEdxBins |
Variables used in the reconstruction n-tuple | |
int | fRecoPDG |
PDG ID of the particle being processed. More... | |
int | fRecoTrackID |
GEANT ID of the particle being processed. More... | |
int | fRecoNdEdxBins |
Number of dE/dx bins in a given track. More... | |
std::vector< double > | fRecodEdxBins |
Example analyzer module.
This class extracts information from the generated and reconstructed particles.
It produces histograms for the simulated particles in the input file:
It also produces two ROOT trees.
The first ROOT tree contains information on the simulated particles, including "dEdx", a binned histogram of collected charge as function of track range.
The second ROOT tree contains information on the reconstructed hits.
Definition at line 178 of file AnalysisExample_module.cc.
|
inherited |
Definition at line 22 of file EDAnalyzer.h.
Definition at line 236 of file AnalysisExample_module.cc.
|
explicit |
Constructor: configures the module (see the Config structure above)
Definition at line 374 of file AnalysisExample_module.cc.
References fClusterProducerLabel, fGeometryService, fHitProducerLabel, fSimulationProducerLabel, fTriggerOffset, and detinfo::trigger_offset().
|
overridevirtual |
Definition at line 481 of file AnalysisExample_module.cc.
References bin, tca::dEdx(), DEFINE_ART_MODULE, geo::GeometryCore::DetHalfHeight(), geo::GeometryCore::DetHalfWidth(), geo::GeometryCore::DetLength(), energy, fBinSize, fClusterProducerLabel, fElectronsToGeV, fEndPE, fEndXYZT, fEvent, fGeometryService, fHitProducerLabel, fMomentumHist, fPDGCodeHist, fRecodEdxBins, fRecoNdEdxBins, fReconstructionNtuple, fRecoPDG, fRecoTrackID, fRun, fSelectedPDG, fSimdEdxBins, fSimNdEdxBins, fSimPDG, fSimTrackID, fSimulationNtuple, fSimulationProducerLabel, fStartPE, fStartXYZT, fSubRun, fTrackLengthHist, art::ProductRetriever::getByLabel(), hits(), geo::kCollection, MF_LOG_DEBUG, simb::MCParticle::PdgCode(), simb::MCParticle::Position(), simb::MCParticle::Process(), and geo::GeometryCore::SignalType().
|
overridevirtual |
Reimplemented from art::EDAnalyzer.
Definition at line 403 of file AnalysisExample_module.cc.
References fEndPE, fEndXYZT, fEvent, fGeometryService, fMomentumHist, fPDGCodeHist, fRecodEdxBins, fRecoNdEdxBins, fReconstructionNtuple, fRecoPDG, fRecoTrackID, fRun, fSimdEdxBins, fSimNdEdxBins, fSimPDG, fSimTrackID, fSimulationNtuple, fStartPE, fStartXYZT, fSubRun, and fTrackLengthHist.
|
overridevirtual |
Definition at line 470 of file AnalysisExample_module.cc.
References fElectronsToGeV, and sim::LArG4Parameters::GeVToElectrons().
|
protectedinherited |
Definition at line 61 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().
|
protectedinherited |
|
protectedinherited |
Definition at line 75 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().
|
protectedinherited |
|
inherited |
Definition at line 68 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().
|
inherited |
Definition at line 25 of file Analyzer.cc.
Referenced by art::detail::Analyzer::Analyzer().
|
inherited |
Definition at line 68 of file Analyzer.cc.
References art::ModuleContext::scheduleID().
Referenced by art::detail::Analyzer::Analyzer().
|
inherited |
Definition at line 84 of file Analyzer.cc.
References art::ModuleContext::scheduleID().
Referenced by art::detail::Analyzer::Analyzer().
|
inherited |
Definition at line 33 of file Analyzer.cc.
Referenced by art::detail::Analyzer::Analyzer().
|
inherited |
Definition at line 76 of file Analyzer.cc.
References art::ModuleContext::scheduleID().
Referenced by art::detail::Analyzer::Analyzer().
|
inherited |
Definition at line 92 of file Analyzer.cc.
References art::ModuleContext::scheduleID().
Referenced by art::detail::Analyzer::Analyzer().
|
inherited |
Definition at line 100 of file Analyzer.cc.
References e, and art::ModuleContext::scheduleID().
Referenced by art::detail::Analyzer::Analyzer().
|
inherited |
Definition at line 47 of file Analyzer.cc.
Referenced by art::detail::Analyzer::Analyzer().
|
inherited |
Definition at line 61 of file Analyzer.cc.
Referenced by art::detail::Analyzer::Analyzer().
|
inherited |
Definition at line 40 of file Analyzer.cc.
Referenced by art::detail::Analyzer::Analyzer().
|
inherited |
Definition at line 54 of file Analyzer.cc.
Referenced by art::detail::Analyzer::Analyzer().
|
inherited |
Definition at line 43 of file ModuleBase.cc.
References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().
|
protectedinherited |
Definition at line 75 of file Observer.cc.
References art::ProductRetriever::get(), and art::Observer::selectors_.
Referenced by art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().
|
inherited |
Definition at line 37 of file ModuleBase.cc.
References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.
|
protectedinherited |
Definition at line 82 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().
|
protectedinherited |
Definition at line 96 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().
|
protectedinherited |
|
inherited |
Definition at line 89 of file ModuleBase.h.
References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().
|
inherited |
Definition at line 13 of file ModuleBase.cc.
References art::errors::LogicError.
Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().
|
protectedinherited |
Definition at line 57 of file Observer.cc.
References art::Observer::process_name_.
Referenced by art::FileDumperOutput::printPrincipal().
|
inherited |
|
inherited |
Definition at line 49 of file ModuleBase.cc.
References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().
|
inlineprotectednoexceptinherited |
Definition at line 31 of file Observer.h.
References e, art::Observer::getTriggerResults(), art::Observer::wantAllEvents_, and art::Observer::wantEvent().
|
protectedinherited |
Definition at line 63 of file Observer.cc.
References art::Observer::rejectors_, art::Observer::selectors_, and art::Observer::wantAllEvents_.
Referenced by art::OutputModule::doEvent(), art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().
|
private |
For dE/dx work: the value of dx.
Definition at line 297 of file AnalysisExample_module.cc.
Referenced by analyze().
|
private |
The name of the producer that created clusters
Definition at line 294 of file AnalysisExample_module.cc.
Referenced by AnalysisExample(), and analyze().
|
private |
conversion factor
Definition at line 353 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginRun().
|
private |
(Px,Py,Pz,E) at the true end of the particle
Definition at line 327 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
(x,y,z,t) of the true end of the particle
Definition at line 325 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
number of the event being processed
Definition at line 311 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
pointer to Geometry provider
Definition at line 352 of file AnalysisExample_module.cc.
Referenced by AnalysisExample(), analyze(), and beginJob().
|
private |
The name of the producer that created hits.
Definition at line 293 of file AnalysisExample_module.cc.
Referenced by AnalysisExample(), and analyze().
|
private |
momentum [GeV] of all selected particles
Definition at line 301 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
PDG code of all particles.
Definition at line 300 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
The vector that will be used to accumulate dE/dx values as a function of range.
Definition at line 347 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
Number of dE/dx bins in a given track.
Definition at line 343 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
tuple with reconstructed data
Definition at line 306 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
PDG ID of the particle being processed.
Definition at line 339 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
GEANT ID of the particle being processed.
Definition at line 340 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
number of the run being processed
Definition at line 312 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
PDG code of particle we'll focus on.
Definition at line 296 of file AnalysisExample_module.cc.
Referenced by analyze().
|
private |
The vector that will be used to accumulate dE/dx values as a function of range.
Definition at line 334 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
Number of dE/dx bins in a given track.
Definition at line 330 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
PDG ID of the particle being processed.
Definition at line 318 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
GEANT ID of the particle being processed.
Definition at line 319 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
tuple with simulated data
Definition at line 305 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
The name of the producer that tracked simulated particles through the detector
Definition at line 291 of file AnalysisExample_module.cc.
Referenced by AnalysisExample(), and analyze().
|
private |
(Px,Py,Pz,E) at the true start of the particle
Definition at line 326 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
(x,y,z,t) of the true start of the particle
Definition at line 324 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
number of the sub-run being processed
Definition at line 313 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
true length [cm] of all selected particles
Definition at line 302 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
(units of ticks) time of expected neutrino event
Definition at line 354 of file AnalysisExample_module.cc.
Referenced by AnalysisExample().