CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
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)
 
 ~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::EDPutTokenT< float > puPut_
 
edm::EDPutTokenT< unsigned int > runPut_
 
edm::EDGetTokenT
< LumiScalersCollection
scalerToken_
 

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
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< B > consumes (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 () noexcept
 
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...
 
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 11 of file ShallowEventDataProducer.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file ShallowEventDataProducer.cc.

References bxPut_, eventPut_, edm::ParameterSet::getParameter(), instLumiPut_, lumiPut_, 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 }
edm::EDPutTokenT< unsigned int > eventPut_
edm::EDPutTokenT< float > instLumiPut_
edm::EDPutTokenT< unsigned int > runPut_
edm::EDPutTokenT< unsigned int > bxPut_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< LumiScalersCollection > scalerToken_
edm::EDPutTokenT< float > puPut_
edm::EDPutTokenT< unsigned int > lumiPut_

Member Function Documentation

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.

References edm::EventBase::bunchCrossing(), bxPut_, edm::Event::emplace(), edm::EventID::event(), eventPut_, edm::Event::getByToken(), mps_fire::i, edm::EventBase::id(), instLumiPut_, edm::HandleBase::isValid(), edm::EventBase::luminosityBlock(), lumiPut_, eostools::move(), puPut_, edm::EventID::run(), runPut_, and scalerToken_.

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 
47  TechnicalTriggerWord tw = gtRecord->technicalTriggerWord();
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 }
RunNumber_t run() const
Definition: EventID.h:38
EventNumber_t event() const
Definition: EventID.h:40
edm::EDPutTokenT< unsigned int > eventPut_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDPutTokenT< float > instLumiPut_
int bunchCrossing() const
Definition: EventBase.h:64
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
edm::EDPutTokenT< unsigned int > runPut_
std::vector< bool > DecisionWord
typedefs
def move
Definition: eostools.py:511
edm::EDPutTokenT< unsigned int > bxPut_
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
bool isValid() const
Definition: HandleBase.h:70
Log< level::Info, false > LogInfo
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:433
edm::EDGetTokenT< LumiScalersCollection > scalerToken_
edm::EDPutTokenT< float > puPut_
edm::EventID id() const
Definition: EventBase.h:59
edm::EDPutTokenT< unsigned int > lumiPut_

Member Data Documentation

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

Definition at line 22 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

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

Definition at line 20 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

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

Definition at line 23 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

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

Definition at line 21 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

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

Definition at line 24 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

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

Definition at line 19 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().

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

Definition at line 17 of file ShallowEventDataProducer.h.

Referenced by produce(), and ShallowEventDataProducer().