Public Member Functions | Private Attributes | List of all members
art::ProductRegistryHelper Class Reference

#include <ProductRegistryHelper.h>

Inheritance diagram for art::ProductRegistryHelper:
art::Modifier art::ProducingService art::ResultsProducer art::detail::Filter art::detail::Producer gar::geo::GeometryGArConfigurationWriter geo::GeometryConfigurationWriter art::test::DummyResultsProducer art::EDFilter art::ReplicatedFilter art::SharedFilter art::EDProducer art::ReplicatedProducer art::SharedProducer art::MixFilter< T, IOPolicy > art::test::DummyFilter arttest::PMTestFilter cluster::SmallClusterFilter CosmicFilter dune::CounterFilter DuneEventFilter filt::FinalStateParticleFilter filt::GenFilter filt::LArG4ExtCounterFilter filt::LArG4ParticleFilter filt::NucleonDecayFilter filt::ProtoDUNEFembFilter filt::ProtoDUNETriggerFilter filter::ADCFilter filter::EventFilter filter::EventTimeFilter filter::MuonFilter filter::ProtoDUNEUnstableHVFilter gar::filt::FSPEventFilter hit::NumberOfHitsFilter mpf::MissingProductFilter PionAbsCexSelection PrimaryPionSelection protoana::ProtoDUNEBeamlineFilter protoana::ProtoDUNETruthBeamFilter simfilter::FilterCryostatNus simfilter::FilterGenInTime simfilter::FilterNoDirtNeutrinos simfilter::FilterPrimaryPDG art::BlockingPrescaler art::EventIDFilter art::Prescaler simfilter::FilterNoMCParticles simfilter::FilterSimPhotonLiteTime simfilter::FilterSimPhotonTime apa::APAHitFinder art::test::CollidingDummyProducer art::test::DummyProducer arttest::IntVectorProducer arttest::PMTestProducer bogoblip::BlipMaker butcher::EventButcher caldata::CalWire caldata::CalWireDUNE10kt caldata::CalWireDUNE35t caldata::CalWireDUNEDPhase caldata::CalWireT962 calgaushf::CalGausHFDUNE10kt calgaushf::CalGausHFDUNE35t 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 cnn::RegCNNEvaluator cnn::RegCNNMapper cnn::RegCNNPyTorch cosmic::BeamFlashTrackMatchTagger cosmic::CosmicClusterTagger cosmic::CosmicPCAxisTagger cosmic::CosmicPFParticleTagger cosmic::CosmicTrackTagger cosmic::TrackPFParticleMatch CRHitRemoval CRHitRemovalByPCA CRT::CRTRawDecoder CRT::CRTSim CRT::CRTSimRefac CRT::SingleCRTMatchingProducer CRT::TwoCRTMatchingProducer ctp::CTPEvaluator cvn::CVNEvaluator cvn::CVNMapper cvn::CVNMapperProtoDUNE cvn::CVNMapperSim cvn::CVNMapperWire cvn::CVNSparseMapper cvn::CVNSparseMapper3D cvn::GCNGraphMaker cvn::GCNGraphMaker2D cvn::GCNGraphMakerProtoDUNE cvn::GCNHitGraphMaker DataPrepByApaModule DataPrepModule deconvgaushf::DeconvGausHFDUNE10kt deconvgaushf::DeconvGausHFDUNE35t detsim::DriftElectronstoPlane detsim::SimDriftElectrons detsim::SimWire detsim::SimWireDUNE10kt detsim::SimWireDUNE35t dune::CalibrationdEdXPDSP dune::DisambigFromSpacePoints dune::EmLikeHits dune::EnergyReco dune::FelixRawDecoder dune::HitFinder35t dune::HitFinderProtoDUNESP dune::HitRepeater dune::RceRawDecoder dune::SSPRawDecoder dune::T0Counter dune::TimingRawDecoder dune::VDColdboxPDSDecoder dunefd::IniSegReco dunefd::ShSeg dunemva::MVASelect ems::EMShower3D evd::GraphCluster event::EventCheater EventGen::ImportSingle311Event evgen::CORSIKAGen evgen::CosmicsGen evgen::CRTGen evgen::FileMuons evgen::GaisserParam evgen::GENIEGen evgen::LightSource evgen::MarleyGen evgen::MarleyTimeGen evgen::MUSUN evgen::NDKGen evgen::NeutronOsc evgen::NucleonDecay evgen::NuEScatterGen evgen::NuEScatterGen evgen::NuWroGen evgen::ProtoDUNEBeam evgen::ProtoDUNETriggeredBeam evgen::RadioGen evgen::SingleGen evgen::SNNueAr40CCGen evgen::TextFileGen evgendp::CORSIKAGendp evgendp::DataGen311 evgendp::Gen311 evgendp::NEUTImport evwgh::EventWeight gar::evgen::CosmicsGen gar::evgen::GENIEGen gar::evgen::RadioGen gar::evgen::SingleGen gar::evgen::TextFileGen gar::gar_pandora::PandoraInterface gar::garg4::GArG4 gar::rec::CaloClusterCheater gar::rec::CaloClustering gar::rec::CaloStripSplitter gar::rec::CompressedHitFinder gar::rec::dayoneconverter gar::rec::dayonetrackfit gar::rec::dayonetrackfit gar::rec::EventInit gar::rec::SiPMHitFinder gar::rec::tpccathodestitch gar::rec::TPCECALAssociation gar::rec::TPCHitCluster gar::rec::tpcpatrec2 gar::rec::tpcpatrec2 gar::rec::tpcpatreccheat gar::rec::tpctrackfit2 gar::rec::tpcvechitfinder2 gar::rec::tracker1 gar::rec::veefinder1 gar::rec::vertexfinder1 gar::rosim::IonizationReadout gar::rosim::SiPMReadout geo::LegacyGeometryInfoWriter hit::DisambigCheater hit::DPRawHitFinder hit::FFTHitFinder hit::HitCheater hit::HitFinder hit::MCHitFinder hit::RawHitFinder hit::RFFHitFinder hit::TTHitFinder HitHandScan IcebergFELIXBufferDecoderMarch2021 IcebergTPCRawDecoder Infill::InfillChannels lar::example::Disturbance lar::example::RemoveIsolatedSpacePoints lar::example::tests::ParticleMaker lar::example::tests::SpacePointMaker lar::example::TotallyCheatTracker lar::test::AssnsChainClusterMaker lar::test::AssnsChainHitMaker lar::test::AssnsChainPFParticleMaker lar::test::AssnsChainShowerMaker lar::test::ChargedSpacePointProxyInputMaker lar::test::TrackProxyHitMaker lar::test::TrackProxyTrackMaker lar_cluster3d::Cluster3D lar_pandora::CollectionSplitting lar_pandora::ILArPandora lar_pandora::LArPandoraExternalEventBuilding lar_pandora::LArPandoraShowerCreation lar_pandora::LArPandoraTrackCreation larg4::IonAndScint larg4::LArG4 larg4::larg4Main lartest::AssnProducer1 lartest::AssnProducer2 lartest::PtrMakerProducer lbne::PhotonCounterT0Matching MCReco mvapid::MVAPID nnet::EmTrackClusterId nnet::EmTrackClusterId2out nnet::EmTrackClusterId2outTl nnet::EmTrackClusterId3outTl nnet::EmTrackMichelId nnet::EmTrackMichelIdTl nnet::ParticleDecayId nnet::WaveformRoiFinder NoiseAdder noisefilteralg::WireCellNoiseFilter opdet::OpDetDigitizerDUNE opdet::OpDetDigitizerDUNEDP opdet::OpDetDigitizerProtoDUNE opdet::OpFlashFinder opdet::OpFlashFinderDualPhase opdet::OpHitFinder opdet::OpMCDigi opdet::OpSlicer opdet::OptDetDigitizer opdet::OpticalRawDigitReformatter opdet::PDSNoiseFilter opdet::SIPMOpSensorSim opdet::WaveformDigitizerSim pdsp::HadronHitsRemoval pdsp::ProtonHitsRemoval pdsp::TrueEdep PDSPCTBRawDecoder PDSPDataDrivenBeam PDSPTPCRawDecoder phot::PDFastSimPAR phot::PDFastSimPVS phot::PhotonLibraryPropagation phot::PhotonLibraryPropagationS2 pid::Chi2ParticleID proto::BeamEvent PtrMakerProducer2 quad::QuadVtx reco3d::SpacePointSolver reco::shower::LArPandoraModularShowerCreation recob::test::HitCollectionCreatorTest RunningSumTPFinder sce::SCECorrection shower::EMShower shower::TCShower ShowerReco3D shs::ShowerHitSeparator shwf::ShowerCheater shwf::ShowerFinder shwf::ShowerReco sim::GenericCRT sim::MergeSimSources SimWireDUNE spacecharge::ShiftEdepSCE sppt::TTSpacePointFinder t0::MCParticleHitMatching t0::MCParticleShowerMatching t0::MCParticleTrackMatching t0::MCTruthT0Matching T0RecoAnodePiercers TrackProducerFromPFParticle TrackProducerFromTrack TrackProducerFromTrackTrajectory TriggerPrimitiveFinder triggersim::ActivityTriggerProd triggersim::TemplateTriggerProd 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 unstick::UnstickADCCodes util::ConvertEdep2Art vertex::FeatureVertexFinder vertex::PrimaryVertexFinder vertex::VertexCheater vertex::VertexFinder2D VLN::VLNEnergyProducer 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 18 of file ProductRegistryHelper.cc.

19  : mode_{mode}
20  {}
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.

94  {
96  }
TypeLabelLookup_t const & expectedProducts(BranchType) const
void art::ProductRegistryHelper::fillDescriptions ( ModuleDescription const &  md)

Definition at line 47 of file ProductRegistryHelper.cc.

48  {
50  }
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.

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  }
static QCString name
Definition: declinfo.cpp:673
std::pair< float, std::string > P
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
ProducesCollector& art::ProductRegistryHelper::producesCollector ( )
inlinenoexcept

Definition at line 80 of file ProductRegistryHelper.h.

81  {
82  return collector_;
83  }
void art::ProductRegistryHelper::productList ( std::unique_ptr< ProductList p)
inline

Definition at line 52 of file ProductRegistryHelper.h.

53  {
54  productList_ = move(p);
55  }
std::unique_ptr< ProductList const > productList_
def move(depos, offset)
Definition: depos.py:107
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.

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  }
static QCString name
Definition: declinfo.cpp:673
std::pair< float, std::string > P
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 23 of file ProductRegistryHelper.cc.

26  {
27  // Possible products from input source
28  if (productList_) {
30  back_inserter(productsToRegister),
31  [](auto const& pr) { return pr.second; });
32  }
33 
34  // Now fill the descriptions for products that are to be produced.
36  auto registerProductsPerBT = [this,
37  &productsToRegister](BranchType const bt) {
39  for (auto const& pr : expectedProducts) {
40  productsToRegister.push_back(pr.second);
41  }
42  };
43  for_each_branch_type(registerProductsPerBT);
44  }
std::unique_ptr< ProductList const > productList_
bt
Definition: tracks.py:83
auto transform_all(Container &, OutputIt, UnaryOp)
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.

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.


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