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 &&)=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)
 

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::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
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<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- 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 11 of file ShallowEventDataProducer.h.

Constructor & Destructor Documentation

◆ ShallowEventDataProducer()

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

Definition at line 9 of file ShallowEventDataProducer.cc.

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 }

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

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 25 of file ShallowEventDataProducer.cc.

25  {
26  iEvent.emplace(runPut_, iEvent.id().run());
27  iEvent.emplace(eventPut_, iEvent.id().event());
28  iEvent.emplace(bxPut_, iEvent.bunchCrossing());
29  iEvent.emplace(lumiPut_, iEvent.luminosityBlock());
30 
31 #ifdef ExtendedCALIBTree
33  iEvent.getByToken(trig_token_, gtRecord);
34 
35  std::vector<bool> TrigTech_(64, false);
36  std::vector<bool> TrigPh_(128, false);
37 
38  // Get dWord after masking disabled bits
39  DecisionWord dWord = gtRecord->decisionWord();
40  if (!dWord.empty()) { // if board not there this is zero
41  // loop over dec. bit to get total rate (no overlap)
42  for (int i = 0; i < 64; ++i) {
43  TrigPh_[i] = dWord[i];
44  }
45  }
46 
48  if (!tw.empty()) {
49  // loop over dec. bit to get total rate (no overlap)
50  for (int i = 0; i < 64; ++i) {
51  TrigTech_[i] = tw[i];
52  }
53  }
54 
55  iEvent.emplace(trigTechPut_, std::move(TrigTech_));
56  iEvent.emplace(trigPhPut_, std::move(TrigPh_));
57 #endif
58 
59  // Luminosity informations
61  float instLumi_ = 0;
62  float PU_ = 0;
63  iEvent.getByToken(scalerToken_, lumiScalers);
64  if (lumiScalers.isValid()) {
65  if (lumiScalers->begin() != lumiScalers->end()) {
66  instLumi_ = lumiScalers->begin()->instantLumi();
67  PU_ = lumiScalers->begin()->pileup();
68  }
69  } else {
70  edm::LogInfo("ShallowEventDataProducer")
71  << "LumiScalers collection not found in the event; will write dummy values";
72  }
73 
74  iEvent.emplace(instLumiPut_, instLumi_);
75  iEvent.emplace(puPut_, PU_);
76 }

References bxPut_, L1GlobalTriggerReadoutRecord::decisionWord(), eventPut_, mps_fire::i, iEvent, instLumiPut_, lumiPut_, V0Monitor_cfi::lumiScalers, eostools::move(), puPut_, runPut_, scalerToken_, and L1GlobalTriggerReadoutRecord::technicalTriggerWord().

Member Data Documentation

◆ bxPut_

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

Definition at line 22 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ eventPut_

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

Definition at line 20 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ instLumiPut_

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

Definition at line 23 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ lumiPut_

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

Definition at line 21 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ puPut_

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

Definition at line 24 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ runPut_

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

Definition at line 19 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

◆ scalerToken_

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

Definition at line 17 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

mps_fire.i
i
Definition: mps_fire.py:428
ShallowEventDataProducer::lumiPut_
edm::EDPutTokenT< unsigned int > lumiPut_
Definition: ShallowEventDataProducer.h:21
V0Monitor_cfi.lumiScalers
lumiScalers
Definition: V0Monitor_cfi.py:9
ShallowEventDataProducer::puPut_
edm::EDPutTokenT< float > puPut_
Definition: ShallowEventDataProducer.h:24
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
ShallowEventDataProducer::eventPut_
edm::EDPutTokenT< unsigned int > eventPut_
Definition: ShallowEventDataProducer.h:20
L1GlobalTriggerReadoutRecord::decisionWord
const DecisionWord & decisionWord(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:186
iEvent
int iEvent
Definition: GenABIO.cc:224
ShallowEventDataProducer::instLumiPut_
edm::EDPutTokenT< float > instLumiPut_
Definition: ShallowEventDataProducer.h:23
ShallowEventDataProducer::bxPut_
edm::EDPutTokenT< unsigned int > bxPut_
Definition: ShallowEventDataProducer.h:22
DecisionWord
std::vector< bool > DecisionWord
typedefs
Definition: L1GlobalTriggerReadoutSetupFwd.h:34
ShallowEventDataProducer::runPut_
edm::EDPutTokenT< unsigned int > runPut_
Definition: ShallowEventDataProducer.h:19
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
L1GlobalTriggerReadoutRecord::technicalTriggerWord
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:212
ShallowEventDataProducer::scalerToken_
edm::EDGetTokenT< LumiScalersCollection > scalerToken_
Definition: ShallowEventDataProducer.h:17
TechnicalTriggerWord
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
Definition: L1GlobalTriggerReadoutSetupFwd.h:41
edm::InputTag
Definition: InputTag.h:15