LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
art::ProductRegistryHelper Class Reference

#include "ProductRegistryHelper.h"

Inheritance diagram for art::ProductRegistryHelper:
art::ProducerBase art::ProducingService art::ResultsProducer art::EDFilter art::EDProducer art::BlockingPrescaler art::EventIDFilter art::MixFilter< T > art::Prescaler cluster::SmallClusterFilter filt::EmptyFilter filt::FinalStateParticleFilter filt::FinalStateSelectFilter filt::LArG4ParticleFilter filter::ADCFilter filter::EventFilter filter::EventTimeFilter filter::MuonFilter simfilter::FilterCryostatNus simfilter::FilterGenInTime simfilter::FilterNoDirtNeutrinos simfilter::FilterNoMCParticles simfilter::FilterPrimaryPDG simfilter::FilterSimPhotonTime simfilter::FilterStoppingMuon 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 Member Functions

void productList (ProductList *p)
 
void registerProducts (MasterProductRegistry &mpr, ProductDescriptions &productsToRegister, ModuleDescription const &md)
 
template<typename P , BranchType B = InEvent>
void produces (std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
 
template<typename P , BranchType B>
TypeLabel const & reconstitutes (std::string const &modLabel, std::string const &instanceName={})
 
template<BranchType B>
std::set< TypeLabel > const & expectedProducts () const
 
template<typename P , art::BranchType B>
art::TypeLabel const & reconstitutes (std::string const &emulatedModule, std::string const &instanceName)
 

Private Member Functions

TypeLabel const & insertOrThrow (BranchType const bt, TypeLabel const &tl)
 

Private Attributes

std::array< std::set< TypeLabel >, NumBranchTypestypeLabelList_
 
std::unique_ptr< ProductListproductList_
 

Detailed Description

Definition at line 81 of file ProductRegistryHelper.h.

Member Function Documentation

template<BranchType B>
std::set<TypeLabel> const& art::ProductRegistryHelper::expectedProducts ( ) const
inline

Definition at line 111 of file ProductRegistryHelper.h.

References B, and typeLabelList_.

112  {
113  return typeLabelList_[B];
114  }
Int_t B
Definition: plot.C:25
std::array< std::set< TypeLabel >, NumBranchTypes > typeLabelList_
TypeLabel const& art::ProductRegistryHelper::insertOrThrow ( BranchType const  bt,
TypeLabel const &  tl 
)
inlineprivate

Definition at line 118 of file ProductRegistryHelper.h.

References art::TypeLabel::friendlyClassName(), art::errors::LogicError, art::TypeLabel::productInstanceName(), and typeLabelList_.

Referenced by produces(), and reconstitutes().

119  {
120  auto result = typeLabelList_[bt].insert(tl);
121  if (!result.second) {
122  throw Exception(errors::LogicError, "RegistrationFailure")
123  << "The module being constructed attempted to "
124  << "register conflicting products with:\n"
125  << "friendlyClassName: " << tl.friendlyClassName()
126  << " and instanceName: " << tl.productInstanceName() << ".\n";
127  }
128  return *result.first;
129  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::array< std::set< TypeLabel >, NumBranchTypes > typeLabelList_
template<typename P , art::BranchType B>
void art::ProductRegistryHelper::produces ( std::string const &  instanceName = {},
Persistable const  persistable = Persistable::Yes 
)
inline

Definition at line 141 of file ProductRegistryHelper.h.

References B, insertOrThrow(), art::No, art::detail::verifyFriendlyClassName(), and art::detail::verifyInstanceName().

Referenced by larg4::LArG4::LArG4(), art::MixHelper::produces(), recob::ChargedSpacePointCollectionCreator::produces(), and productList().

143 {
144  verifyInstanceName(instanceName);
145  TypeID const productType{typeid(P)};
146  verifyFriendlyClassName(productType.friendlyClassName());
147  bool const isTransient = (persistable == Persistable::No);
149  B,
150  TypeLabel{productType, instanceName, SupportsView<P>::value, isTransient});
151 }
void verifyFriendlyClassName(std::string const &fcn)
Definition: verify_names.cc:16
Int_t B
Definition: plot.C:25
std::string value(boost::any const &)
TypeLabel const & insertOrThrow(BranchType const bt, TypeLabel const &tl)
void verifyInstanceName(std::string const &in)
Definition: verify_names.cc:5
void art::ProductRegistryHelper::productList ( ProductList p)
inline

Definition at line 86 of file ProductRegistryHelper.h.

References produces(), productList_, reconstitutes(), registerProducts(), and art::Yes.

87  {
88  productList_.reset(p);
89  }
std::unique_ptr< ProductList > productList_
template<typename P , BranchType B>
TypeLabel const& art::ProductRegistryHelper::reconstitutes ( std::string const &  modLabel,
std::string const &  instanceName = {} 
)
template<typename P , art::BranchType B>
art::TypeLabel const& art::ProductRegistryHelper::reconstitutes ( std::string const &  emulatedModule,
std::string const &  instanceName 
)

Definition at line 155 of file ProductRegistryHelper.h.

References B, insertOrThrow(), art::detail::verifyFriendlyClassName(), and art::detail::verifyInstanceName().

157 {
158  verifyModuleLabel(emulatedModule);
159  verifyInstanceName(instanceName);
160  TypeID const productType{typeid(P)};
161  verifyFriendlyClassName(productType.friendlyClassName());
162  return insertOrThrow(
163  B,
164  TypeLabel{
165  productType, instanceName, SupportsView<P>::value, emulatedModule});
166 }
void verifyFriendlyClassName(std::string const &fcn)
Definition: verify_names.cc:16
Int_t B
Definition: plot.C:25
std::string value(boost::any const &)
TypeLabel const & insertOrThrow(BranchType const bt, TypeLabel const &tl)
void verifyInstanceName(std::string const &in)
Definition: verify_names.cc:5
void art::ProductRegistryHelper::registerProducts ( MasterProductRegistry mpr,
ProductDescriptions productsToRegister,
ModuleDescription const &  md 
)

Definition at line 59 of file ProductRegistryHelper.cc.

References art::MasterProductRegistry::addProductsFromModule(), art::InEvent, art::NumBranchTypes, productList_, typeLabelList_, and art::MasterProductRegistry::updateFromModule().

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

63 {
64  // First update the MPR with any extant products.
65  if (productList_) {
66  cet::transform_all(*productList_,
67  back_inserter(productsToRegister),
68  [](auto const& pr) { return pr.second; });
69  mpr.updateFromModule(move(productList_));
70  }
71 
72  // Now go through products that will be produced in the current process.
73  check_for_duplicate_Assns(typeLabelList_[InEvent]);
74 
75  ProductDescriptions descriptions;
76  for (std::size_t ibt{}; ibt != NumBranchTypes; ++ibt) {
77  auto const bt = static_cast<BranchType>(ibt);
78  for (auto const& val : typeLabelList_[bt]) {
79  BranchDescription pd{bt, val, md};
80  productsToRegister.push_back(pd);
81  descriptions.push_back(std::move(pd));
82  }
83  }
84  mpr.addProductsFromModule(move(descriptions));
85 }
std::vector< BranchDescription > ProductDescriptions
std::unique_ptr< ProductList > productList_
std::array< std::set< TypeLabel >, NumBranchTypes > typeLabelList_
BranchType
Definition: BranchType.h:18

Member Data Documentation

std::unique_ptr<ProductList> art::ProductRegistryHelper::productList_
private

Definition at line 136 of file ProductRegistryHelper.h.

Referenced by productList(), and registerProducts().

std::array<std::set<TypeLabel>, NumBranchTypes> art::ProductRegistryHelper::typeLabelList_
private

Definition at line 131 of file ProductRegistryHelper.h.

Referenced by expectedProducts(), insertOrThrow(), and registerProducts().


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