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

#include "ProductRegistryHelper.h"

Inheritance diagram for art::ProductRegistryHelper:
art::Modifier art::ProducingService art::ResultsProducer art::detail::Filter art::detail::Producer geo::GeometryConfigurationWriter 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 Member Functions

 ProductRegistryHelper (product_creation_mode)
 
 ~ProductRegistryHelper ()
 
 ProductRegistryHelper (ProductRegistryHelper const &)=delete
 
 ProductRegistryHelper (ProductRegistryHelper &&)=delete
 
ProductRegistryHelperoperator= (ProductRegistryHelper const &)=delete
 
ProductRegistryHelperoperator= (ProductRegistryHelper &&)=delete
 
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
 

Private Attributes

std::unique_ptr< ProductList const > productList_ {nullptr}
 
product_creation_mode mode_
 
ProducesCollector collector_
 

Detailed Description

Definition at line 39 of file ProductRegistryHelper.h.

Constructor & Destructor Documentation

art::ProductRegistryHelper::ProductRegistryHelper ( product_creation_mode  mode)
explicit

Definition at line 19 of file ProductRegistryHelper.cc.

20  : mode_{mode}
21  {}
art::ProductRegistryHelper::~ProductRegistryHelper ( )
default
art::ProductRegistryHelper::ProductRegistryHelper ( ProductRegistryHelper const &  )
delete
art::ProductRegistryHelper::ProductRegistryHelper ( ProductRegistryHelper &&  )
delete

Member Function Documentation

template<BranchType B>
TypeLabelLookup_t const & art::ProductRegistryHelper::expectedProducts ( ) const
inline

Definition at line 93 of file ProductRegistryHelper.h.

Referenced by registerProducts().

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

Definition at line 48 of file ProductRegistryHelper.cc.

References collector_, and art::ProducesCollector::fillDescriptions().

Referenced by art::Modifier::fillProductDescriptions(), and registerProducts().

49  {
51  }
void fillDescriptions(ModuleDescription const &md)
ProductRegistryHelper& art::ProductRegistryHelper::operator= ( ProductRegistryHelper const &  )
delete
ProductRegistryHelper& art::ProductRegistryHelper::operator= ( ProductRegistryHelper &&  )
delete
template<typename P , art::BranchType B>
void art::ProductRegistryHelper::produces ( std::string const &  instanceName = {},
Persistable const  persistable = Persistable::Yes 
)
inline

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)
inline

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 = {} 
)

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::ProductRegistryHelper::registerProducts ( ProductDescriptions productsToRegister,
ModuleDescription const &  md 
)

Definition at line 24 of file ProductRegistryHelper.cc.

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

Referenced by art::Source< T >::finishProductRegistration_(), and art::Modifier::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

Member Data Documentation

ProducesCollector art::ProductRegistryHelper::collector_
private

Definition at line 88 of file ProductRegistryHelper.h.

Referenced by fillDescriptions(), and registerProducts().

product_creation_mode art::ProductRegistryHelper::mode_
private

Definition at line 87 of file ProductRegistryHelper.h.

std::unique_ptr<ProductList const> art::ProductRegistryHelper::productList_ {nullptr}
private

Definition at line 86 of file ProductRegistryHelper.h.

Referenced by registerProducts().


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