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 &&)=default
 
ProducesCollectoroperator= (ProducesCollector const &)
 
template<class ProductType >
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<class ProductType >
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
 ProducesCollector ()=delete
 
 ProducesCollector (ProducesCollector &&)=default
 
 ProducesCollector (ProducesCollector const &)
 

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 43 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_)) {}

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

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Definition at line 7 of file ProducesCollector.cc.

7  {
8  helper_ = get_underlying(other.helper_);
9  return *this;
10  }

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

◆ produces() [1/6]

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

Definition at line 52 of file ProducesCollector.h.

52  {
53  return helper_->produces<ProductType>();
54  }

References helper_.

Referenced by CaloTruthAccumulator::CaloTruthAccumulator(), CastorDigiProducer::CastorDigiProducer(), EcalDigiProducer::EcalDigiProducer(), EcalDigiProducer_Ph2::EcalDigiProducer_Ph2(), EcalTBDigiProducer::EcalTBDigiProducer(), 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().

◆ produces() [2/6]

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

Definition at line 62 of file ProducesCollector.h.

62  {
63  return helper_->produces<ProductType, B>();
64  }

References TtFullHadDaughter::B, and helper_.

◆ produces() [3/6]

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

Definition at line 12 of file ProducesCollector.cc.

14  {
15  return helper_->produces(id, std::move(instanceName), recordProvenance);
16  }

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

◆ produces() [4/6]

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

Definition at line 76 of file ProducesCollector.h.

78  {
79  return helper_->produces<B>(id, std::move(instanceName), recordProvenance);
80  }

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

◆ produces() [5/6]

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

Definition at line 57 of file ProducesCollector.h.

57  {
58  return helper_->produces<ProductType>(std::move(instanceName));
59  }

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

◆ produces() [6/6]

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

Definition at line 67 of file ProducesCollector.h.

67  {
68  return helper_->produces<ProductType, B>(std::move(instanceName));
69  }

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

Friends And Related Function Documentation

◆ ProducerBase

friend class ProducerBase
friend

Definition at line 83 of file ProducesCollector.h.

Member Data Documentation

◆ helper_

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

Definition at line 86 of file ProducesCollector.h.

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

edm::ProducesCollector::helper_
propagate_const< ProductRegistryHelper * > helper_
Definition: ProducesCollector.h:86
trackingPlots.other
other
Definition: trackingPlots.py:1467
helper
Definition: helper.py:1
edm::get_underlying
constexpr T & get_underlying(propagate_const< T > &)
Definition: propagate_const.h:103
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
eostools.move
def move(src, dest)
Definition: eostools.py:511
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
MuonErrorMatrixAdjuster_cfi.instanceName
instanceName
Definition: MuonErrorMatrixAdjuster_cfi.py:16