CMS 3D CMS Logo

ShallowEventDataProducer.cc
Go to the documentation of this file.
6 
7 // #include <bitset>
8 
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 }
24 
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 }
edm::StreamID
Definition: StreamID.h:30
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
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
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
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
edm::EventSetup
Definition: EventSetup.h:57
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
ShallowEventDataProducer::ShallowEventDataProducer
ShallowEventDataProducer(const edm::ParameterSet &)
Definition: ShallowEventDataProducer.cc:9
ShallowEventDataProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: ShallowEventDataProducer.cc:25
L1GlobalTriggerReadoutRecord::technicalTriggerWord
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:212
ParameterSet.h
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::Event
Definition: Event.h:73
ShallowEventDataProducer.h
edm::InputTag
Definition: InputTag.h:15
L1GlobalTriggerReadoutRecord.h