CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
edm::GenericConsumer Class Reference
Inheritance diagram for edm::GenericConsumer:
edm::global::EDAnalyzer<> edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (StreamID, Event const &, EventSetup const &) const override
 
 GenericConsumer (ParameterSet const &)
 
 ~GenericConsumer () override=default
 
- Public Member Functions inherited from edm::global::EDAnalyzer<>
 EDAnalyzer ()=default
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

std::vector< std::string > eventLabels_
 
std::vector< std::string > lumiLabels_
 
std::vector< std::string > runLabels_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 22 of file GenericConsumer.cc.

Constructor & Destructor Documentation

◆ GenericConsumer()

edm::GenericConsumer::GenericConsumer ( ParameterSet const &  config)
explicit

Definition at line 37 of file GenericConsumer.cc.

38  : eventLabels_(config.getUntrackedParameter<std::vector<std::string>>("eventProducts")),
39  lumiLabels_(config.getUntrackedParameter<std::vector<std::string>>("lumiProducts")),
40  runLabels_(config.getUntrackedParameter<std::vector<std::string>>("runProducts")) {
41  std::sort(eventLabels_.begin(), eventLabels_.end());
42  std::sort(lumiLabels_.begin(), lumiLabels_.end());
43  std::sort(runLabels_.begin(), runLabels_.end());
44 
46  static const std::string kWildcard("*");
47  static const std::string kPathStatus("edm::PathStatus");
48  static const std::string kEndPathStatus("edm::EndPathStatus");
49 
50  switch (branch.branchType()) {
51  case InEvent:
52  if (std::binary_search(eventLabels_.begin(), eventLabels_.end(), branch.moduleLabel()) or
53  (std::binary_search(eventLabels_.begin(), eventLabels_.end(), kWildcard) and
54  branch.className() != kPathStatus and branch.className() != kEndPathStatus))
55  this->consumes(edm::TypeToGet{branch.unwrappedTypeID(), PRODUCT_TYPE},
56  edm::InputTag{branch.moduleLabel(), branch.productInstanceName(), branch.processName()});
57  break;
58 
59  case InLumi:
60  if (std::binary_search(lumiLabels_.begin(), lumiLabels_.end(), branch.moduleLabel()) or
61  std::binary_search(lumiLabels_.begin(), lumiLabels_.end(), kWildcard))
62  this->consumes<edm::InLumi>(
63  edm::TypeToGet{branch.unwrappedTypeID(), PRODUCT_TYPE},
64  edm::InputTag{branch.moduleLabel(), branch.productInstanceName(), branch.processName()});
65  break;
66 
67  case InRun:
68  if (std::binary_search(runLabels_.begin(), runLabels_.end(), branch.moduleLabel()) or
69  std::binary_search(runLabels_.begin(), runLabels_.end(), kWildcard))
70  this->consumes<edm::InRun>(
71  edm::TypeToGet{branch.unwrappedTypeID(), PRODUCT_TYPE},
72  edm::InputTag{branch.moduleLabel(), branch.productInstanceName(), branch.processName()});
73  break;
74 
75  default:
77  << "Unexpected branch type " << branch.branchType() << "\nPlease contact a Framework developer\n";
78  }
79  });
80  }

References MicroEventContent_cff::branch, edm::global::EDAnalyzerBase::callWhenNewProductsRegistered(), edm::EDConsumerBase::consumes(), eventLabels_, Exception, edm::InEvent, edm::InLumi, edm::InRun, edm::errors::LogicError, lumiLabels_, or, edm::PRODUCT_TYPE, runLabels_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~GenericConsumer()

edm::GenericConsumer::~GenericConsumer ( )
overridedefault

Member Function Documentation

◆ analyze()

void edm::GenericConsumer::analyze ( StreamID  ,
Event const &  ,
EventSetup const &   
) const
inlineoverridevirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 27 of file GenericConsumer.cc.

27 {}

◆ fillDescriptions()

void edm::GenericConsumer::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 82 of file GenericConsumer.cc.

82  {
83  descriptions.setComment(
84  "This plugin depends on all the event, lumi and run products "
85  "produced by the modules listed in its configuration.");
86 
88  desc.addUntracked<std::vector<std::string>>("eventProducts", {})
89  ->setComment(
90  "List of modules whose event products this module will depend on. "
91  "Use \"*\" to depend on all event products.");
92  desc.addUntracked<std::vector<std::string>>("lumiProducts", {})
93  ->setComment(
94  "List of modules whose lumi products this module will depend on. "
95  "Use \"*\" to depend on all event products.");
96  desc.addUntracked<std::vector<std::string>>("runProducts", {})
97  ->setComment(
98  "List of modules whose run products this module will depend on. "
99  "Use \"*\" to depend on all event products.");
100  descriptions.addWithDefaultLabel(desc);
101  }

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and edm::ConfigurationDescriptions::setComment().

Member Data Documentation

◆ eventLabels_

std::vector<std::string> edm::GenericConsumer::eventLabels_
private

Definition at line 32 of file GenericConsumer.cc.

Referenced by GenericConsumer().

◆ lumiLabels_

std::vector<std::string> edm::GenericConsumer::lumiLabels_
private

Definition at line 33 of file GenericConsumer.cc.

Referenced by GenericConsumer().

◆ runLabels_

std::vector<std::string> edm::GenericConsumer::runLabels_
private

Definition at line 34 of file GenericConsumer.cc.

Referenced by GenericConsumer().

edm::PRODUCT_TYPE
Definition: ProductKindOfType.h:5
edm::errors::LogicError
Definition: EDMException.h:37
MicroEventContent_cff.branch
branch
Definition: MicroEventContent_cff.py:178
edm::global::EDAnalyzerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzerBase.h:71
edm::InRun
Definition: BranchType.h:11
config
Definition: config.py:1
edm::InEvent
Definition: BranchType.h:11
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::InLumi
Definition: BranchType.h:11
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::GenericConsumer::eventLabels_
std::vector< std::string > eventLabels_
Definition: GenericConsumer.cc:32
edm::GenericConsumer::runLabels_
std::vector< std::string > runLabels_
Definition: GenericConsumer.cc:34
Exception
Definition: hltDiff.cc:246
ParameterSetDescription
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::BranchDescription
Definition: BranchDescription.h:32
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:153
edm::TypeToGet
Definition: TypeToGet.h:32
edm::InputTag
Definition: InputTag.h:15
edm::GenericConsumer::lumiLabels_
std::vector< std::string > lumiLabels_
Definition: GenericConsumer.cc:33