CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
L1GtTrigReport Class Reference

#include <L1GtTrigReport.h>

Inheritance diagram for L1GtTrigReport:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1GtTrigReport (const edm::ParameterSet &)
 constructor More...
 
virtual ~L1GtTrigReport ()
 destructor More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef std::list
< L1GtTrigReportEntry * >
::const_iterator 
CItEntry
 
typedef std::list
< L1GtTrigReportEntry * >
::iterator 
ItEntry
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 analyze each event More...
 
virtual void beginJob ()
 
virtual void endJob ()
 end of job More...
 

Private Attributes

std::list< L1GtTrigReportEntry * > m_entryList
 list of individual entries in the report for physics algorithms More...
 
std::list< L1GtTrigReportEntry * > m_entryListTechTrig
 list of individual entries in the report for technical triggers More...
 
std::vector< int > m_globalNrAccepts
 global number of events accepted by any of the L1 algorithm in any menu More...
 
std::vector< int > m_globalNrErrors
 global number of events with error (EDProduct[s] not found) More...
 
const L1GtTriggerMenum_l1GtMenu
 
unsigned long long m_l1GtMenuCacheID
 
const L1GtPrescaleFactorsm_l1GtPfAlgo
 prescale factors More...
 
unsigned long long m_l1GtPfAlgoCacheID
 
const L1GtPrescaleFactorsm_l1GtPfTech
 
unsigned long long m_l1GtPfTechCacheID
 
edm::InputTag m_l1GtRecordInputTag
 input tag for GT record (L1 GT DAQ record or L1 GT "lite" record): More...
 
const L1GtStableParametersm_l1GtStablePar
 cached stuff More...
 
unsigned long long m_l1GtStableParCacheID
 
const L1GtTriggerMaskm_l1GtTmAlgo
 trigger masks & veto masks More...
 
unsigned long long m_l1GtTmAlgoCacheID
 
const L1GtTriggerMaskm_l1GtTmTech
 
unsigned long long m_l1GtTmTechCacheID
 
const L1GtTriggerMaskm_l1GtTmVetoAlgo
 
unsigned long long m_l1GtTmVetoAlgoCacheID
 
const L1GtTriggerMaskm_l1GtTmVetoTech
 
unsigned long long m_l1GtTmVetoTechCacheID
 
unsigned int m_numberDaqPartitions
 number of DAQ partitions More...
 
unsigned int m_numberDaqPartitionsMax
 
unsigned int m_numberPhysTriggers
 number of physics triggers More...
 
unsigned int m_numberTechnicalTriggers
 number of technical triggers More...
 
unsigned int m_physicsDaqPartition
 index of physics DAQ partition More...
 
const std::vector< std::vector
< int > > * 
m_prescaleFactorsAlgoTrig
 
const std::vector< std::vector
< int > > * 
m_prescaleFactorsTechTrig
 
int m_printOutput
 print output More...
 
int m_printVerbosity
 print verbosity More...
 
int m_totalEvents
 counters More...
 
std::vector< unsigned int > m_triggerMaskAlgoTrig
 
std::vector< unsigned int > m_triggerMaskTechTrig
 
std::vector< unsigned int > m_triggerMaskVetoAlgoTrig
 
std::vector< unsigned int > m_triggerMaskVetoTechTrig
 
bool m_useL1GlobalTriggerRecord
 boolean flag to select the input record More...
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Description: L1 Trigger report.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 43 of file L1GtTrigReport.h.

Member Typedef Documentation

typedef std::list<L1GtTrigReportEntry*>::const_iterator L1GtTrigReport::CItEntry
private

Definition at line 147 of file L1GtTrigReport.h.

Definition at line 148 of file L1GtTrigReport.h.

Constructor & Destructor Documentation

L1GtTrigReport::L1GtTrigReport ( const edm::ParameterSet pSet)
explicit

constructor

input tag for GT record (L1 GT DAQ record or L1 GT "lite" record):

Definition at line 70 of file L1GtTrigReport.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogDebug, m_entryList, m_entryListTechTrig, m_l1GtMenuCacheID, m_l1GtPfAlgoCacheID, m_l1GtPfTechCacheID, m_l1GtRecordInputTag, m_l1GtStableParCacheID, m_l1GtTmAlgoCacheID, m_l1GtTmTechCacheID, m_l1GtTmVetoAlgoCacheID, m_l1GtTmVetoTechCacheID, m_numberDaqPartitions, m_numberDaqPartitionsMax, m_numberPhysTriggers, m_numberTechnicalTriggers, m_physicsDaqPartition, m_printOutput, m_printVerbosity, m_totalEvents, and m_useL1GlobalTriggerRecord.

70  {
71 
72  // boolean flag to select the input record
73  // if true, it will use L1GlobalTriggerRecord
74  m_useL1GlobalTriggerRecord = pSet.getParameter<bool>("UseL1GlobalTriggerRecord");
75 
77  m_l1GtRecordInputTag = pSet.getParameter<edm::InputTag>("L1GtRecordInputTag");
78 
79  // print verbosity
80  m_printVerbosity = pSet.getUntrackedParameter<int>("PrintVerbosity", 2);
81 
82  // print output
83  m_printOutput = pSet.getUntrackedParameter<int>("PrintOutput", 3);
84 
85  LogDebug("L1GtTrigReport") << "\n Use L1GlobalTriggerRecord: " << m_useL1GlobalTriggerRecord
86  << "\n (if false: L1GtTrigReport uses L1GlobalTriggerReadoutRecord.)"
87  << "\n Input tag for L1 GT record: " << m_l1GtRecordInputTag.label() << " \n"
88  << "\n Print verbosity level: " << m_printVerbosity << " \n"
89  << "\n Print output: " << m_printOutput << " \n" << std::endl;
90 
91  // initialize cached IDs
92 
93  //
95 
100 
101  //
102  m_l1GtPfAlgoCacheID = 0ULL;
103  m_l1GtPfTechCacheID = 0ULL;
104 
105  m_l1GtTmAlgoCacheID = 0ULL;
106  m_l1GtTmTechCacheID = 0ULL;
107 
110 
111  //
112  m_l1GtMenuCacheID = 0ULL;
113 
114  // initialize global counters
115 
116  // number of events processed
117  m_totalEvents = 0;
118 
119  //
120  m_entryList.clear();
121  m_entryListTechTrig.clear();
122 
123  // set the index of physics DAQ partition TODO input parameter?
125 
126 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::list< L1GtTrigReportEntry * > m_entryListTechTrig
list of individual entries in the report for technical triggers
unsigned int m_numberDaqPartitions
number of DAQ partitions
unsigned long long m_l1GtStableParCacheID
int m_printOutput
print output
unsigned long long m_l1GtPfTechCacheID
unsigned int m_numberDaqPartitionsMax
int m_printVerbosity
print verbosity
std::list< L1GtTrigReportEntry * > m_entryList
list of individual entries in the report for physics algorithms
bool m_useL1GlobalTriggerRecord
boolean flag to select the input record
unsigned long long m_l1GtPfAlgoCacheID
unsigned long long m_l1GtTmAlgoCacheID
unsigned int m_numberTechnicalTriggers
number of technical triggers
unsigned long long m_l1GtTmVetoTechCacheID
unsigned long long m_l1GtMenuCacheID
unsigned long long m_l1GtTmTechCacheID
int m_totalEvents
counters
unsigned int m_physicsDaqPartition
index of physics DAQ partition
edm::InputTag m_l1GtRecordInputTag
input tag for GT record (L1 GT DAQ record or L1 GT &quot;lite&quot; record):
unsigned int m_numberPhysTriggers
number of physics triggers
unsigned long long m_l1GtTmVetoAlgoCacheID
L1GtTrigReport::~L1GtTrigReport ( )
virtual

destructor

Definition at line 129 of file L1GtTrigReport.cc.

References m_entryList, and m_entryListTechTrig.

129  {
130 
131  for (ItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
132  if (*itEntry != 0) {
133  delete *itEntry;
134  *itEntry = 0;
135  }
136  }
137 
138  m_entryList.clear();
139 
140  for (ItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
141  if (*itEntry != 0) {
142  delete *itEntry;
143  *itEntry = 0;
144  }
145  }
146 
147  m_entryListTechTrig.clear();
148 
149 }
std::list< L1GtTrigReportEntry * > m_entryListTechTrig
list of individual entries in the report for technical triggers
std::list< L1GtTrigReportEntry * > m_entryList
list of individual entries in the report for physics algorithms
std::list< L1GtTrigReportEntry * >::iterator ItEntry

Member Function Documentation

void L1GtTrigReport::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)
privatevirtual

analyze each event

Implements edm::EDAnalyzer.

Definition at line 162 of file L1GtTrigReport.cc.

References L1GtTrigReportEntry::addErrorEntry(), L1GtTrigReportEntry::addValidEntry(), edm::EventSetup::get(), edm::Event::getByLabel(), L1GtTriggerMenu::gtAlgorithmMap(), L1GtStableParameters::gtNumberPhysTriggers(), L1GtStableParameters::gtNumberTechnicalTriggers(), L1GtPrescaleFactors::gtPrescaleFactors(), L1GtTriggerMenu::gtTechnicalTriggerMap(), L1GtTriggerMask::gtTriggerMask(), L1GtTriggerMenu::gtTriggerMenuName(), edm::HandleBase::isValid(), edm::InputTag::label(), LogDebug, m_entryList, m_entryListTechTrig, m_globalNrAccepts, m_globalNrErrors, m_l1GtMenu, m_l1GtMenuCacheID, m_l1GtPfAlgo, m_l1GtPfAlgoCacheID, m_l1GtPfTech, m_l1GtPfTechCacheID, m_l1GtRecordInputTag, m_l1GtStablePar, m_l1GtStableParCacheID, m_l1GtTmAlgo, m_l1GtTmAlgoCacheID, m_l1GtTmTech, m_l1GtTmTechCacheID, m_l1GtTmVetoAlgo, m_l1GtTmVetoAlgoCacheID, m_l1GtTmVetoTech, m_l1GtTmVetoTechCacheID, m_numberDaqPartitions, m_numberDaqPartitionsMax, m_numberPhysTriggers, m_numberTechnicalTriggers, m_physicsDaqPartition, m_prescaleFactorsAlgoTrig, m_prescaleFactorsTechTrig, m_totalEvents, m_triggerMaskAlgoTrig, m_triggerMaskTechTrig, m_triggerMaskVetoAlgoTrig, m_triggerMaskVetoTechTrig, m_useL1GlobalTriggerRecord, dtDQMClient_cfg::prescaleFactor, edm::ESHandle< class >::product(), and AlCaHLTBitMon_QueryRunRegistry::string.

162  {
163 
164  // increase the number of processed events
165  m_totalEvents++;
166 
167  // get / update the stable parameters from the EventSetup
168  // local cache & check on cacheIdentifier
169 
170  unsigned long long l1GtStableParCacheID =
171  evSetup.get<L1GtStableParametersRcd>().cacheIdentifier();
172 
173  if (m_l1GtStableParCacheID != l1GtStableParCacheID) {
174 
176  evSetup.get<L1GtStableParametersRcd>().get(l1GtStablePar);
177  m_l1GtStablePar = l1GtStablePar.product();
178 
179  // number of physics triggers
181 
182  // number of technical triggers
184 
185  // number of DAQ partitions
186  m_numberDaqPartitions = 8; // FIXME add it to stable parameters
187 
189 
190  int numberDaqPartitionsOld = m_numberDaqPartitionsMax;
192 
195 
196  for (unsigned int iDaq = numberDaqPartitionsOld; iDaq < m_numberDaqPartitionsMax; ++iDaq) {
197 
198  m_globalNrErrors.push_back(0);
199  m_globalNrAccepts.push_back(0);
200 
201  }
202 
203  }
204 
205  //
206  m_l1GtStableParCacheID = l1GtStableParCacheID;
207 
208  }
209 
210  // get / update the prescale factors from the EventSetup
211  // local cache & check on cacheIdentifier
212 
213  unsigned long long l1GtPfAlgoCacheID =
214  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().cacheIdentifier();
215 
216  if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
217 
219  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
220  m_l1GtPfAlgo = l1GtPfAlgo.product();
221 
223 
224  m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
225 
226  }
227 
228  unsigned long long l1GtPfTechCacheID =
229  evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().cacheIdentifier();
230 
231  if (m_l1GtPfTechCacheID != l1GtPfTechCacheID) {
232 
234  evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech);
235  m_l1GtPfTech = l1GtPfTech.product();
236 
238 
239  m_l1GtPfTechCacheID = l1GtPfTechCacheID;
240 
241  }
242 
243  // get / update the trigger mask from the EventSetup
244  // local cache & check on cacheIdentifier
245 
246  unsigned long long l1GtTmAlgoCacheID =
247  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
248 
249  if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
250 
252  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo);
253  m_l1GtTmAlgo = l1GtTmAlgo.product();
254 
256 
257  m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
258 
259  }
260 
261  unsigned long long l1GtTmTechCacheID =
262  evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
263 
264  if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
265 
267  evSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech);
268  m_l1GtTmTech = l1GtTmTech.product();
269 
271 
272  m_l1GtTmTechCacheID = l1GtTmTechCacheID;
273 
274  }
275 
276  unsigned long long l1GtTmVetoAlgoCacheID =
277  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().cacheIdentifier();
278 
279  if (m_l1GtTmVetoAlgoCacheID != l1GtTmVetoAlgoCacheID) {
280 
281  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoAlgo;
282  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().get(l1GtTmVetoAlgo);
283  m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
284 
286 
287  m_l1GtTmVetoAlgoCacheID = l1GtTmVetoAlgoCacheID;
288 
289  }
290 
291  unsigned long long l1GtTmVetoTechCacheID =
292  evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().cacheIdentifier();
293 
294  if (m_l1GtTmVetoTechCacheID != l1GtTmVetoTechCacheID) {
295 
296  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoTech;
297  evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().get(l1GtTmVetoTech);
298  m_l1GtTmVetoTech = l1GtTmVetoTech.product();
299 
301 
302  m_l1GtTmVetoTechCacheID = l1GtTmVetoTechCacheID;
303 
304  }
305 
306  // get / update the trigger menu from the EventSetup
307  // local cache & check on cacheIdentifier
308 
309  unsigned long long l1GtMenuCacheID =
310  evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();
311 
312  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
313 
315  evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu);
316  m_l1GtMenu = l1GtMenu.product();
317 
318  m_l1GtMenuCacheID = l1GtMenuCacheID;
319 
320  LogDebug("L1GtTrigReport") << "\n Changing L1 menu to : \n"
321  << m_l1GtMenu->gtTriggerMenuName() << "\n\n" << std::endl;
322 
323  }
324 
325 
326  const AlgorithmMap& algorithmMap = m_l1GtMenu->gtAlgorithmMap();
327  const AlgorithmMap& technicalTriggerMap = m_l1GtMenu->gtTechnicalTriggerMap();
328 
329  const std::string& menuName = m_l1GtMenu->gtTriggerMenuName();
330 
331  // ... end EventSetup
332 
333  // get L1GlobalTriggerReadoutRecord or L1GlobalTriggerRecord
334  // in L1GlobalTriggerRecord, only the physics partition is available
337 
339  iEvent.getByLabel(m_l1GtRecordInputTag, gtRecord);
340  } else {
341  iEvent.getByLabel(m_l1GtRecordInputTag, gtReadoutRecord);
342  }
343 
344  bool validRecord = false;
345 
346  unsigned int pfIndexAlgo = 0; // get them later from the record
347  unsigned int pfIndexTech = 0;
348 
349  DecisionWord gtDecisionWordBeforeMask;
350  DecisionWord gtDecisionWordAfterMask;
351 
352  TechnicalTriggerWord technicalTriggerWordBeforeMask;
353  TechnicalTriggerWord technicalTriggerWordAfterMask;
354 
356 
357  if (gtRecord.isValid()) {
358 
359  // get Global Trigger decision and the decision word
360  bool gtDecision = gtRecord->decision();
361 
362  gtDecisionWordBeforeMask = gtRecord->decisionWordBeforeMask();
363  gtDecisionWordAfterMask = gtRecord->decisionWord();
364 
365  technicalTriggerWordBeforeMask = gtRecord->technicalTriggerWordBeforeMask();
366  technicalTriggerWordAfterMask = gtRecord->technicalTriggerWord();
367 
368  if (gtDecision) {
370  }
371 
372  pfIndexAlgo = gtRecord->gtPrescaleFactorIndexAlgo();
373  pfIndexTech = gtRecord->gtPrescaleFactorIndexTech();
374 
375  validRecord = true;
376 
377  } else {
378 
380 
381  edm::LogWarning("L1GtTrigReport") << "\n L1GlobalTriggerRecord with input tag "
382  << m_l1GtRecordInputTag.label() << " not found."
383  << "\n Event classified as Error\n\n"
384  << std::endl;
385 
386  }
387 
388  } else {
389  if (gtReadoutRecord.isValid()) {
390 
391  // check if the readout record has size greater than zero, then proceeds
392  const std::vector<L1GtFdlWord>& fdlVec = gtReadoutRecord->gtFdlVector();
393  size_t fdlVecSize = fdlVec.size();
394 
395  if (fdlVecSize > 0) {
396 
397  LogDebug("L1GtTrigReport") << "\n L1GlobalTriggerReadoutRecord with input tag "
398  << m_l1GtRecordInputTag.label() << " has gtFdlVector of size " << fdlVecSize
399  << std::endl;
400 
401  // get Global Trigger finalOR and the decision word
402  boost::uint16_t gtFinalOR = gtReadoutRecord->finalOR();
403 
404  gtDecisionWordBeforeMask = gtReadoutRecord->decisionWord();
405  technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
406 
407  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
408 
409  bool gtDecision = static_cast<bool>(gtFinalOR & ( 1 << iDaqPartition ));
410  if (gtDecision) {
411  m_globalNrAccepts[iDaqPartition]++;
412  }
413 
414  }
415 
416  pfIndexAlgo
417  = static_cast<unsigned int>( ( gtReadoutRecord->gtFdlWord() ).gtPrescaleFactorIndexAlgo());
418  pfIndexTech
419  = static_cast<unsigned int>( ( gtReadoutRecord->gtFdlWord() ).gtPrescaleFactorIndexTech());
420 
421  validRecord = true;
422 
423  } else {
424 
425  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
426  m_globalNrErrors[iDaqPartition]++;
427  }
428 
429  edm::LogWarning("L1GtTrigReport") << "\n L1GlobalTriggerReadoutRecord with input tag "
430  << m_l1GtRecordInputTag.label() << " has gtFdlVector of size " << fdlVecSize
431  << "\n Invalid L1GlobalTriggerReadoutRecord!"
432  << "\n Event classified as Error\n\n"
433  << std::endl;
434 
435  validRecord = false;
436 
437  }
438 
439  } else {
440 
441  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
442  m_globalNrErrors[iDaqPartition]++;
443  }
444 
445  edm::LogWarning("L1GtTrigReport") << "\n L1GlobalTriggerReadoutRecord with input tag "
446  << m_l1GtRecordInputTag.label() << " not found."
447  << "\n Event classified as Error\n\n"
448  << std::endl;
449 
450  }
451 
452  }
453 
454  // get the prescale factor set used in the actual luminosity segment
455  const std::vector<int>& prescaleFactorsAlgoTrig =
456  ( *m_prescaleFactorsAlgoTrig ).at(pfIndexAlgo);
457 
458  const std::vector<int>& prescaleFactorsTechTrig =
459  ( *m_prescaleFactorsTechTrig ).at(pfIndexTech);
460 
461 
462  if (validRecord) {
463 
464  // loop over algorithms and increase the corresponding counters
465  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
466 
467  std::string algName = itAlgo->first;
468  int algBitNumber = ( itAlgo->second ).algoBitNumber();
469 
470  // the result before applying the trigger masks is available
471  // in both L1GlobalTriggerReadoutRecord or L1GlobalTriggerRecord
472  bool algResultBeforeMask = gtDecisionWordBeforeMask[algBitNumber];
473 
474  int prescaleFactor = prescaleFactorsAlgoTrig.at(algBitNumber);
475 
476  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
477 
478  unsigned int triggerMask = ( m_triggerMaskAlgoTrig.at(algBitNumber) ) & ( 1
479  << iDaqPartition );
480 
481  bool algResultAfterMask = false;
482 
484  if (iDaqPartition == m_physicsDaqPartition) {
485  // result available already for physics DAQ partition
486  // in lite record
487  algResultAfterMask = gtDecisionWordAfterMask[algBitNumber];
488  } else {
489  // apply the masks for other partitions
490  algResultAfterMask = algResultBeforeMask;
491 
492  if (triggerMask) {
493  algResultAfterMask = false;
494  }
495  }
496  } else {
497  // apply the masks for L1GlobalTriggerReadoutRecord
498  algResultAfterMask = algResultBeforeMask;
499 
500  if (triggerMask) {
501  algResultAfterMask = false;
502  }
503  }
504 
506  menuName, algName, prescaleFactor, triggerMask, iDaqPartition);
507 
508  int iCount = 0;
509 
510  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
511  if ( ( *entryRep ) == * ( *itEntry )) {
512  iCount++;
513  // increase the corresponding counter in the list entry
514  ( *itEntry )->addValidEntry(algResultAfterMask, algResultBeforeMask);
515  }
516  }
517 
518  if (iCount == 0) {
519  // if entry not in the list, increase the corresponding counter
520  // and push the entry in the list
521  entryRep->addValidEntry(algResultAfterMask, algResultBeforeMask);
522  m_entryList.push_back(entryRep);
523  } else {
524  delete entryRep;
525  }
526  }
527  }
528 
529  // loop over technical triggers and increase the corresponding counters
530  for (CItAlgo itAlgo = technicalTriggerMap.begin(); itAlgo != technicalTriggerMap.end(); itAlgo++) {
531  //for (unsigned int iTechTrig = 0; iTechTrig < m_numberTechnicalTriggers; ++iTechTrig) {
532 
533  std::string ttName = itAlgo->first;
534  int ttBitNumber = ( itAlgo->second ).algoBitNumber();
535  // std::string ttName = boost::lexical_cast<std::string>(iTechTrig);
536  // int ttBitNumber = iTechTrig;
537 
538  // the result before applying the trigger masks is available
539  // in both L1GlobalTriggerReadoutRecord or L1GlobalTriggerRecord
540  bool ttResultBeforeMask = technicalTriggerWordBeforeMask[ttBitNumber];
541 
542  int prescaleFactor = prescaleFactorsTechTrig.at(ttBitNumber);
543 
544  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
545 
546  unsigned int triggerMask = ( m_triggerMaskTechTrig.at(ttBitNumber) ) & ( 1
547  << iDaqPartition );
548 
549  bool ttResultAfterMask = false;
550 
552  if (iDaqPartition == m_physicsDaqPartition) {
553  // result available already for physics DAQ partition
554  // in lite record
555  ttResultAfterMask = technicalTriggerWordAfterMask[ttBitNumber];
556  } else {
557  // apply the masks for other partitions
558  ttResultAfterMask = ttResultBeforeMask;
559 
560  if (triggerMask) {
561  ttResultAfterMask = false;
562  }
563  }
564  } else {
565  // apply the masks for L1GlobalTriggerReadoutRecord
566  ttResultAfterMask = ttResultBeforeMask;
567 
568  if (triggerMask) {
569  ttResultAfterMask = false;
570  }
571  }
572 
574  menuName, ttName, prescaleFactor, triggerMask, iDaqPartition);
575 
576  int iCount = 0;
577 
578  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
579  != m_entryListTechTrig.end(); itEntry++) {
580  if ( ( *entryRep ) == * ( *itEntry )) {
581  iCount++;
582  // increase the corresponding counter in the list entry
583  ( *itEntry )->addValidEntry(ttResultAfterMask, ttResultBeforeMask);
584  }
585  }
586 
587  if (iCount == 0) {
588  // if entry not in the list, increase the corresponding counter
589  // and push the entry in the list
590  entryRep->addValidEntry(ttResultAfterMask, ttResultBeforeMask);
591  m_entryListTechTrig.push_back(entryRep);
592  } else {
593  delete entryRep;
594  }
595  }
596  }
597 
598  } else {
599 
600  // loop over algorithms and increase the error counters
601  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
602 
603  std::string algName = itAlgo->first;
604  int algBitNumber = ( itAlgo->second ).algoBitNumber();
605 
606  int prescaleFactor = prescaleFactorsAlgoTrig.at(algBitNumber);
607 
608  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
609 
610  unsigned int triggerMask = ( m_triggerMaskAlgoTrig.at(algBitNumber) ) & ( 1
611  << iDaqPartition );
612 
614  menuName, algName, prescaleFactor, triggerMask, iDaqPartition);
615 
616  int iCount = 0;
617 
618  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
619 
620  if ( ( *entryRep ) == * ( *itEntry )) {
621  iCount++;
622  // increase the corresponding counter in the list entry
623  ( *itEntry )->addErrorEntry();
624  }
625  }
626 
627  if (iCount == 0) {
628  // if entry not in the list, increase the corresponding counter
629  // and push the entry in the list
630  entryRep->addErrorEntry();
631  m_entryList.push_back(entryRep);
632  } else {
633  delete entryRep;
634  }
635  }
636 
637  }
638 
639  // loop over technical triggers and increase the error counters
640  // FIXME move to names when technical triggers available in menu
641  //for (CItAlgo itAlgo = technicalTriggerMap.begin(); itAlgo != technicalTriggerMap.end(); itAlgo++) {
642  for (unsigned int iTechTrig = 0; iTechTrig < m_numberTechnicalTriggers; ++iTechTrig) {
643 
644  //std::string ttName = itAlgo->first;
645  //int ttBitNumber = ( itAlgo->second ).algoBitNumber();
646  std::string ttName = boost::lexical_cast<std::string>(iTechTrig);
647  int ttBitNumber = iTechTrig;
648 
649  int prescaleFactor = prescaleFactorsTechTrig.at(ttBitNumber);
650 
651  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
652 
653  unsigned int triggerMask = ( m_triggerMaskTechTrig.at(ttBitNumber) ) & ( 1
654  << iDaqPartition );
655 
657  menuName, ttName, prescaleFactor, triggerMask, iDaqPartition);
658 
659  int iCount = 0;
660 
661  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
662  != m_entryListTechTrig.end(); itEntry++) {
663 
664  if ( ( *entryRep ) == * ( *itEntry )) {
665  iCount++;
666  // increase the corresponding counter in the list entry
667  ( *itEntry )->addErrorEntry();
668  }
669  }
670 
671  if (iCount == 0) {
672  // if entry not in the list, increase the corresponding counter
673  // and push the entry in the list
674  entryRep->addErrorEntry();
675  m_entryListTechTrig.push_back(entryRep);
676  } else {
677  delete entryRep;
678  }
679  }
680 
681  }
682 
683  }
684 
685 }
#define LogDebug(id)
const std::string & gtTriggerMenuName() const
std::vector< int > m_globalNrErrors
global number of events with error (EDProduct[s] not found)
std::list< L1GtTrigReportEntry * >::const_iterator CItEntry
std::list< L1GtTrigReportEntry * > m_entryListTechTrig
list of individual entries in the report for technical triggers
const L1GtTriggerMenu * m_l1GtMenu
std::vector< unsigned int > m_triggerMaskTechTrig
unsigned int m_numberDaqPartitions
number of DAQ partitions
unsigned long long m_l1GtStableParCacheID
const L1GtStableParameters * m_l1GtStablePar
cached stuff
std::vector< unsigned int > m_triggerMaskAlgoTrig
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
void addValidEntry(const bool algResultAfterMask, const bool algResultBeforeMask)
increase # of events accepted/rejected for this entry
unsigned long long m_l1GtPfTechCacheID
unsigned int m_numberDaqPartitionsMax
const L1GtTriggerMask * m_l1GtTmVetoTech
const L1GtPrescaleFactors * m_l1GtPfTech
const L1GtTriggerMask * m_l1GtTmVetoAlgo
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
std::list< L1GtTrigReportEntry * > m_entryList
list of individual entries in the report for physics algorithms
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
bool m_useL1GlobalTriggerRecord
boolean flag to select the input record
unsigned long long m_l1GtPfAlgoCacheID
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
std::vector< bool > DecisionWord
typedefs
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks &amp; veto masks
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
unsigned long long m_l1GtTmAlgoCacheID
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
std::vector< unsigned int > m_triggerMaskVetoTechTrig
bool isValid() const
Definition: HandleBase.h:76
unsigned int m_numberTechnicalTriggers
number of technical triggers
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
unsigned long long m_l1GtTmVetoTechCacheID
void addErrorEntry()
increase # of events with error
const L1GtTriggerMask * m_l1GtTmTech
std::vector< int > m_globalNrAccepts
global number of events accepted by any of the L1 algorithm in any menu
unsigned long long m_l1GtMenuCacheID
unsigned long long m_l1GtTmTechCacheID
std::vector< unsigned int > m_triggerMaskVetoAlgoTrig
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
int m_totalEvents
counters
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
unsigned int m_physicsDaqPartition
index of physics DAQ partition
edm::InputTag m_l1GtRecordInputTag
input tag for GT record (L1 GT DAQ record or L1 GT &quot;lite&quot; record):
std::string const & label() const
Definition: InputTag.h:42
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
unsigned int m_numberPhysTriggers
number of physics triggers
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
unsigned long long m_l1GtTmVetoAlgoCacheID
void L1GtTrigReport::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 155 of file L1GtTrigReport.cc.

155  {
156 
157  // empty
158 
159 }
void L1GtTrigReport::endJob ( void  )
privatevirtual

end of job

Reimplemented from edm::EDAnalyzer.

Definition at line 688 of file L1GtTrigReport.cc.

References gather_cfg::cout, LogTrace, m_entryList, m_entryListTechTrig, m_globalNrAccepts, m_globalNrErrors, m_numberDaqPartitions, m_physicsDaqPartition, m_printOutput, m_printVerbosity, m_totalEvents, m_useL1GlobalTriggerRecord, and mathSSE::sqrt().

688  {
689 
690  // define an output stream to print into
691  // it can then be directed to whatever log level is desired
692  std::ostringstream myCout;
693 
694  myCout << std::dec << std::endl;
695  myCout << "L1T-Report " << "---------- Event Summary ----------\n";
696  myCout << "L1T-Report " << "Total number of events processed: " << m_totalEvents << "\n";
697  myCout << "L1T-Report\n";
698 
699  myCout
700  << "\n"
701  << " DAQ partition "
702  << " Total "
703  << " Passed[finalOR] "
704  << " Rejected "
705  << " Errors "
706  << "\n" << std::endl;
707 
708  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
709 
710  int rejectedEvents = m_totalEvents - m_globalNrErrors[iDaqPartition]
711  - m_globalNrAccepts[iDaqPartition];
712 
713  if (m_useL1GlobalTriggerRecord && ( iDaqPartition != m_physicsDaqPartition )) {
714  continue;
715  } else {
716 
717  myCout
718  << std::right << std::setw(16) << iDaqPartition << " "
719  << std::right << std::setw(16) << m_totalEvents << " "
720  << std::right << std::setw(16) << m_globalNrAccepts[iDaqPartition] << " "
721  << std::right << std::setw(16) << rejectedEvents << " "
722  << std::right << std::setw(16) << m_globalNrErrors[iDaqPartition] << std::endl;
723 
724  }
725 
726  }
727 
728  // get the list of menus for the sample analyzed
729  //
730  std::set<std::string> menuList;
731  typedef std::set<std::string>::const_iterator CItL1Menu;
732 
733  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
734  menuList.insert( ( *itEntry )->gtTriggerMenuName());
735  }
736 
737  myCout
738  << "\nThe following L1 menus were used for this sample: " << std::endl;
739  for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
740  myCout << " " << ( *itMenu ) << std::endl;
741  }
742  myCout << "\n" << std::endl;
743 
744  switch (m_printVerbosity) {
745  case 0: {
746 
747  myCout
748  << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
749  << m_physicsDaqPartition << "----------\n\n";
750 
751  myCout
752  << "\n\n Number of events written after applying L1 prescale factors"
753  << " and trigger masks\n" << " if not explicitly mentioned.\n\n";
754 
755  for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
756 
757  myCout << "\nReport for L1 menu: " << (*itMenu) << "\n"
758  << std::endl;
759 
760  myCout
761  << std::right << std::setw(45) << "Algorithm Key" << " "
762  << std::right << std::setw(10) << "Passed" << " "
763  << std::right << std::setw(10) << "Rejected" << " "
764  << std::right << std::setw(10) << "Error"
765  << "\n";
766 
767  for (CItEntry itEntry = m_entryList.begin(); itEntry
768  != m_entryList.end(); itEntry++) {
769 
770  if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition)
771  && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
772 
773  myCout
774  << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " "
775  << std::right << std::setw(10) << (*itEntry)->gtNrEventsAccept() << " "
776  << std::right << std::setw(10) << (*itEntry)->gtNrEventsReject() << " "
777  << std::right << std::setw(10) << (*itEntry)->gtNrEventsError()
778  << "\n";
779  }
780 
781  }
782 
783  myCout
784  << "\n\n"
785  << std::right << std::setw(45) << "Technical Trigger Key" << " "
786  << std::right << std::setw(10) << "Passed" << " "
787  << std::right << std::setw(10) << "Rejected" << " "
788  << std::right << std::setw(10) << "Error"
789  << "\n";
790 
791  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
792  != m_entryListTechTrig.end(); itEntry++) {
793 
794  if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition)
795  && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
796 
797  myCout
798  << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " "
799  << std::right << std::setw(10) << (*itEntry)->gtNrEventsAccept() << " "
800  << std::right << std::setw(10) << (*itEntry)->gtNrEventsReject() << " "
801  << std::right << std::setw(10) << (*itEntry)->gtNrEventsError()
802  << "\n";
803  }
804 
805  }
806  }
807 
808  }
809 
810  break;
811  case 1: {
812 
813  myCout << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
814  << m_physicsDaqPartition << "----------\n\n";
815 
816  myCout << "\n\n Number of events written after applying L1 prescale factors"
817  << " and trigger masks\n" << " if not explicitly mentioned.\n\n";
818 
819  for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
820 
821  myCout << "\nReport for L1 menu: " << (*itMenu) << "\n"
822  << std::endl;
823  myCout
824  << std::right << std::setw(45) << "Algorithm Key" << " "
825  << std::right << std::setw(10) << "Prescale" << " "
826  << std::right << std::setw(5) << "Mask" << " "
827  << std::right << std::setw(10) << "Passed" << " "
828  << std::right << std::setw(10) << "Rejected" << " "
829  << std::right << std::setw(10) << "Error" << std::setw(2) << " "
830  << "\n";
831 
832  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
833 
834  if ( (( *itEntry )->gtDaqPartition() == m_physicsDaqPartition)
835  && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
836  myCout
837  << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
838  << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
839  << std::right << std::setw(2) //<< std::setfill('0')
840  << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
841  << std::dec << " "
842  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
843  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
844  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
845  << "\n";
846  }
847  }
848 
849  myCout
850  << "\n\n"
851  << std::right << std::setw(45) << "Technical Trigger Key" << " "
852  << std::right << std::setw(10) << "Prescale" << " "
853  << std::right << std::setw(5) << "Mask" << " "
854  << std::right << std::setw(10) << "Passed" << " "
855  << std::right << std::setw(10) << "Rejected" << " "
856  << std::right << std::setw(10) << "Error" << std::setw(2) << " "
857  << "\n";
858 
859  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
860 
861  if ( (( *itEntry )->gtDaqPartition() == m_physicsDaqPartition)
862  && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
863  myCout
864  << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
865  << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
866  << std::right << std::setw(2) //<< std::setfill('0')
867  << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
868  << std::dec << " "
869  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
870  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
871  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
872  << "\n";
873  }
874  }
875  }
876 
877  }
878 
879  break;
880  case 2: {
881 
882 
883  for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
884 
885  myCout << "\nReport for L1 menu: " << ( *itMenu ) << "\n"
886  << std::endl;
887 
888  myCout
889  << std::right << std::setw(45) << "Algorithm Key" << " "
890  << std::right << std::setw(10) << "Passed" << " "
891  << std::right << std::setw(10) << "Rejected" << " "
892  << std::right << std::setw(10) << "Error" << "\n";
893 
894  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
895 
896  if ( ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition )
897  && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
898 
899  int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
900  int nrEventsReject = ( *itEntry )->gtNrEventsReject();
901  int nrEventsError = ( *itEntry )->gtNrEventsError();
902 
903  myCout
904  << std::right << std::setw(45) << (( *itEntry )->gtAlgoName()) << " "
905  << std::right << std::setw(10) << nrEventsAccept << " "
906  << std::right << std::setw(10) << nrEventsReject << " "
907  << std::right << std::setw(10) << nrEventsError << "\n";
908 
909  }
910  }
911 
912  // efficiency and its statistical error
913 
914  myCout << "\n\n"
915  << std::right << std::setw(45) << "Algorithm Key" << " "
916  << std::right << std::setw(10) << "Efficiency " << " "
917  << std::right << std::setw(10) << "Stat error (%)" << "\n";
918 
919  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
920 
921  if ( ( ( *itEntry )->gtDaqPartition() == 0 )
922  && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
923 
924  int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
925  int nrEventsReject = ( *itEntry )->gtNrEventsReject();
926  int nrEventsError = ( *itEntry )->gtNrEventsError();
927 
928  int totalEvents = nrEventsAccept + nrEventsReject + nrEventsError;
929 
930  // efficiency and their statistical error
931  float eff = 0.;
932  float statErrEff = 0.;
933 
934  if (totalEvents != 0) {
935  eff = static_cast<float> (nrEventsAccept)
936  / static_cast<float> (totalEvents);
937  statErrEff = sqrt(eff * ( 1.0 - eff )
938  / static_cast<float> (totalEvents));
939 
940  }
941 
942  myCout
943  << std::right << std::setw(45) << (( *itEntry )->gtAlgoName()) << " "
944  << std::right << std::setw(10) << std::fixed << std::setprecision(2)
945  << 100.*eff << " +- "
946  << std::right << std::setw(10) << std::setprecision(2)
947  << 100.*statErrEff << "\n";
948 
949 
950  }
951 
952  }
953 
954  myCout
955  << "\n\n"
956  << std::right << std::setw(45) << "Technical Trigger Key" << " "
957  << std::right << std::setw(10) << "Passed" << " "
958  << std::right << std::setw(10) << "Rejected" << " "
959  << std::right << std::setw(10) << "Error" << "\n";
960 
961  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
962  != m_entryListTechTrig.end(); itEntry++) {
963 
964  if ( ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition )
965  && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
966 
967  int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
968  int nrEventsReject = ( *itEntry )->gtNrEventsReject();
969  int nrEventsError = ( *itEntry )->gtNrEventsError();
970 
971  myCout
972  << std::right << std::setw(45) << (( *itEntry )->gtAlgoName()) << " "
973  << std::right << std::setw(10) << nrEventsAccept << " "
974  << std::right << std::setw(10) << nrEventsReject << " "
975  << std::right << std::setw(10) << nrEventsError << "\n";
976 
977  }
978  }
979 
980  // efficiency and its statistical error
981 
982  myCout << "\n\n"
983  << std::right << std::setw(45) << "Technical Trigger Key" << " "
984  << std::right << std::setw(10) << "Efficiency " << " "
985  << std::right << std::setw(10) << "Stat error (%)" << "\n";
986 
987  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
988  != m_entryListTechTrig.end(); itEntry++) {
989 
990  if ( ( ( *itEntry )->gtDaqPartition() == 0 )
991  && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
992 
993  int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
994  int nrEventsReject = ( *itEntry )->gtNrEventsReject();
995  int nrEventsError = ( *itEntry )->gtNrEventsError();
996 
997  int totalEvents = nrEventsAccept + nrEventsReject + nrEventsError;
998 
999  // efficiency and their statistical error
1000  float eff = 0.;
1001  float statErrEff = 0.;
1002 
1003  if (totalEvents != 0) {
1004  eff = static_cast<float> (nrEventsAccept)
1005  / static_cast<float> (totalEvents);
1006  statErrEff = sqrt(eff * ( 1.0 - eff )
1007  / static_cast<float> (totalEvents));
1008 
1009  }
1010 
1011  myCout
1012  << std::right << std::setw(45) << (( *itEntry )->gtAlgoName()) << " "
1013  << std::right << std::setw(10) << std::fixed << std::setprecision(2)
1014  << 100.*eff << " +- "
1015  << std::right << std::setw(10) << std::setprecision(2)
1016  << 100.*statErrEff << "\n";
1017 
1018 
1019  }
1020 
1021  }
1022 
1023  }
1024 
1025 
1026  }
1027  break;
1028 
1029  case 10: {
1030 
1031  myCout << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
1032  << m_physicsDaqPartition << "----------\n\n";
1033 
1034  for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
1035 
1036  myCout << "\nReport for L1 menu: " << ( *itMenu ) << "\n"
1037  << std::endl;
1038  myCout
1039  << std::right << std::setw(45) << "Algorithm Key" << " "
1040  << std::right << std::setw(10) << "Prescale" << " "
1041  << std::right << std::setw(5) << "Mask" << " "
1042  << std::right << std::setw(25) << "Before Mask" << " "
1043  << std::right << std::setw(30) << "After Mask" << " "
1044  << std::right << std::setw(22) << "Error"
1045  << "\n"
1046  << std::right << std::setw(64) << " " << std::setw(15) << "Passed"
1047  << std::right << std::setw(1) << " " << std::setw(15) << "Rejected"
1048  << std::right << std::setw(1) << " " << std::setw(15) << "Passed"
1049  << std::right << std::setw(1) << " " << std::setw(15) << "Rejected"
1050  << "\n";
1051 
1052  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
1053 
1054  if ( (( *itEntry )->gtDaqPartition() == m_physicsDaqPartition)
1055  && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
1056  myCout
1057  << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
1058  << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
1059  << std::right << std::setw(5) << " " << std::hex << ( *itEntry )->gtTriggerMask() << std::dec << " "
1060  << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAcceptBeforeMask() << " "
1061  << std::right << std::setw(15) << ( *itEntry )->gtNrEventsRejectBeforeMask() << " "
1062  << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAccept() << " "
1063  << std::right << std::setw(15) << ( *itEntry )->gtNrEventsReject() << " "
1064  << std::right << std::setw(15) << ( *itEntry )->gtNrEventsError()
1065  << "\n";
1066  }
1067  }
1068 
1069  myCout
1070  << "\n\n"
1071  << std::right << std::setw(45) << "Technical Trigger Key" << " "
1072  << std::right << std::setw(10) << "Prescale" << " "
1073  << std::right << std::setw(5) << "Mask" << " "
1074  << std::right << std::setw(25) << "Before Mask" << " "
1075  << std::right << std::setw(30) << "After Mask" << " "
1076  << std::right << std::setw(22) << "Error"
1077  << "\n"
1078  << std::right << std::setw(64) << " " << std::setw(15) << "Passed"
1079  << std::right << std::setw(1) << " " << std::setw(15) << "Rejected"
1080  << std::right << std::setw(1) << " " << std::setw(15) << "Passed"
1081  << std::right << std::setw(1) << " " << std::setw(15) << "Rejected"
1082  << "\n";
1083 
1084  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
1085 
1086  if ( (( *itEntry )->gtDaqPartition() == m_physicsDaqPartition)
1087  && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
1088  myCout
1089  << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
1090  << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
1091  << std::right << std::setw(5) << " " << std::hex << ( *itEntry )->gtTriggerMask() << std::dec << " "
1092  << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAcceptBeforeMask() << " "
1093  << std::right << std::setw(15) << ( *itEntry )->gtNrEventsRejectBeforeMask() << " "
1094  << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAccept() << " "
1095  << std::right << std::setw(15) << ( *itEntry )->gtNrEventsReject() << " "
1096  << std::right << std::setw(15) << ( *itEntry )->gtNrEventsError()
1097  << "\n";
1098  }
1099  }
1100  }
1101  }
1102 
1103  break;
1104  case 100: {
1105 
1106  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
1107 
1108  myCout << "\nL1T-Report "
1109  << "---------- L1 Trigger Global Summary - DAQ Partition " << iDaqPartition
1110  << " " << "----------\n\n";
1111 
1112  myCout
1113  << std::right << std::setw(45) << "Algorithm Key" << " "
1114  << std::right << std::setw(10) << "Passed" << " "
1115  << std::right << std::setw(10) << "Rejected" << " "
1116  << std::right << std::setw(10) << "Error" << std::setw(2) << " "
1117  << "\n";
1118 
1119  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
1120 
1121  if ( (( *itEntry )->gtDaqPartition() == 0)) {
1122 
1123  myCout
1124  << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
1125  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
1126  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
1127  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
1128  << "\n";
1129  }
1130 
1131  }
1132 
1133  myCout
1134  << "\n\n"
1135  << std::right << std::setw(45) << "Technical Trigger Key" << " "
1136  << std::right << std::setw(10) << "Passed" << " "
1137  << std::right << std::setw(10) << "Rejected" << " "
1138  << std::right << std::setw(10) << "Error" << std::setw(2) << " "
1139  << "\n";
1140 
1141  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
1142 
1143  if ( ( *itEntry )->gtDaqPartition() == 0) {
1144 
1145  myCout
1146  << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
1147  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
1148  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
1149  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
1150  << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
1151  << "\n";
1152  }
1153 
1154  }
1155 
1156  }
1157  }
1158 
1159  break;
1160  case 101: {
1161 
1162  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
1163 
1164  myCout << "\nL1T-Report "
1165  << "---------- L1 Trigger Global Summary - DAQ Partition " << iDaqPartition
1166  << " " << "----------\n\n";
1167 
1168  myCout
1169  << std::right << std::setw(45) << "Algorithm Key" << " "
1170  << std::right << std::setw(10) << "Prescale" << " "
1171  << std::right << std::setw(5) << "Mask" << " "
1172  << std::right << std::setw(10) << "Passed" << " "
1173  << std::right << std::setw(10) << "Rejected" << " "
1174  << std::right << std::setw(10) << "Error" << std::setw(2) << " "
1175  << "\n";
1176 
1177  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
1178 
1179  if ( ( *itEntry )->gtDaqPartition() == 0) {
1180  myCout
1181  << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
1182  << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
1183  << std::right << std::setw(2) //<< std::setfill('0')
1184  << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
1185  << std::dec << " "
1186  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
1187  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
1188  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
1189  << "\n";
1190  }
1191  }
1192 
1193  myCout
1194  << "\n\n"
1195  << std::right << std::setw(45) << "Technical Trigger Key" << " "
1196  << std::right << std::setw(10) << "Prescale" << " "
1197  << std::right << std::setw(5) << "Mask" << " "
1198  << std::right << std::setw(10) << "Passed" << " "
1199  << std::right << std::setw(10) << "Rejected" << " "
1200  << std::right << std::setw(10) << "Error" << std::setw(2) << " "
1201  << "\n";
1202 
1203  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
1204 
1205  if ( ( *itEntry )->gtDaqPartition() == 0) {
1206  myCout
1207  << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
1208  << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
1209  << std::right << std::setw(2) //<< std::setfill('0')
1210  << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
1211  << std::dec << " "
1212  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
1213  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
1214  << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
1215  << "\n";
1216  }
1217  }
1218 
1219  }
1220  }
1221 
1222  break;
1223  default: {
1224  myCout
1225  << "\n\nL1GtTrigReport: Error - no print verbosity level = " << m_printVerbosity
1226  << " defined! \nCheck available values in the cfi file." << "\n";
1227  }
1228 
1229  break;
1230  }
1231 
1232  // TODO for other verbosity levels
1233  // print the trigger menu, the prescale factors and the trigger mask, etc
1234 
1235 
1236  myCout << std::endl;
1237  myCout << "L1T-Report end!" << std::endl;
1238  myCout << std::endl;
1239 
1240  switch (m_printOutput) {
1241  case 0: {
1242 
1243  std::cout << myCout.str() << std::endl;
1244 
1245  }
1246 
1247  break;
1248  case 1: {
1249 
1250  LogTrace("L1GtTrigReport") << myCout.str() << std::endl;
1251 
1252  }
1253  break;
1254 
1255  case 2: {
1256 
1257  edm::LogVerbatim("L1GtTrigReport") << myCout.str() << std::endl;
1258 
1259  }
1260 
1261  break;
1262  case 3: {
1263 
1264  edm::LogInfo("L1GtTrigReport") << myCout.str();
1265 
1266  }
1267 
1268  break;
1269  default: {
1270  std::cout
1271  << "\n\n L1GtTrigReport: Error - no print output = " << m_printOutput
1272  << " defined! \n Check available values in the cfi file." << "\n" << std::endl;
1273 
1274  }
1275  break;
1276  }
1277 
1278 }
std::vector< int > m_globalNrErrors
global number of events with error (EDProduct[s] not found)
std::list< L1GtTrigReportEntry * >::const_iterator CItEntry
std::list< L1GtTrigReportEntry * > m_entryListTechTrig
list of individual entries in the report for technical triggers
unsigned int m_numberDaqPartitions
number of DAQ partitions
int m_printOutput
print output
int m_printVerbosity
print verbosity
std::list< L1GtTrigReportEntry * > m_entryList
list of individual entries in the report for physics algorithms
bool m_useL1GlobalTriggerRecord
boolean flag to select the input record
T sqrt(T t)
Definition: SSEVec.h:48
#define LogTrace(id)
std::vector< int > m_globalNrAccepts
global number of events accepted by any of the L1 algorithm in any menu
int m_totalEvents
counters
unsigned int m_physicsDaqPartition
index of physics DAQ partition
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

std::list<L1GtTrigReportEntry*> L1GtTrigReport::m_entryList
private

list of individual entries in the report for physics algorithms

Definition at line 142 of file L1GtTrigReport.h.

Referenced by analyze(), endJob(), L1GtTrigReport(), and ~L1GtTrigReport().

std::list<L1GtTrigReportEntry*> L1GtTrigReport::m_entryListTechTrig
private

list of individual entries in the report for technical triggers

Definition at line 145 of file L1GtTrigReport.h.

Referenced by analyze(), endJob(), L1GtTrigReport(), and ~L1GtTrigReport().

std::vector<int> L1GtTrigReport::m_globalNrAccepts
private

global number of events accepted by any of the L1 algorithm in any menu

Definition at line 139 of file L1GtTrigReport.h.

Referenced by analyze(), and endJob().

std::vector<int> L1GtTrigReport::m_globalNrErrors
private

global number of events with error (EDProduct[s] not found)

Definition at line 136 of file L1GtTrigReport.h.

Referenced by analyze(), and endJob().

const L1GtTriggerMenu* L1GtTrigReport::m_l1GtMenu
private

Definition at line 112 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtMenuCacheID
private

Definition at line 113 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtPrescaleFactors* L1GtTrigReport::m_l1GtPfAlgo
private

prescale factors

Definition at line 83 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtPfAlgoCacheID
private

Definition at line 84 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtPrescaleFactors* L1GtTrigReport::m_l1GtPfTech
private

Definition at line 86 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtPfTechCacheID
private

Definition at line 87 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

edm::InputTag L1GtTrigReport::m_l1GtRecordInputTag
private

input tag for GT record (L1 GT DAQ record or L1 GT "lite" record):

Definition at line 122 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtStableParameters* L1GtTrigReport::m_l1GtStablePar
private

cached stuff

stable parameters

Definition at line 69 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtStableParCacheID
private

Definition at line 70 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmAlgo
private

trigger masks & veto masks

Definition at line 93 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmAlgoCacheID
private

Definition at line 94 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmTech
private

Definition at line 96 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmTechCacheID
private

Definition at line 97 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmVetoAlgo
private

Definition at line 99 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmVetoAlgoCacheID
private

Definition at line 100 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmVetoTech
private

Definition at line 102 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmVetoTechCacheID
private

Definition at line 103 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

unsigned int L1GtTrigReport::m_numberDaqPartitions
private

number of DAQ partitions

Definition at line 79 of file L1GtTrigReport.h.

Referenced by analyze(), endJob(), and L1GtTrigReport().

unsigned int L1GtTrigReport::m_numberDaqPartitionsMax
private

Definition at line 80 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

unsigned int L1GtTrigReport::m_numberPhysTriggers
private

number of physics triggers

Definition at line 73 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

unsigned int L1GtTrigReport::m_numberTechnicalTriggers
private

number of technical triggers

Definition at line 76 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

unsigned int L1GtTrigReport::m_physicsDaqPartition
private

index of physics DAQ partition

Definition at line 151 of file L1GtTrigReport.h.

Referenced by analyze(), endJob(), and L1GtTrigReport().

const std::vector<std::vector<int> >* L1GtTrigReport::m_prescaleFactorsAlgoTrig
private

Definition at line 89 of file L1GtTrigReport.h.

Referenced by analyze().

const std::vector<std::vector<int> >* L1GtTrigReport::m_prescaleFactorsTechTrig
private

Definition at line 90 of file L1GtTrigReport.h.

Referenced by analyze().

int L1GtTrigReport::m_printOutput
private

print output

Definition at line 128 of file L1GtTrigReport.h.

Referenced by endJob(), and L1GtTrigReport().

int L1GtTrigReport::m_printVerbosity
private

print verbosity

Definition at line 125 of file L1GtTrigReport.h.

Referenced by endJob(), and L1GtTrigReport().

int L1GtTrigReport::m_totalEvents
private

counters

global number of events processed

Definition at line 133 of file L1GtTrigReport.h.

Referenced by analyze(), endJob(), and L1GtTrigReport().

std::vector<unsigned int> L1GtTrigReport::m_triggerMaskAlgoTrig
private

Definition at line 105 of file L1GtTrigReport.h.

Referenced by analyze().

std::vector<unsigned int> L1GtTrigReport::m_triggerMaskTechTrig
private

Definition at line 106 of file L1GtTrigReport.h.

Referenced by analyze().

std::vector<unsigned int> L1GtTrigReport::m_triggerMaskVetoAlgoTrig
private

Definition at line 108 of file L1GtTrigReport.h.

Referenced by analyze().

std::vector<unsigned int> L1GtTrigReport::m_triggerMaskVetoTechTrig
private

Definition at line 109 of file L1GtTrigReport.h.

Referenced by analyze().

bool L1GtTrigReport::m_useL1GlobalTriggerRecord
private

boolean flag to select the input record

Definition at line 119 of file L1GtTrigReport.h.

Referenced by analyze(), endJob(), and L1GtTrigReport().