LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::Modifier Class Reference

#include "Modifier.h"

Inheritance diagram for art::Modifier:
art::ModuleBase art::ProductRegistryHelper art::detail::Filter art::detail::Producer art::EDFilter art::ReplicatedFilter art::SharedFilter art::EDProducer art::ReplicatedProducer art::SharedProducer art::MixFilter< T, IOPolicy > cluster::SmallClusterFilter filt::FinalStateParticleFilter filt::LArG4ParticleFilter filter::ADCFilter filter::EventFilter filter::EventTimeFilter filter::MuonFilter simfilter::FilterCryostatNus simfilter::FilterGenInTime simfilter::FilterNoDirtNeutrinos simfilter::FilterPrimaryPDG art::BlockingPrescaler art::EventIDFilter art::Prescaler simfilter::FilterNoMCParticles simfilter::FilterSimPhotonLiteTime simfilter::FilterSimPhotonTime apa::APAHitFinder artg4tk::artg4tkMain artg4tk::EventGenerator bogoblip::BlipMaker butcher::EventButcher caldata::CalWire caldata::CalWireT962 calo::Calorimetry calo::GnocchiCalorimetry calo::ShowerCalorimetry calo::TrackCalorimetry cheat::BackTrackerLoader cheat::PhotonBackTrackerLoader cluster::BlurredClustering cluster::ClusterCheater cluster::ClusterCrawler cluster::DBcluster cluster::DBCluster3D cluster::EndPointModule cluster::HoughLineFinder cluster::LineCluster cluster::LineMerger cluster::SmallClusterFinder cluster::TrajCluster cosmic::BeamFlashTrackMatchTagger cosmic::CosmicClusterTagger cosmic::CosmicPCAxisTagger cosmic::CosmicPFParticleTagger cosmic::CosmicTrackTagger cosmic::TrackPFParticleMatch CRHitRemoval CRHitRemovalByPCA detsim::DriftElectronstoPlane detsim::SimDriftElectrons detsim::SimWire ems::EMShower3D evd::GraphCluster event::EventCheater evg::AddGenieEventsToArt evgen::BaseRadioGen evgen::CORSIKAGen evgen::CosmicsGen evgen::FileMuons evgen::GaisserParam evgen::GENIEGen evgen::larg4SingleGen evgen::LightSource evgen::MarleyGen evgen::MarleyTimeGen evgen::MUSUN evgen::NDKGen evgen::NeutronOsc evgen::NucleonDecay evgen::PhotonGen evgen::RadioGen evgen::SingleGen evgen::SNNueAr40CCGen evgen::TestGENIEHelper evgen::TextFileGen evwgh::EventWeight hit::DisambigCheater hit::DPRawHitFinder hit::FFTHitFinder hit::HitCheater hit::HitFinder hit::MCHitFinder hit::RawHitFinder hit::RFFHitFinder hit::TTHitFinder lar::example::Disturbance lar_cluster3d::Cluster3D lar_pandora::CollectionSplitting lar_pandora::ILArPandora lar_pandora::LArPandoraExternalEventBuilding lar_pandora::LArPandoraShowerCreation lar_pandora::LArPandoraTrackCreation larg4::IonAndScint larg4::LArG4 larg4::larg4Main lbne::PhotonCounterT0Matching lcvn::ICVNMapper< T, U > lcvn::LArCVNEvaluator MCReco mvapid::MVAPID nnet::EmTrackClusterId nnet::EmTrackClusterId2out nnet::EmTrackClusterId2outTl nnet::EmTrackClusterId3outTl nnet::EmTrackMichelId nnet::EmTrackMichelIdTl nnet::ParticleDecayId nnet::WaveformRoiFinder noisefilteralg::WireCellNoiseFilter NuGraphInference NuSliceHitsProducer opdet::OpFlashFinder opdet::OpHitFinder opdet::OpMCDigi opdet::OptDetDigitizer opdet::OpticalRawDigitReformatter phot::PDFastSimANN phot::PDFastSimPAR phot::PDFastSimPVS phot::PhotonLibraryPropagation pid::Chi2ParticleID quad::QuadVtx reco3d::SpacePointSolver reco::shower::LArPandoraModularShowerCreation sce::SCECorrection shower::EMShower shower::TCShower ShowerReco3D shwf::ShowerCheater shwf::ShowerFinder shwf::ShowerReco sim::GenericCRT sim::MergeSimSources sim::PhotonHitConverter spacecharge::ShiftEdepSCE sppt::TTSpacePointFinder t0::MCParticleHitMatching t0::MCParticleShowerMatching t0::MCParticleTrackMatching t0::MCTruthT0Matching TrackProducerFromPFParticle TrackProducerFromTrack TrackProducerFromTrackTrajectory trk::TrackContainmentTagger 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::FeatureVertexFinder vertex::PrimaryVertexFinder vertex::VertexCheater vertex::VertexFinder2D art::TriggerResultInserter art::RandomNumberSaver hit::GausHitFinder wcls::WireCellToolkit

Public Types

template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 

Public Member Functions

 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
void fillProductDescriptions ()
 
void registerProducts (ProductDescriptions &productsToRegister)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
std::unique_ptr< WorkermakeWorker (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

ConsumesCollectorconsumesCollector ()
 
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 Member Functions

void productList (std::unique_ptr< ProductList > p)
 
void registerProducts (ProductDescriptions &productsToRegister, ModuleDescription const &md)
 
void fillDescriptions (ModuleDescription const &md)
 
template<typename P , BranchType B>
TypeLabel const & reconstitutes (std::string const &modLabel, std::string const &instanceName={})
 
template<BranchType B>
TypeLabelLookup_t const & expectedProducts () const
 
template<typename P , BranchType B = InEvent>
void produces (std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
 
ProducesCollectorproducesCollector () noexcept
 

Detailed Description

Definition at line 16 of file Modifier.h.

Member Typedef Documentation

template<typename UserConfig , typename UserKeysToIgnore = void>
using art::Modifier::Table = ProducerTable<UserConfig, detail::ModuleConfig, UserKeysToIgnore>

Definition at line 20 of file Modifier.h.

Constructor & Destructor Documentation

art::Modifier::~Modifier ( )
defaultnoexcept
art::Modifier::Modifier ( )
art::Modifier::Modifier ( Modifier const &  )
delete
art::Modifier::Modifier ( Modifier &&  )
delete

Member Function Documentation

template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
template<BranchType B>
TypeLabelLookup_t const & art::ProductRegistryHelper::expectedProducts ( ) const
inlineinherited

Definition at line 93 of file ProductRegistryHelper.h.

Referenced by art::ProductRegistryHelper::registerProducts().

94  {
95  return collector_.expectedProducts(B);
96  }
TypeLabelLookup_t const & expectedProducts(BranchType) const
void art::ProductRegistryHelper::fillDescriptions ( ModuleDescription const &  md)
inherited
void art::Modifier::fillProductDescriptions ( )

Definition at line 10 of file Modifier.cc.

References art::ProductRegistryHelper::fillDescriptions(), and art::ModuleBase::moduleDescription().

11  {
13  }
void fillDescriptions(ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
Modifier& art::Modifier::operator= ( Modifier const &  )
delete
Modifier& art::Modifier::operator= ( Modifier &&  )
delete
template<typename P , art::BranchType B>
void art::ProductRegistryHelper::produces ( std::string const &  instanceName = {},
Persistable const  persistable = Persistable::Yes 
)
inlineinherited

Definition at line 100 of file ProductRegistryHelper.h.

References art::errors::ProductRegistrationFailure, and art::reconstitutes.

Referenced by larg4::LArG4::LArG4(), trkf::PMAlgTrackMaker::PMAlgTrackMaker(), trkf::PMAlgTrajFitter::PMAlgTrajFitter(), and trkf::Track3DKalmanHit::Track3DKalmanHit().

102  {
105  "An error occurred while registering a product.\n"}
106  << "The following product was registered with 'produces' when\n"
107  "'reconstitutes' should have been called instead.\n"
108  << " Branch type: " << B << '\n'
109  << " Class name: " << cet::demangle_symbol(typeid(P).name()) << '\n'
110  << " Instance name: '" << instanceName << "'\n";
111  }
112  collector_.produces<P, B>(instanceName, persistable);
113  }
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void art::ProductRegistryHelper::productList ( std::unique_ptr< ProductList p)
inlineinherited

Definition at line 52 of file ProductRegistryHelper.h.

References art::produces, art::reconstitutes, and art::Yes.

53  {
54  productList_ = std::move(p);
55  }
std::unique_ptr< ProductList const > productList_
template<typename P , BranchType B>
TypeLabel const & art::ProductRegistryHelper::reconstitutes ( std::string const &  modLabel,
std::string const &  instanceName = {} 
)
inherited

Definition at line 117 of file ProductRegistryHelper.h.

References art::produces, and art::errors::ProductRegistrationFailure.

Referenced by lris::LArRawInputDriver::LArRawInputDriver(), lris::LArRawInputDriverJP250L::LArRawInputDriverJP250L(), lris::LArRawInputDriverLongBo::LArRawInputDriverLongBo(), lris::LArRawInputDriverShortBo::LArRawInputDriverShortBo(), and fluxr::PPFXFluxReader::PPFXFluxReader().

119  {
122  "An error occurred while registering a product.\n"}
123  << "The following product was registered with 'reconstitutes' when\n"
124  "'produces' should have been called instead.\n"
125  << " Branch type: " << B << '\n'
126  << " Class name: " << cet::demangle_symbol(typeid(P).name()) << '\n'
127  << " Emulated module name: '" << emulatedModule << "'\n"
128  << " Instance name: '" << instanceName << "'\n";
129  }
130  return collector_.reconstitutes<P, B>(emulatedModule, instanceName);
131  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
TypeLabel const & reconstitutes(std::string const &modLabel, std::string const &instanceName={})
void art::Modifier::registerProducts ( ProductDescriptions productsToRegister)

Definition at line 16 of file Modifier.cc.

References art::ModuleBase::moduleDescription(), and art::ProductRegistryHelper::registerProducts().

17  {
18  ProductRegistryHelper::registerProducts(productsToRegister,
20  }
void registerProducts(ProductDescriptions &productsToRegister, ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
void art::ProductRegistryHelper::registerProducts ( ProductDescriptions productsToRegister,
ModuleDescription const &  md 
)
inherited

Definition at line 24 of file ProductRegistryHelper.cc.

References art::ProductRegistryHelper::collector_, art::ProductRegistryHelper::expectedProducts(), art::ProducesCollector::expectedProducts(), art::ProductRegistryHelper::fillDescriptions(), art::for_each_branch_type(), art::ProductRegistryHelper::productList_, and util::values().

Referenced by art::Source< T >::finishProductRegistration_(), and registerProducts().

27  {
28  // Possible products from input source
29  if (productList_) {
30  cet::transform_all(*productList_,
31  back_inserter(productsToRegister),
32  [](auto const& pr) { return pr.second; });
33  }
34 
35  // Now fill the descriptions for products that are to be produced.
36  fillDescriptions(md);
37  auto registerProductsPerBT = [this,
38  &productsToRegister](BranchType const bt) {
40  for (auto const& pd : expectedProducts | ::ranges::views::values) {
41  productsToRegister.push_back(pd);
42  }
43  };
44  for_each_branch_type(registerProductsPerBT);
45  }
std::unique_ptr< ProductList const > productList_
decltype(auto) values(Coll &&coll)
Range-for loop helper iterating across the values of the specified collection.
void fillDescriptions(ModuleDescription const &md)
TypeLabelLookup_t const & expectedProducts() const
BranchType
Definition: BranchType.h:20
void for_each_branch_type(F f)
Definition: BranchType.h:38
TypeLabelLookup_t const & expectedProducts(BranchType) const
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)

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