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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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 > processLabels_
 
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 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 38 of file GenericConsumer.cc.

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

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

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

92  {
93  descriptions.setComment(
94  "This plugin depends on all the event, lumi and run products "
95  "produced by the modules listed in its configuration.");
96 
98  desc.addUntracked<std::vector<std::string>>("eventProducts", {})
99  ->setComment(
100  "List of modules whose event products this module will depend on. "
101  "Use \"*\" to depend on all event products.");
102  desc.addUntracked<std::vector<std::string>>("lumiProducts", {})
103  ->setComment(
104  "List of modules whose lumi products this module will depend on. "
105  "Use \"*\" to depend on all lumi products.");
106  desc.addUntracked<std::vector<std::string>>("runProducts", {})
107  ->setComment(
108  "List of modules whose run products this module will depend on. "
109  "Use \"*\" to depend on all run products.");
110  desc.addUntracked<std::vector<std::string>>("processProducts", {})
111  ->setComment(
112  "List of modules whose process products this module will depend on. "
113  "Use \"*\" to depend on all process products.");
114  descriptions.addWithDefaultLabel(desc);
115  }

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

◆ processLabels_

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

Definition at line 35 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().