LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
art::EDProducer Class Referenceabstract

#include "EDProducer.h"

Inheritance diagram for art::EDProducer:
art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper apa::APAHitFinder art::RandomNumberSaver art::TriggerResultInserter bogoblip::BlipMaker butcher::EventButcher caldata::CalWire caldata::CalWireT962 calo::BezierCalorimetry calo::Calorimetry calo::GeneralCalorimetry calo::TrackCalorimetry cheat::BackTrackerLoader cheat::PhotonBackTrackerLoader cluster::BlurredClustering cluster::ClusterCheater cluster::ClusterCrawler cluster::DBcluster cluster::DBCluster3D cluster::EndPointModule cluster::fuzzyCluster cluster::FuzzyClusterMerger cluster::HoughLineFinder cluster::LineCluster cluster::LineMerger cluster::SimpleClusterMerger cluster::SimpleLineCluster cluster::SmallClusterFinder cluster::TrajCluster cosmic::BeamFlashTrackMatchTagger cosmic::CosmicClusterTagger cosmic::CosmicPCAxisTagger cosmic::CosmicPFParticleTagger cosmic::CosmicTrackTagger cosmic::TrackPFParticleMatch CRHitRemoval CRHitRemovalByPCA detsim::SimDriftElectrons detsim::SimWire ems::EMShower3D ems::MergeEMShower3D evd::GraphCluster event::AggregateEvent event::EventCheater event::EventMaker evgen::CORSIKAGen evgen::CosmicsGen evgen::FileMuons evgen::GaisserParam evgen::GENIEGen evgen::LightSource evgen::MarleyGen evgen::MarleyTimeGen evgen::MUSUN evgen::NDKGen evgen::NeutronOsc evgen::NUANCEGen evgen::NucleonDecay evgen::RadioGen evgen::SingleGen evgen::SNNueAr40CCGen evgen::TextFileGen evwgh::EventWeight hit::DisambigCheater hit::DPRawHitFinder hit::FFTHitFinder hit::GausHitFinder hit::HitCheater hit::HitFinder hit::MCHitFinder hit::RawHitFinder hit::RFFHitFinder hit::TTHitFinder lar::example::Disturbance lar::example::RemoveIsolatedSpacePoints lar::example::TotallyCheatTracker lar_cluster3d::Cluster3D lar_pandora::CollectionMerging lar_pandora::CollectionSplitting lar_pandora::ILArPandora lar_pandora::LArPandoraExternalEventBuilding lar_pandora::LArPandoraShowerCreation lar_pandora::LArPandoraTrackCreation larg4::LArG4 lbne::PhotonCounterT0Matching MCReco mvapid::MVAPID noisefilteralg::WireCellNoiseFilter opdet::BeamFlashCompatabilityCheck opdet::BoDataFrameInput opdet::FlashClusterMatch opdet::OpFlashFinder opdet::OpHitFinder opdet::OpMCDigi opdet::OptDetDigitizer opdet::OpticalRawDigitReformatter opdet::TrackTimeAssoc phot::PhotonLibraryPropagation pid::Chi2ParticleID raw::RecompressRawDigits reco3d::SpacePointSolver shower::EMShower shower::TCShower ShowerReco3D shwf::ShowerCheater shwf::ShowerFinder shwf::ShowerReco sim::MergeSimSources spacecharge::ShiftEdepSCE sppt::TTSpacePointFinder t0::MCParticleHitMatching t0::MCParticleShowerMatching t0::MCParticleTrackMatching t0::MCTruthT0Matching ToyOneShowerGen TrackProducerFromPFParticle TrackProducerFromTrack TrackProducerFromTrackTrajectory trk::TrackContainmentTagger trkf::BezierTrackerModule trkf::CCTrackMaker trkf::CosmicTracker trkf::FeatureTracker trkf::KalmanFilterFinalTrackFitter trkf::KalmanFilterTrajectoryFitter trkf::MCSFitProducer trkf::PMAlgTrackMaker trkf::PMAlgTrajFitter trkf::SeedFinderModule trkf::SpacePointCheater trkf::SpacePointFinder trkf::SpacePts trkf::TCTrack trkf::Track3DKalman trkf::Track3DKalmanHit trkf::Track3DKalmanSPS trkf::Track3Dreco trkf::TrackCheater trkf::TrackKalmanCheater trkf::TrackStitcher trkf::VertexFitter tss::TrackShowerHits vertex::AggregateVertex vertex::CornerFinder vertex::FeatureVertexFinder vertex::HarrisVertexFinder vertex::PrimaryVertexFinder vertex::VertexCheater vertex::VertexFinder2D vertex::VertexMatch wc::MergeWireCell wcls::WireCellToolkit

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

virtual ~EDProducer ()=default
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
bool modifiesEvent () const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) 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_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (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< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Types

using CPC_exempt_ptr = cet::exempt_ptr< CurrentProcessingContext const >
 

Private Member Functions

bool doEvent (EventPrincipal &ep, CPC_exempt_ptr cpcp, CountingStatistics &)
 
void doBeginJob ()
 
void doEndJob ()
 
bool doBeginRun (RunPrincipal &rp, CPC_exempt_ptr cpc)
 
bool doEndRun (RunPrincipal &rp, CPC_exempt_ptr cpc)
 
bool doBeginSubRun (SubRunPrincipal &srp, CPC_exempt_ptr cpc)
 
bool doEndSubRun (SubRunPrincipal &srp, CPC_exempt_ptr cpc)
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
std::string workerType () const
 
virtual void produce (Event &)=0
 
virtual void beginJob ()
 
virtual void endJob ()
 
virtual void beginRun (Run &)
 
virtual void beginSubRun (SubRun &)
 
virtual void endRun (Run &)
 
virtual void endSubRun (SubRun &)
 
virtual void respondToOpenInputFile (FileBlock const &)
 
virtual void respondToCloseInputFile (FileBlock const &)
 
virtual void respondToOpenOutputFiles (FileBlock const &)
 
virtual void respondToCloseOutputFiles (FileBlock const &)
 
void setModuleDescription (ModuleDescription const &md)
 

Private Attributes

ModuleDescription moduleDescription_ {}
 
CPC_exempt_ptr current_context_ {nullptr}
 
bool checkPutProducts_ {true}
 
std::set< TypeLabelmissingConsumes_ {}
 

Friends

template<typename T >
class WorkerT
 

Detailed Description

Definition at line 28 of file EDProducer.h.

Member Typedef Documentation

using art::EDProducer::CPC_exempt_ptr = cet::exempt_ptr<CurrentProcessingContext const>
private

Definition at line 51 of file EDProducer.h.

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>

Definition at line 43 of file EDProducer.h.

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

virtual art::EDProducer::~EDProducer ( )
virtualdefault

Member Function Documentation

virtual void art::EDProducer::beginJob ( )
inlineprivatevirtual

Reimplemented in ems::MergeEMShower3D, larg4::LArG4, evgen::MUSUN, trkf::CosmicTracker, lar_cluster3d::Cluster3D, vertex::FeatureVertexFinder, t0::MCTruthT0Matching, detsim::SimDriftElectrons, trkf::Track3DKalmanSPS, lbne::PhotonCounterT0Matching, evgen::GENIEGen, trkf::Track3DKalman, evgen::NeutronOsc, hit::DPRawHitFinder, shwf::ShowerReco, detsim::SimWire, evgen::TextFileGen, calo::Calorimetry, vertex::VertexFinder2D, evgen::GaisserParam, CRHitRemovalByPCA, trkf::Track3DKalmanHit, trkf::TrackStitcher, hit::GausHitFinder, ems::EMShower3D, reco3d::SpacePointSolver, trkf::CCTrackMaker, t0::MCParticleShowerMatching, t0::MCParticleTrackMatching, vertex::HarrisVertexFinder, evgen::NDKGen, cosmic::CosmicClusterTagger, cluster::SmallClusterFinder, hit::RawHitFinder, cosmic::CosmicPCAxisTagger, shower::TCShower, evgen::NucleonDecay, cosmic::CosmicTrackTagger, vertex::PrimaryVertexFinder, trkf::Track3Dreco, trkf::TrackKalmanCheater, cosmic::CosmicPFParticleTagger, event::AggregateEvent, evgen::NUANCEGen, opdet::OpHitFinder, trkf::SpacePts, cluster::ClusterCrawler, cluster::fuzzyCluster, evgen::FileMuons, opdet::TrackTimeAssoc, cluster::LineMerger, t0::MCParticleHitMatching, cosmic::TrackPFParticleMatch, caldata::CalWireT962, cluster::DBcluster, wc::MergeWireCell, CRHitRemoval, cluster::TrajCluster, caldata::CalWire, vertex::AggregateVertex, evgen::CORSIKAGen, opdet::BeamFlashCompatabilityCheck, opdet::OptDetDigitizer, hit::FFTHitFinder, trkf::FeatureTracker, evgen::CosmicsGen, noisefilteralg::WireCellNoiseFilter, hit::HitCheater, spacecharge::ShiftEdepSCE, opdet::OpFlashFinder, sppt::TTSpacePointFinder, apa::APAHitFinder, hit::RFFHitFinder, trkf::BezierTrackerModule, trkf::SpacePointCheater, trkf::SpacePointFinder, opdet::OpMCDigi, opdet::OpticalRawDigitReformatter, hit::TTHitFinder, trkf::SeedFinderModule, opdet::FlashClusterMatch, hit::DisambigCheater, mvapid::MVAPID, lar_pandora::LArPandora, and opdet::BoDataFrameInput.

Definition at line 73 of file EDProducer.h.

Referenced by doBeginJob().

74  {}
virtual void art::EDProducer::beginSubRun ( SubRun )
inlineprivatevirtual

Reimplemented in evgen::GENIEGen.

Definition at line 83 of file EDProducer.h.

Referenced by doBeginSubRun().

84  {}
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 147 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

148 {
149  if (!moduleContext_)
150  return ProductToken<T>::invalid();
151 
152  consumables_[BT].emplace_back(ConsumableType::Product,
153  TypeID{typeid(T)},
154  it.label(),
155  it.instance(),
156  it.process());
157  return ProductToken<T>{it};
158 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 162 of file Consumer.h.

163 {
164  if (!moduleContext_)
165  return;
166 
167  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
168 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 172 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

173 {
174  if (!moduleContext_)
175  return ViewToken<T>::invalid();
176 
177  consumables_[BT].emplace_back(ConsumableType::ViewElement,
178  TypeID{typeid(T)},
179  it.label(),
180  it.instance(),
181  it.process());
182  return ViewToken<T>{it};
183 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

34 {
35  return rng()->createEngine(
36  placeholder_schedule_id(), seed, kind_of_engine_to_make);
37 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

43 {
44  return rng()->createEngine(
45  placeholder_schedule_id(), seed, kind_of_engine_to_make, engine_label);
46 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
CurrentProcessingContext const * art::EDProducer::currentContext ( ) const
protected

Definition at line 120 of file EDProducer.cc.

References current_context_.

121  {
122  return current_context_.get();
123  }
CPC_exempt_ptr current_context_
Definition: EDProducer.h:116
void art::EDProducer::doBeginJob ( )
private

Definition at line 32 of file EDProducer.cc.

References beginJob(), checkPutProducts_, fhicl::ParameterSetRegistry::get(), art::detail::get_failureToPut_flag(), art::ModuleDescription::mainParameterSetID(), moduleDescription_, art::ModuleDescription::parameterSetID(), and art::Consumer::prepareForJob().

33  {
34  // 'checkPutProducts_' cannot be set during the c'tor
35  // initialization list since 'moduleDescription_' is empty there.
36  auto const& mainID = moduleDescription_.mainParameterSetID();
37  auto const& scheduler_pset =
39  "services.scheduler");
40  auto const& module_pset =
43  detail::get_failureToPut_flag(scheduler_pset, module_pset);
44  prepareForJob(scheduler_pset);
45  beginJob();
46  }
fhicl::ParameterSetID const & mainParameterSetID() const
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
virtual void beginJob()
Definition: EDProducer.h:73
static collection_type const & get() noexcept
bool checkPutProducts_
Definition: EDProducer.h:117
fhicl::ParameterSetID const & parameterSetID() const
void prepareForJob(fhicl::ParameterSet const &pset)
Definition: Consumer.cc:89
bool get_failureToPut_flag(fhicl::ParameterSet const &scheduler_pset, fhicl::ParameterSet const &module_pset)
bool art::EDProducer::doBeginRun ( RunPrincipal rp,
CPC_exempt_ptr  cpc 
)
private

Definition at line 56 of file EDProducer.cc.

References beginRun(), current_context_, art::RangeSet::forRun(), art::RunPrincipal::id(), and moduleDescription_.

57  {
58  detail::CPCSentry sentry{current_context_, cpc};
59  Run r{rp, moduleDescription_, this, RangeSet::forRun(rp.id())};
60  beginRun(r);
61  r.commit(rp);
62  return true;
63  }
CPC_exempt_ptr current_context_
Definition: EDProducer.h:116
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
virtual void beginRun(Run &)
Definition: EDProducer.h:80
static RangeSet forRun(RunID)
Definition: RangeSet.cc:52
bool art::EDProducer::doBeginSubRun ( SubRunPrincipal srp,
CPC_exempt_ptr  cpc 
)
private

Definition at line 76 of file EDProducer.cc.

References beginSubRun(), current_context_, art::RangeSet::forSubRun(), art::SubRunPrincipal::id(), and moduleDescription_.

77  {
78  detail::CPCSentry sentry{current_context_, cpc};
79  SubRun sr{srp, moduleDescription_, this, RangeSet::forSubRun(srp.id())};
80  beginSubRun(sr);
81  sr.commit(srp);
82  return true;
83  }
CPC_exempt_ptr current_context_
Definition: EDProducer.h:116
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
virtual void beginSubRun(SubRun &)
Definition: EDProducer.h:83
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:58
void art::EDProducer::doEndJob ( )
private

Definition at line 49 of file EDProducer.cc.

References endJob(), and art::Consumer::showMissingConsumes().

50  {
51  endJob();
53  }
virtual void endJob()
Definition: EDProducer.h:76
void showMissingConsumes() const
Definition: Consumer.cc:125
bool art::EDProducer::doEndRun ( RunPrincipal rp,
CPC_exempt_ptr  cpc 
)
private

Definition at line 66 of file EDProducer.cc.

References current_context_, endRun(), moduleDescription_, and art::RunPrincipal::seenRanges().

67  {
68  detail::CPCSentry sentry{current_context_, cpc};
69  Run r{rp, moduleDescription_, this, rp.seenRanges()};
70  endRun(r);
71  r.commit(rp);
72  return true;
73  }
CPC_exempt_ptr current_context_
Definition: EDProducer.h:116
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
virtual void endRun(Run &)
Definition: EDProducer.h:86
bool art::EDProducer::doEndSubRun ( SubRunPrincipal srp,
CPC_exempt_ptr  cpc 
)
private

Definition at line 86 of file EDProducer.cc.

References current_context_, endSubRun(), moduleDescription_, and art::SubRunPrincipal::seenRanges().

87  {
88  detail::CPCSentry sentry{current_context_, cpc};
89  SubRun sr{srp, moduleDescription_, this, srp.seenRanges()};
90  endSubRun(sr);
91  sr.commit(srp);
92  return true;
93  }
CPC_exempt_ptr current_context_
Definition: EDProducer.h:116
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
virtual void endSubRun(SubRun &)
Definition: EDProducer.h:89
bool art::EDProducer::doEvent ( EventPrincipal ep,
CPC_exempt_ptr  cpcp,
CountingStatistics counts 
)
private

Definition at line 18 of file EDProducer.cc.

References checkPutProducts_, current_context_, e, art::ExecutionCounts< ARGS >::increment(), moduleDescription_, and produce().

21  {
22  detail::CPCSentry sentry{current_context_, cpc};
23  Event e{ep, moduleDescription_, this};
24  counts.increment<stats::Run>();
25  produce(e);
26  e.commit(ep, checkPutProducts_, expectedProducts<InEvent>());
27  counts.increment<stats::Passed>();
28  return true;
29  }
CPC_exempt_ptr current_context_
Definition: EDProducer.h:116
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
bool checkPutProducts_
Definition: EDProducer.h:117
Float_t e
Definition: plot.C:34
virtual void produce(Event &)=0
void art::EDProducer::doRespondToCloseInputFile ( FileBlock const &  fb)
private

Definition at line 102 of file EDProducer.cc.

References respondToCloseInputFile().

103  {
105  }
virtual void respondToCloseInputFile(FileBlock const &)
Definition: EDProducer.h:96
TFile fb("Li6.root")
void art::EDProducer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
private

Definition at line 114 of file EDProducer.cc.

References respondToCloseOutputFiles().

115  {
117  }
virtual void respondToCloseOutputFiles(FileBlock const &)
Definition: EDProducer.h:102
TFile fb("Li6.root")
void art::EDProducer::doRespondToOpenInputFile ( FileBlock const &  fb)
private

Definition at line 96 of file EDProducer.cc.

References respondToOpenInputFile().

97  {
99  }
TFile fb("Li6.root")
virtual void respondToOpenInputFile(FileBlock const &)
Definition: EDProducer.h:93
void art::EDProducer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
private

Definition at line 108 of file EDProducer.cc.

References respondToOpenOutputFiles().

109  {
111  }
TFile fb("Li6.root")
virtual void respondToOpenOutputFiles(FileBlock const &)
Definition: EDProducer.h:99
virtual void art::EDProducer::endRun ( Run )
inlineprivatevirtual

Reimplemented in evgen::MUSUN.

Definition at line 86 of file EDProducer.h.

Referenced by doEndRun().

87  {}
virtual void art::EDProducer::endSubRun ( SubRun )
inlineprivatevirtual

Reimplemented in evgen::GENIEGen.

Definition at line 89 of file EDProducer.h.

Referenced by doEndSubRun().

90  {}
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

Referenced by art::MixFilter< T >::initEngine_().

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inline

Definition at line 123 of file EDProducer.h.

References moduleDescription_.

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References B, and art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
Int_t B
Definition: plot.C:25
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 190 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

191 {
192  if (!moduleContext_)
193  return ProductToken<T>::invalid();
194 
195  consumables_[BT].emplace_back(ConsumableType::Product,
196  TypeID{typeid(T)},
197  it.label(),
198  it.instance(),
199  it.process());
200  return ProductToken<T>{it};
201 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 205 of file Consumer.h.

206 {
207  if (!moduleContext_)
208  return;
209 
210  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
211 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 215 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

216 {
217  if (!moduleContext_)
218  return ViewToken<T>::invalid();
219 
220  consumables_[BT].emplace_back(ConsumableType::ViewElement,
221  TypeID{typeid(T)},
222  it.label(),
223  it.instance(),
224  it.process());
225  return ViewToken<T>{it};
226 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID().

41  {
42  return true;
43  }
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

Referenced by doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
virtual void art::EDProducer::produce ( Event )
privatepure virtual

Implemented in ems::MergeEMShower3D, larg4::LArG4, evgen::SingleGen, evgen::MarleyTimeGen, evgen::MUSUN, trkf::CosmicTracker, trkf::KalmanFilterFinalTrackFitter, phot::PhotonLibraryPropagation, trkf::PMAlgTrackMaker, trkf::KalmanFilterTrajectoryFitter, lar_cluster3d::Cluster3D, evd::GraphCluster, lar::example::TotallyCheatTracker, vertex::FeatureVertexFinder, evgen::LightSource, raw::RecompressRawDigits, t0::MCTruthT0Matching, detsim::SimDriftElectrons, trkf::Track3DKalmanSPS, evgen::RadioGen, trkf::PMAlgTrajFitter, lar::example::RemoveIsolatedSpacePoints, lbne::PhotonCounterT0Matching, evgen::GENIEGen, trkf::Track3DKalman, shwf::ShowerReco, vertex::VertexFinder2D, evgen::NeutronOsc, calo::Calorimetry, hit::DPRawHitFinder, detsim::SimWire, trkf::VertexFitter, evgen::TextFileGen, cluster::HoughLineFinder, evgen::MarleyGen, evgen::GaisserParam, CRHitRemovalByPCA, ems::EMShower3D, trkf::Track3DKalmanHit, trkf::TrackStitcher, hit::GausHitFinder, cluster::EndPointModule, cluster::SmallClusterFinder, vertex::HarrisVertexFinder, trkf::MCSFitProducer, vertex::PrimaryVertexFinder, reco3d::SpacePointSolver, trkf::CCTrackMaker, evgen::NDKGen, opdet::OpHitFinder, hit::RawHitFinder, cosmic::CosmicClusterTagger, t0::MCParticleShowerMatching, t0::MCParticleTrackMatching, cosmic::CosmicPCAxisTagger, shwf::ShowerFinder, cosmic::CosmicTrackTagger, shower::TCShower, trkf::Track3Dreco, trkf::TrackKalmanCheater, vertex::VertexMatch, evgen::NucleonDecay, event::AggregateEvent, shower::EMShower, TrackProducerFromPFParticle, cosmic::CosmicPFParticleTagger, evgen::NUANCEGen, trkf::SpacePts, cluster::ClusterCrawler, cluster::fuzzyCluster, evgen::FileMuons, cluster::BlurredClustering, cluster::LineMerger, butcher::EventButcher, cosmic::TrackPFParticleMatch, t0::MCParticleHitMatching, caldata::CalWireT962, cluster::DBcluster, cluster::FuzzyClusterMerger, ShowerReco3D, CRHitRemoval, cluster::TrajCluster, opdet::OpFlashFinder, caldata::CalWire, calo::GeneralCalorimetry, cluster::DBCluster3D, trkf::FeatureTracker, TrackProducerFromTrackTrajectory, vertex::AggregateVertex, wc::MergeWireCell, evgen::CORSIKAGen, cosmic::BeamFlashTrackMatchTagger, calo::TrackCalorimetry, hit::FFTHitFinder, TrackProducerFromTrack, evwgh::EventWeight, opdet::OptDetDigitizer, pid::Chi2ParticleID, lar::example::Disturbance, calo::BezierCalorimetry, cluster::ClusterCheater, evgen::CosmicsGen, opdet::OpticalRawDigitReformatter, trkf::TrackCheater, evgen::SNNueAr40CCGen, hit::HitCheater, noisefilteralg::WireCellNoiseFilter, cluster::SimpleLineCluster, trkf::BezierTrackerModule, spacecharge::ShiftEdepSCE, opdet::BeamFlashCompatabilityCheck, cluster::LineCluster, tss::TrackShowerHits, sppt::TTSpacePointFinder, trkf::SpacePointCheater, trkf::SpacePointFinder, sim::MergeSimSources, opdet::TrackTimeAssoc, apa::APAHitFinder, event::EventCheater, shwf::ShowerCheater, hit::RFFHitFinder, vertex::CornerFinder, opdet::OpMCDigi, cluster::SimpleClusterMerger, trkf::TCTrack, ToyOneShowerGen, art::RandomNumberSaver, trk::TrackContainmentTagger, vertex::VertexCheater, hit::TTHitFinder, trkf::SeedFinderModule, mvapid::MVAPID, lar_pandora::LArPandoraExternalEventBuilding, lar_pandora::LArPandoraShowerCreation, hit::DisambigCheater, hit::HitFinder, hit::MCHitFinder, lar_pandora::LArPandora, art::TriggerResultInserter, opdet::FlashClusterMatch, lar_pandora::LArPandoraTrackCreation, MCReco, opdet::BoDataFrameInput, lar_pandora::CollectionSplitting, lar_pandora::CollectionMerging, cheat::BackTrackerLoader, cheat::PhotonBackTrackerLoader, event::EventMaker, wcls::WireCellToolkit, and bogoblip::BlipMaker.

Referenced by doEvent(), and workerType().

virtual void art::EDProducer::respondToCloseInputFile ( FileBlock const &  )
inlineprivatevirtual

Definition at line 96 of file EDProducer.h.

Referenced by doRespondToCloseInputFile().

97  {}
virtual void art::EDProducer::respondToCloseOutputFiles ( FileBlock const &  )
inlineprivatevirtual

Definition at line 102 of file EDProducer.h.

Referenced by doRespondToCloseOutputFiles().

103  {}
virtual void art::EDProducer::respondToOpenInputFile ( FileBlock const &  )
inlineprivatevirtual

Definition at line 93 of file EDProducer.h.

Referenced by doRespondToOpenInputFile().

94  {}
virtual void art::EDProducer::respondToOpenOutputFiles ( FileBlock const &  )
inlineprivatevirtual

Definition at line 99 of file EDProducer.h.

Referenced by doRespondToOpenOutputFiles().

100  {}
void art::EDProducer::setModuleDescription ( ModuleDescription const &  md)
inlineprivate

Definition at line 106 of file EDProducer.h.

References moduleDescription_, and art::Consumer::setModuleDescription().

107  {
108  moduleDescription_ = md;
109  // Since the module description in the Consumer base class is
110  // owned by pointer, we must give it the owned object of this
111  // class--i.e. moduleDescription_, not md.
113  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
void setModuleDescription(ModuleDescription const &md)
Definition: Consumer.cc:83
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Definition at line 125 of file Consumer.cc.

Referenced by doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().

126 {
127  if (!moduleContext_)
128  return;
129 
130  // If none of the branches have missing consumes statements, exit early.
131  if (std::all_of(cbegin(missingConsumes_),
132  cend(missingConsumes_),
133  [](auto const& perBranch) { return perBranch.empty(); }))
134  return;
135 
136  constexpr cet::HorizontalRule rule{60};
137  mf::LogPrint log{"MTdiagnostics"};
138  log << '\n'
139  << rule('=') << '\n'
140  << "The following consumes (or mayConsume) statements are missing from\n"
141  << module_context(moduleDescription_) << '\n'
142  << rule('-') << '\n';
143 
144  cet::for_all_with_index(
145  missingConsumes_, [&log](std::size_t const i, auto const& perBranch) {
146  for (auto const& pi : perBranch) {
147  log << " "
148  << assemble_consumes_statement(static_cast<BranchType>(i), pi)
149  << '\n';
150  }
151  });
152  log << rule('=');
153 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

103 {
104  // Early exits if consumes tracking has been disabled or if the
105  // consumed product is an allowed consumable.
106  if (!moduleContext_)
107  return;
108 
109  if (cet::binary_search_all(consumables_[bt], pi))
110  return;
111 
112  if (requireConsumes_) {
114  "Consumer: an error occurred during validation of a "
115  "retrieved product\n\n")
116  << "The following consumes (or mayConsume) statement is missing from\n"
117  << module_context(moduleDescription_) << ":\n\n"
118  << " " << assemble_consumes_statement(bt, pi) << "\n\n";
119  }
120 
121  missingConsumes_[bt].insert(pi);
122 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
bool requireConsumes_
Definition: Consumer.h:137
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
std::string art::EDProducer::workerType ( ) const
inlineprivate

Definition at line 66 of file EDProducer.h.

References produce().

67  {
68  return "WorkerT<EDProducer>";
69  }

Friends And Related Function Documentation

template<typename T >
friend class WorkerT
friend

Definition at line 33 of file EDProducer.h.

Member Data Documentation

bool art::EDProducer::checkPutProducts_ {true}
private

Definition at line 117 of file EDProducer.h.

Referenced by doBeginJob(), and doEvent().

CPC_exempt_ptr art::EDProducer::current_context_ {nullptr}
private

Definition at line 116 of file EDProducer.h.

Referenced by currentContext(), doBeginRun(), doBeginSubRun(), doEndRun(), doEndSubRun(), and doEvent().

std::set<TypeLabel> art::EDProducer::missingConsumes_ {}
private

Definition at line 118 of file EDProducer.h.

ModuleDescription art::EDProducer::moduleDescription_ {}
private

The documentation for this class was generated from the following files: