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

Public Member Functions

 L1GtTrigReport (const edm::ParameterSet &)
 constructor More...
 
virtual ~L1GtTrigReport ()
 destructor More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: L1 Trigger report.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 45 of file L1GtTrigReport.h.

Member Typedef Documentation

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

Definition at line 149 of file L1GtTrigReport.h.

Definition at line 150 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 72 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.

72  {
73 
74  // boolean flag to select the input record
75  // if true, it will use L1GlobalTriggerRecord
76  m_useL1GlobalTriggerRecord = pSet.getParameter<bool>("UseL1GlobalTriggerRecord");
77 
79  m_l1GtRecordInputTag = pSet.getParameter<edm::InputTag>("L1GtRecordInputTag");
80 
81  // print verbosity
82  m_printVerbosity = pSet.getUntrackedParameter<int>("PrintVerbosity", 2);
83 
84  // print output
85  m_printOutput = pSet.getUntrackedParameter<int>("PrintOutput", 3);
86 
87  LogDebug("L1GtTrigReport") << "\n Use L1GlobalTriggerRecord: " << m_useL1GlobalTriggerRecord
88  << "\n (if false: L1GtTrigReport uses L1GlobalTriggerReadoutRecord.)"
89  << "\n Input tag for L1 GT record: " << m_l1GtRecordInputTag.label() << " \n"
90  << "\n Print verbosity level: " << m_printVerbosity << " \n"
91  << "\n Print output: " << m_printOutput << " \n" << std::endl;
92 
93  // initialize cached IDs
94 
95  //
97 
102 
103  //
104  m_l1GtPfAlgoCacheID = 0ULL;
105  m_l1GtPfTechCacheID = 0ULL;
106 
107  m_l1GtTmAlgoCacheID = 0ULL;
108  m_l1GtTmTechCacheID = 0ULL;
109 
112 
113  //
114  m_l1GtMenuCacheID = 0ULL;
115 
116  // initialize global counters
117 
118  // number of events processed
119  m_totalEvents = 0;
120 
121  //
122  m_entryList.clear();
123  m_entryListTechTrig.clear();
124 
125  // set the index of physics DAQ partition TODO input parameter?
127 
128 }
#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 131 of file L1GtTrigReport.cc.

References m_entryList, and m_entryListTechTrig.

131  {
132 
133  for (ItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
134  if (*itEntry != 0) {
135  delete *itEntry;
136  *itEntry = 0;
137  }
138  }
139 
140  m_entryList.clear();
141 
142  for (ItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
143  if (*itEntry != 0) {
144  delete *itEntry;
145  *itEntry = 0;
146  }
147  }
148 
149  m_entryListTechTrig.clear();
150 
151 }
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 164 of file L1GtTrigReport.cc.

References L1GtTrigReportEntry::addErrorEntry(), L1GtTrigReportEntry::addValidEntry(), edm::EventSetup::get(), edm::Event::getByLabel(), L1GtTriggerMenu::gtAlgorithmMap(), L1GtStableParameters::gtNumberPhysTriggers(), L1GtStableParameters::gtNumberTechnicalTriggers(), L1GtPrescaleFactors::gtPrescaleFactors(), 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, and edm::ESHandle< class >::product().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 157 of file L1GtTrigReport.cc.

157  {
158 
159  // empty
160 
161 }
void L1GtTrigReport::endJob ( void  )
privatevirtual

end of job

Reimplemented from edm::EDAnalyzer.

Definition at line 691 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().

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

Member Data Documentation

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

list of individual entries in the report for physics algorithms

Definition at line 144 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 147 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 141 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 138 of file L1GtTrigReport.h.

Referenced by analyze(), and endJob().

const L1GtTriggerMenu* L1GtTrigReport::m_l1GtMenu
private

Definition at line 114 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtMenuCacheID
private

Definition at line 115 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtPrescaleFactors* L1GtTrigReport::m_l1GtPfAlgo
private

prescale factors

Definition at line 85 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtPfAlgoCacheID
private

Definition at line 86 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtPrescaleFactors* L1GtTrigReport::m_l1GtPfTech
private

Definition at line 88 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtPfTechCacheID
private

Definition at line 89 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 124 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtStableParameters* L1GtTrigReport::m_l1GtStablePar
private

cached stuff

stable parameters

Definition at line 71 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtStableParCacheID
private

Definition at line 72 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmAlgo
private

trigger masks & veto masks

Definition at line 95 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmAlgoCacheID
private

Definition at line 96 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmTech
private

Definition at line 98 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmTechCacheID
private

Definition at line 99 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmVetoAlgo
private

Definition at line 101 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmVetoAlgoCacheID
private

Definition at line 102 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmVetoTech
private

Definition at line 104 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmVetoTechCacheID
private

Definition at line 105 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

unsigned int L1GtTrigReport::m_numberDaqPartitions
private

number of DAQ partitions

Definition at line 81 of file L1GtTrigReport.h.

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

unsigned int L1GtTrigReport::m_numberDaqPartitionsMax
private

Definition at line 82 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

unsigned int L1GtTrigReport::m_numberPhysTriggers
private

number of physics triggers

Definition at line 75 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

unsigned int L1GtTrigReport::m_numberTechnicalTriggers
private

number of technical triggers

Definition at line 78 of file L1GtTrigReport.h.

Referenced by analyze(), and L1GtTrigReport().

unsigned int L1GtTrigReport::m_physicsDaqPartition
private

index of physics DAQ partition

Definition at line 153 of file L1GtTrigReport.h.

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

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

Definition at line 91 of file L1GtTrigReport.h.

Referenced by analyze().

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

Definition at line 92 of file L1GtTrigReport.h.

Referenced by analyze().

int L1GtTrigReport::m_printOutput
private

print output

Definition at line 130 of file L1GtTrigReport.h.

Referenced by endJob(), and L1GtTrigReport().

int L1GtTrigReport::m_printVerbosity
private

print verbosity

Definition at line 127 of file L1GtTrigReport.h.

Referenced by endJob(), and L1GtTrigReport().

int L1GtTrigReport::m_totalEvents
private

counters

global number of events processed

Definition at line 135 of file L1GtTrigReport.h.

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

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

Definition at line 107 of file L1GtTrigReport.h.

Referenced by analyze().

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

Definition at line 108 of file L1GtTrigReport.h.

Referenced by analyze().

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

Definition at line 110 of file L1GtTrigReport.h.

Referenced by analyze().

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

Definition at line 111 of file L1GtTrigReport.h.

Referenced by analyze().

bool L1GtTrigReport::m_useL1GlobalTriggerRecord
private

boolean flag to select the input record

Definition at line 121 of file L1GtTrigReport.h.

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