CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
edm::ProducesCollector Class Reference

#include <ProducesCollector.h>

Public Member Functions

ProducesCollectoroperator= (ProducesCollector const &)
 
ProducesCollectoroperator= (ProducesCollector &&)=default
 
template<class ProductType >
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProductRegistryHelper::BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
ProductRegistryHelper::BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
 ProducesCollector ()=delete
 
 ProducesCollector (ProducesCollector const &)
 
 ProducesCollector (ProducesCollector &&)=default
 

Private Member Functions

 ProducesCollector (ProductRegistryHelper *helper)
 

Private Attributes

propagate_const< ProductRegistryHelper * > helper_
 

Friends

class ProducerBase
 

Detailed Description

Description: Helper class to gather produces information for the ProducerBase class.

Usage: The constructor of a module can get an instance of edm::ProducesCollector by calling its producesCollector() method. This instance can then be passed to helper classes in order to register the data the helper will put into the Event, LuminosityBlock or Run.

Note this only supports use of the Transition enum. The produce template functions using

the BranchType enum are not supported by this class. We still support the BranchType enum in ProducerBase for backward compatibility reasons, but even there they are deprecated and we are trying to migrate client code to use the template functions using the Transition enum.

 WARNING: The ProducesCollector should be used during the time that modules are being

constructed. It should not be saved and used later. It will not work if it is used to call the produces function during beginJob, beginRun, beginLuminosity block, event processing or at any later time. It can be used while the module constructor is running or be contained in a functor passed to the Framework with a call to callWhenNewProductsRegistered.

Definition at line 45 of file ProducesCollector.h.

Constructor & Destructor Documentation

◆ ProducesCollector() [1/4]

edm::ProducesCollector::ProducesCollector ( )
delete

◆ ProducesCollector() [2/4]

edm::ProducesCollector::ProducesCollector ( ProducesCollector const &  other)

Definition at line 5 of file ProducesCollector.cc.

5 : helper_(get_underlying(other.helper_)) {}
propagate_const< ProductRegistryHelper * > helper_
constexpr T & get_underlying(propagate_const< T > &)

◆ ProducesCollector() [3/4]

edm::ProducesCollector::ProducesCollector ( ProducesCollector &&  )
default

◆ ProducesCollector() [4/4]

edm::ProducesCollector::ProducesCollector ( ProductRegistryHelper helper)
private

Definition at line 18 of file ProducesCollector.cc.

18 : helper_(helper) {}
Definition: helper.py:1
propagate_const< ProductRegistryHelper * > helper_

Member Function Documentation

◆ operator=() [1/2]

ProducesCollector & edm::ProducesCollector::operator= ( ProducesCollector const &  other)

Definition at line 7 of file ProducesCollector.cc.

References edm::get_underlying(), helper_, and trackingPlots::other.

7  {
8  helper_ = get_underlying(other.helper_);
9  return *this;
10  }
propagate_const< ProductRegistryHelper * > helper_
constexpr T & get_underlying(propagate_const< T > &)

◆ operator=() [2/2]

ProducesCollector& edm::ProducesCollector::operator= ( ProducesCollector &&  )
default

◆ produces() [1/8]

template<class ProductType >
ProductRegistryHelper::BranchAliasSetterT<ProductType> edm::ProducesCollector::produces ( )
inline

Definition at line 54 of file ProducesCollector.h.

References helper_.

Referenced by CaloTruthAccumulator::CaloTruthAccumulator(), CastorDigiProducer::CastorDigiProducer(), EcalDigiProducer::EcalDigiProducer(), EcalDigiProducer_Ph2::EcalDigiProducer_Ph2(), EcalTimeDigiProducer::EcalTimeDigiProducer(), HcalDigiProducer::HcalDigiProducer(), HcalTBDigiProducer::HcalTBDigiProducer(), HGCDigiProducer::HGCDigiProducer(), MTDDigitizerBase::MTDDigitizerBase(), cms::Phase2TrackerDigitizer::Phase2TrackerDigitizer(), cms::PileupVertexAccumulator::PileupVertexAccumulator(), PreMixingCaloParticleWorker::PreMixingCaloParticleWorker(), edm::PreMixingCrossingFrameWorker< T >::PreMixingCrossingFrameWorker(), PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::PreMixingDigiSimLinkWorker(), PreMixingEcalWorker::PreMixingEcalWorker(), PreMixingHcalWorker::PreMixingHcalWorker(), PreMixingHGCalWorker::PreMixingHGCalWorker(), PreMixingMuonWorker< CSCWireDigiCollection >::PreMixingMuonWorker(), edm::PreMixingPileupCopy::PreMixingPileupCopy(), PreMixingSiPixelWorker::PreMixingSiPixelWorker(), PreMixingSiStripWorker::PreMixingSiStripWorker(), PreMixingTrackingParticleWorker::PreMixingTrackingParticleWorker(), hitTripletEDProducerT::ImplSeedingHitSets::produces(), hitTripletEDProducerT::ImplIntermediateHitTriplets::produces(), RecoTrackAccumulator::RecoTrackAccumulator(), VariableNTupler::registerleaves(), StringBasedNTupler::registerleaves(), simproducer::ProductInfo< T >::registerProduct(), fastsim::TrackerSimHitProducer::registerProducts(), RPCCPPFUnpacker::RPCCPPFUnpacker(), cms::SiPixelDigitizer::SiPixelDigitizer(), SiStripDigitizer::SiStripDigitizer(), TrackCollectionCloner::TrackCollectionCloner(), and TrackingTruthAccumulator::TrackingTruthAccumulator().

54  {
55  return helper_->produces<ProductType>();
56  }
propagate_const< ProductRegistryHelper * > helper_

◆ produces() [2/8]

template<class ProductType >
ProductRegistryHelper::BranchAliasSetterT<ProductType> edm::ProducesCollector::produces ( std::string  instanceName)
inline

Definition at line 59 of file ProducesCollector.h.

References helper_, MuonErrorMatrixAdjuster_cfi::instanceName, and eostools::move().

59  {
60  return helper_->produces<ProductType>(std::move(instanceName));
61  }
propagate_const< ProductRegistryHelper * > helper_
def move(src, dest)
Definition: eostools.py:511

◆ produces() [3/8]

template<typename ProductType , Transition B>
ProductRegistryHelper::BranchAliasSetterT<ProductType> edm::ProducesCollector::produces ( )
inline

Definition at line 64 of file ProducesCollector.h.

References B, and helper_.

64  {
65  return helper_->produces<ProductType, B>();
66  }
Definition: APVGainStruct.h:7
propagate_const< ProductRegistryHelper * > helper_

◆ produces() [4/8]

template<typename ProductType , Transition B>
ProductRegistryHelper::BranchAliasSetterT<ProductType> edm::ProducesCollector::produces ( std::string  instanceName)
inline

Definition at line 69 of file ProducesCollector.h.

References B, helper_, MuonErrorMatrixAdjuster_cfi::instanceName, and eostools::move().

69  {
70  return helper_->produces<ProductType, B>(std::move(instanceName));
71  }
Definition: APVGainStruct.h:7
propagate_const< ProductRegistryHelper * > helper_
def move(src, dest)
Definition: eostools.py:511

◆ produces() [5/8]

template<Transition Tr = Transition::Event>
auto edm::ProducesCollector::produces ( std::string  instanceName)
inlinenoexcept

Definition at line 74 of file ProducesCollector.h.

References MuonErrorMatrixAdjuster_cfi::instanceName, and eostools::move().

74  {
75  return ProducesCollectorAdaptor<Tr>(*this, std::move(instanceName));
76  }
def move(src, dest)
Definition: eostools.py:511

◆ produces() [6/8]

template<Transition Tr = Transition::Event>
auto edm::ProducesCollector::produces ( )
inlinenoexcept

Definition at line 78 of file ProducesCollector.h.

78  {
79  return ProducesCollectorAdaptor<Tr>(*this);
80  }

◆ produces() [7/8]

ProductRegistryHelper::BranchAliasSetter edm::ProducesCollector::produces ( const TypeID id,
std::string  instanceName = std::string(),
bool  recordProvenance = true 
)

Definition at line 12 of file ProducesCollector.cc.

References helper_, MuonErrorMatrixAdjuster_cfi::instanceName, and eostools::move().

14  {
15  return helper_->produces(id, std::move(instanceName), recordProvenance);
16  }
propagate_const< ProductRegistryHelper * > helper_
def move(src, dest)
Definition: eostools.py:511

◆ produces() [8/8]

template<Transition B>
ProductRegistryHelper::BranchAliasSetter edm::ProducesCollector::produces ( const TypeID id,
std::string  instanceName = std::string(),
bool  recordProvenance = true 
)
inline

Definition at line 87 of file ProducesCollector.h.

References B, helper_, l1ctLayer2EG_cff::id, MuonErrorMatrixAdjuster_cfi::instanceName, and eostools::move().

89  {
90  return helper_->produces<B>(id, std::move(instanceName), recordProvenance);
91  }
Definition: APVGainStruct.h:7
propagate_const< ProductRegistryHelper * > helper_
def move(src, dest)
Definition: eostools.py:511

Friends And Related Function Documentation

◆ ProducerBase

friend class ProducerBase
friend

Definition at line 94 of file ProducesCollector.h.

Member Data Documentation

◆ helper_

propagate_const<ProductRegistryHelper*> edm::ProducesCollector::helper_
private

Definition at line 97 of file ProducesCollector.h.

Referenced by operator=(), and produces().