LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
Example analyzer module. More...
Classes | |
struct | Config |
Public Types | |
using | Parameters = art::EDAnalyzer::Table< Config > |
using | WorkerType = WorkerT< EDAnalyzer > |
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 |
std::string | workerType () const |
bool | modifiesEvent () const |
void | registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &) |
std::string const & | processName () const |
bool | wantAllEvents () const |
bool | wantEvent (Event const &e) |
fhicl::ParameterSetID | selectorConfig () const |
art::Handle< art::TriggerResults > | getTriggerResults (Event const &e) const |
template<typename T , BranchType = InEvent> | |
ProductToken< T > | consumes (InputTag const &) |
template<typename T , art::BranchType BT> | |
art::ProductToken< T > | consumes (InputTag const &it) |
template<typename T , BranchType = InEvent> | |
void | consumesMany () |
template<typename Element , BranchType = InEvent> | |
ViewToken< Element > | consumesView (InputTag const &) |
template<typename T , art::BranchType BT> | |
art::ViewToken< T > | consumesView (InputTag const &it) |
template<typename T , BranchType = InEvent> | |
ProductToken< T > | mayConsume (InputTag const &) |
template<typename T , art::BranchType BT> | |
art::ProductToken< T > | mayConsume (InputTag const &it) |
template<typename T , BranchType = InEvent> | |
void | mayConsumeMany () |
template<typename Element , BranchType = InEvent> | |
ViewToken< Element > | mayConsumeView (InputTag const &) |
template<typename T , art::BranchType BT> | |
art::ViewToken< T > | mayConsumeView (InputTag const &it) |
base_engine_t & | createEngine (seed_t seed) |
base_engine_t & | createEngine (seed_t seed, std::string const &kind_of_engine_to_make) |
base_engine_t & | createEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label) |
seed_t | get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1) |
Static Public Member Functions | |
static cet::exempt_ptr< Consumer > | non_module_context () |
Protected Member Functions | |
CurrentProcessingContext const * | currentContext () const |
detail::CachedProducts & | cachedProducts () |
void | validateConsumedProduct (BranchType const bt, ProductInfo const &pi) |
void | prepareForJob (fhicl::ParameterSet const &pset) |
void | showMissingConsumes () const |
Private Attributes | |
art::InputTag | fSimulationProducerLabel |
The name of the producer that tracked simulated particles through the detector. More... | |
art::InputTag | fHitProducerLabel |
The name of the producer that created hits. More... | |
art::InputTag | fClusterProducerLabel |
The name of the producer that created clusters. More... | |
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... | |
detinfo::DetectorClocks const * | fTimeService |
pointer to detector clock time service 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 |
The vector that will be used to accumulate dE/dx values as a function of range. More... | |
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 |
The vector that will be used to accumulate dE/dx values as a function of range. More... | |
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 182 of file AnalysisExample_module.cc.
|
inherited |
Definition at line 39 of file EDAnalyzer.h.
Definition at line 247 of file AnalysisExample_module.cc.
|
inherited |
Definition at line 38 of file EDAnalyzer.h.
|
explicit |
Constructor: configures the module (see the Config structure above)
Definition at line 383 of file AnalysisExample_module.cc.
References fClusterProducerLabel, fGeometryService, fHitProducerLabel, fSimulationProducerLabel, fTimeService, and fTriggerOffset.
|
overridevirtual |
Definition at line 489 of file AnalysisExample_module.cc.
References bin, 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, fTimeService, fTrackLengthHist, art::DataViewImpl::getByLabel(), hits(), geo::kCollection, LOG_DEBUG, max, min, simb::MCParticle::PdgCode(), simb::MCParticle::Position(), simb::MCParticle::Process(), geo::GeometryCore::SignalType(), and detinfo::DetectorClocks::TPCTick2TDC().
|
overridevirtual |
Reimplemented from art::EDAnalyzer.
Definition at line 414 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, fTrackLengthHist, and art::TFileDirectory::make().
|
overridevirtual |
Definition at line 478 of file AnalysisExample_module.cc.
References fElectronsToGeV, and sim::LArG4Parameters::GeVToElectrons().
|
inlineprotectedinherited |
Definition at line 79 of file EventObserverBase.h.
References art::EventObserverBase::selectors_.
Referenced by art::EDAnalyzer::doEvent(), and art::OutputModule::doWriteEvent().
|
inherited |
|
inherited |
Definition at line 147 of file Consumer.h.
References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().
|
inherited |
Definition at line 162 of file Consumer.h.
|
inherited |
|
inherited |
Definition at line 172 of file Consumer.h.
References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().
|
inherited |
Definition at line 26 of file EngineCreator.cc.
References art::EngineCreator::rng().
Referenced by evgen::CosmicsGen::CosmicsGen(), rndm::NuRandomService::createEngine(), cluster::fuzzyCluster::fuzzyCluster(), cluster::HoughLineFinder::HoughLineFinder(), art::MixFilter< T >::initEngine_(), larg4::LArG4::LArG4(), evgen::LightSource::LightSource(), evgen::NeutronOsc::NeutronOsc(), evgen::NucleonDecay::NucleonDecay(), opdet::OpMCDigi::OpMCDigi(), opdet::OptDetDigitizer::OptDetDigitizer(), phot::PhotonLibraryPropagation::PhotonLibraryPropagation(), detsim::SimDriftElectrons::SimDriftElectrons(), evgen::SingleGen::SingleGen(), evgen::SNNueAr40CCGen::SNNueAr40CCGen(), ToyOneShowerGen::ToyOneShowerGen(), and trkf::Track3DKalman::Track3DKalman().
|
inherited |
Definition at line 32 of file EngineCreator.cc.
References art::EngineCreator::rng().
|
inherited |
Definition at line 40 of file EngineCreator.cc.
References art::EngineCreator::rng().
|
protectedinherited |
Definition at line 114 of file EDAnalyzer.cc.
References art::EDAnalyzer::current_context_.
Referenced by art::EDAnalyzer::workerType().
|
inherited |
Definition at line 49 of file EngineCreator.cc.
References fhicl::ParameterSet::get().
Referenced by art::MixFilter< T >::initEngine_().
|
inlineinherited |
Definition at line 61 of file EventObserverBase.h.
References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.
Referenced by art::OutputModule::doWriteEvent().
|
inherited |
|
inherited |
Definition at line 190 of file Consumer.h.
References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().
|
inherited |
Definition at line 205 of file Consumer.h.
|
inherited |
|
inherited |
Definition at line 215 of file Consumer.h.
References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().
|
inlineinherited |
Definition at line 25 of file EventObserverBase.h.
|
staticinherited |
Definition at line 76 of file Consumer.cc.
Referenced by art::RootOutput::beginSubRun(), art::OutputModule::doBeginRun(), art::OutputModule::doBeginSubRun(), art::OutputModule::doEndRun(), art::OutputModule::doEndSubRun(), art::ProducingService::doPostReadEvent(), art::ProducingService::doPostReadRun(), art::ProducingService::doPostReadSubRun(), art::OutputModule::doWriteEvent(), art::ProcessPackage< L >::postScheduleSignal(), art::BeginEndPackage< Level::Run >::Begin::postScheduleSignal(), art::BeginEndPackage< Level::Run >::End::postScheduleSignal(), art::BeginEndPackage< Level::SubRun >::Begin::postScheduleSignal(), art::BeginEndPackage< Level::SubRun >::End::postScheduleSignal(), art::ProcessPackage< L >::preScheduleSignal(), art::BeginEndPackage< Level::Run >::Begin::preScheduleSignal(), art::BeginEndPackage< Level::SubRun >::Begin::preScheduleSignal(), art::EventProcessor::readEvent(), art::EventProcessor::readRun(), art::EmptyEvent::readRun_(), art::EventProcessor::readSubRun(), and art::EmptyEvent::readSubRun_().
|
protectedinherited |
Definition at line 89 of file Consumer.cc.
References fhicl::ParameterSet::get_if_present().
Referenced by art::EDProducer::doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().
|
inlineinherited |
Definition at line 41 of file EventObserverBase.h.
References art::EventObserverBase::process_name_.
Referenced by art::FileDumperOutput::printPrincipal(), and art::RootOutput::RootOutput().
|
inlineinherited |
Definition at line 33 of file EventObserverBase.h.
|
inlineinherited |
Definition at line 56 of file EventObserverBase.h.
References art::EventObserverBase::selector_config_id_.
Referenced by art::RootOutputFile::writeOne().
|
protectedinherited |
Definition at line 125 of file Consumer.cc.
Referenced by art::EDProducer::doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().
|
protectedinherited |
Definition at line 101 of file Consumer.cc.
References art::errors::ProductRegistrationFailure.
|
inlineinherited |
Definition at line 46 of file EventObserverBase.h.
References art::EventObserverBase::wantAllEvents_.
Referenced by art::EDAnalyzer::doEvent(), art::OutputModule::doEvent(), art::OutputModule::doWriteEvent(), art::RootOutput::RootOutput(), and art::OutputWorker::wantAllEvents().
|
inlineinherited |
Definition at line 51 of file EventObserverBase.h.
References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().
Referenced by art::EDAnalyzer::doEvent(), art::OutputModule::doEvent(), and art::OutputModule::doWriteEvent().
|
inlineinherited |
Definition at line 109 of file EDAnalyzer.h.
References art::EDAnalyzer::currentContext().
|
private |
For dE/dx work: the value of dx.
Definition at line 307 of file AnalysisExample_module.cc.
Referenced by analyze().
|
private |
The name of the producer that created clusters.
Definition at line 305 of file AnalysisExample_module.cc.
Referenced by AnalysisExample(), and analyze().
|
private |
conversion factor
Definition at line 362 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 337 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 335 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
number of the event being processed
Definition at line 321 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
pointer to Geometry provider
Definition at line 360 of file AnalysisExample_module.cc.
Referenced by AnalysisExample(), analyze(), and beginJob().
|
private |
The name of the producer that created hits.
Definition at line 304 of file AnalysisExample_module.cc.
Referenced by AnalysisExample(), and analyze().
|
private |
momentum [GeV] of all selected particles
Definition at line 311 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
PDG code of all particles.
Definition at line 310 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 355 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
Number of dE/dx bins in a given track.
Definition at line 352 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
tuple with reconstructed data
Definition at line 316 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
PDG ID of the particle being processed.
Definition at line 348 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
GEANT ID of the particle being processed.
Definition at line 349 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
number of the run being processed
Definition at line 322 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
PDG code of particle we'll focus on.
Definition at line 306 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 343 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
Number of dE/dx bins in a given track.
Definition at line 340 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
PDG ID of the particle being processed.
Definition at line 328 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
GEANT ID of the particle being processed.
Definition at line 329 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
tuple with simulated data
Definition at line 315 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 303 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 336 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 334 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
number of the sub-run being processed
Definition at line 323 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
pointer to detector clock time service provider
Definition at line 361 of file AnalysisExample_module.cc.
Referenced by AnalysisExample(), and analyze().
|
private |
true length [cm] of all selected particles
Definition at line 312 of file AnalysisExample_module.cc.
Referenced by analyze(), and beginJob().
|
private |
(units of ticks) time of expected neutrino event
Definition at line 363 of file AnalysisExample_module.cc.
Referenced by AnalysisExample().