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
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

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.

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_, jetUpdater_cfi::sort, and AlCaHLTBitMon_QueryRunRegistry::string.

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  }
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: config.py:1
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
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
std::vector< std::string > eventLabels_
std::vector< std::string > runLabels_
std::vector< std::string > lumiLabels_

◆ ~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.

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

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  }

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().