CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ShallowEventDataProducer Class Reference

#include <ShallowEventDataProducer.h>

Inheritance diagram for ShallowEventDataProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ShallowEventDataProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=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::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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)
 

Private Member Functions

void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

edm::EDPutTokenT< unsigned int > bxPut_
 
edm::EDPutTokenT< unsigned int > eventPut_
 
edm::EDPutTokenT< float > instLumiPut_
 
edm::EDPutTokenT< unsigned int > lumiPut_
 
edm::EDGetTokenT< OnlineLuminosityRecordmetaDataToken_
 
edm::EDPutTokenT< float > puPut_
 
edm::EDPutTokenT< unsigned int > runPut_
 
edm::EDGetTokenT< LumiScalersCollectionscalerToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- 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 12 of file ShallowEventDataProducer.h.

Constructor & Destructor Documentation

◆ ShallowEventDataProducer()

ShallowEventDataProducer::ShallowEventDataProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 9 of file ShallowEventDataProducer.cc.

References bxPut_, eventPut_, edm::ParameterSet::getParameter(), instLumiPut_, lumiPut_, metaDataToken_, puPut_, runPut_, and scalerToken_.

9  {
10  runPut_ = produces<unsigned int>("run");
11  eventPut_ = produces<unsigned int>("event");
12  bxPut_ = produces<unsigned int>("bx");
13  lumiPut_ = produces<unsigned int>("lumi");
14  instLumiPut_ = produces<float>("instLumi");
15  puPut_ = produces<float>("PU");
16 #ifdef ExtendedCALIBTree
17  trigTechPut_ = produces<std::vector<bool>>("TrigTech");
18  trigPhPut_ = produces<std::vector<bool>>("TrigPh");
19  trig_token_ = consumes<L1GlobalTriggerReadoutRecord>(iConfig.getParameter<edm::InputTag>("trigRecord"));
20 #endif
21 
22  scalerToken_ = consumes<LumiScalersCollection>(iConfig.getParameter<edm::InputTag>("lumiScalers"));
23  metaDataToken_ = consumes<OnlineLuminosityRecord>(iConfig.getParameter<edm::InputTag>("metadata"));
24 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDPutTokenT< unsigned int > eventPut_
edm::EDGetTokenT< OnlineLuminosityRecord > metaDataToken_
edm::EDPutTokenT< float > instLumiPut_
edm::EDPutTokenT< unsigned int > runPut_
edm::EDPutTokenT< unsigned int > bxPut_
edm::EDGetTokenT< LumiScalersCollection > scalerToken_
edm::EDPutTokenT< float > puPut_
edm::EDPutTokenT< unsigned int > lumiPut_

Member Function Documentation

◆ produce()

void ShallowEventDataProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 26 of file ShallowEventDataProducer.cc.

References OnlineLuminosityRecord::avgPileUp(), bxPut_, L1GlobalTriggerReadoutRecord::decisionWord(), eventPut_, mps_fire::i, iEvent, OnlineLuminosityRecord::instLumi(), instLumiPut_, edm::HandleBase::isValid(), lumiPut_, V0Monitor_cfi::lumiScalers, metaDataToken_, eostools::move(), puPut_, runPut_, scalerToken_, and L1GlobalTriggerReadoutRecord::technicalTriggerWord().

26  {
27  iEvent.emplace(runPut_, iEvent.id().run());
28  iEvent.emplace(eventPut_, iEvent.id().event());
29  iEvent.emplace(bxPut_, iEvent.bunchCrossing());
30  iEvent.emplace(lumiPut_, iEvent.luminosityBlock());
31 
32 #ifdef ExtendedCALIBTree
34  iEvent.getByToken(trig_token_, gtRecord);
35 
36  std::vector<bool> TrigTech_(64, false);
37  std::vector<bool> TrigPh_(128, false);
38 
39  // Get dWord after masking disabled bits
40  DecisionWord dWord = gtRecord->decisionWord();
41  if (!dWord.empty()) { // if board not there this is zero
42  // loop over dec. bit to get total rate (no overlap)
43  for (int i = 0; i < 64; ++i) {
44  TrigPh_[i] = dWord[i];
45  }
46  }
47 
49  if (!tw.empty()) {
50  // loop over dec. bit to get total rate (no overlap)
51  for (int i = 0; i < 64; ++i) {
52  TrigTech_[i] = tw[i];
53  }
54  }
55 
56  iEvent.emplace(trigTechPut_, std::move(TrigTech_));
57  iEvent.emplace(trigPhPut_, std::move(TrigPh_));
58 #endif
59 
60  // Luminosity informations
63 
64  float instLumi_ = 0;
65  float PU_ = 0;
66 
67  if (lumiScalers.isValid() && !lumiScalers->empty()) {
68  if (lumiScalers->begin() != lumiScalers->end()) {
69  instLumi_ = lumiScalers->begin()->instantLumi();
70  PU_ = lumiScalers->begin()->pileup();
71  }
72  } else if (metaData.isValid()) {
73  instLumi_ = metaData->instLumi();
74  PU_ = metaData->avgPileUp();
75  } else {
76  edm::LogInfo("ShallowEventDataProducer")
77  << "LumiScalers collection not found in the event; will write dummy values";
78  }
79 
80  iEvent.emplace(instLumiPut_, instLumi_);
81  iEvent.emplace(puPut_, PU_);
82 }
edm::EDPutTokenT< unsigned int > eventPut_
edm::EDGetTokenT< OnlineLuminosityRecord > metaDataToken_
edm::EDPutTokenT< float > instLumiPut_
const DecisionWord & decisionWord(int bxInEventValue) const
float instLumi() const
Return the luminosity for the current nibble.
edm::EDPutTokenT< unsigned int > runPut_
int iEvent
Definition: GenABIO.cc:224
std::vector< bool > DecisionWord
typedefs
edm::EDPutTokenT< unsigned int > bxPut_
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
Log< level::Info, false > LogInfo
edm::EDGetTokenT< LumiScalersCollection > scalerToken_
bool isValid() const
Definition: HandleBase.h:70
edm::EDPutTokenT< float > puPut_
edm::EDPutTokenT< unsigned int > lumiPut_
float avgPileUp() const
Return the average pileup for th current nibble.
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ bxPut_

edm::EDPutTokenT<unsigned int> ShallowEventDataProducer::bxPut_
private

Definition at line 24 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ eventPut_

edm::EDPutTokenT<unsigned int> ShallowEventDataProducer::eventPut_
private

Definition at line 22 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ instLumiPut_

edm::EDPutTokenT<float> ShallowEventDataProducer::instLumiPut_
private

Definition at line 25 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ lumiPut_

edm::EDPutTokenT<unsigned int> ShallowEventDataProducer::lumiPut_
private

Definition at line 23 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ metaDataToken_

edm::EDGetTokenT<OnlineLuminosityRecord> ShallowEventDataProducer::metaDataToken_
private

Definition at line 19 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ puPut_

edm::EDPutTokenT<float> ShallowEventDataProducer::puPut_
private

Definition at line 26 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ runPut_

edm::EDPutTokenT<unsigned int> ShallowEventDataProducer::runPut_
private

Definition at line 21 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ scalerToken_

edm::EDGetTokenT<LumiScalersCollection> ShallowEventDataProducer::scalerToken_
private

Definition at line 18 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().