test
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::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1GtTrigReport (const edm::ParameterSet &)
 constructor More...
 
virtual ~L1GtTrigReport ()
 destructor More...
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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
 
const edm::InputTag m_l1GtRecordInputTag
 input tag for GT record (L1 GT DAQ record or L1 GT "lite" record): More...
 
const edm::EDGetTokenT
< L1GlobalTriggerRecord
m_l1GtRecordInputToken1
 
const edm::EDGetTokenT
< L1GlobalTriggerReadoutRecord
m_l1GtRecordInputToken2
 
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...
 
const 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
 
const int m_printOutput
 print output More...
 
const 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
 
const bool m_useL1GlobalTriggerRecord
 boolean flag to select the input record More...
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 45 of file L1GtTrigReport.h.

Member Typedef Documentation

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

Definition at line 152 of file L1GtTrigReport.h.

Definition at line 153 of file L1GtTrigReport.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 68 of file L1GtTrigReport.cc.

References edm::InputTag::label(), LogDebug, m_l1GtRecordInputTag, m_printOutput, m_printVerbosity, and m_useL1GlobalTriggerRecord.

68  :
69 
70  // initialize cached IDs
71 
72  //
73  m_l1GtStableParCacheID( 0ULL ),
74 
79 
80  //
81  m_l1GtPfAlgoCacheID( 0ULL ),
82  m_l1GtPfTechCacheID( 0ULL ),
83 
84  m_l1GtTmAlgoCacheID( 0ULL ),
85  m_l1GtTmTechCacheID( 0ULL ),
86 
89 
90  //
91  m_l1GtMenuCacheID( 0ULL ),
92 
93  // boolean flag to select the input record
94  // if true, it will use L1GlobalTriggerRecord
95  m_useL1GlobalTriggerRecord( pSet.getParameter<bool>("UseL1GlobalTriggerRecord") ),
96 
98  m_l1GtRecordInputTag( pSet.getParameter<edm::InputTag>("L1GtRecordInputTag") ),
100  ? consumes<L1GlobalTriggerRecord>(m_l1GtRecordInputTag)
103  ? consumes<L1GlobalTriggerReadoutRecord>(m_l1GtRecordInputTag)
105 
106  // print verbosity
107  m_printVerbosity( pSet.getUntrackedParameter<int>("PrintVerbosity", 2) ),
108 
109  // print output
110  m_printOutput( pSet.getUntrackedParameter<int>("PrintOutput", 3) ),
111 
112  // initialize global counters
113 
114  // number of events processed
115  m_totalEvents( 0 ),
116 
117  //
118  m_entryList(),
120 
121  // set the index of physics DAQ partition TODO input parameter?
123 
124 {
125  LogDebug("L1GtTrigReport") << "\n Use L1GlobalTriggerRecord: " << m_useL1GlobalTriggerRecord
126  << "\n (if false: L1GtTrigReport uses L1GlobalTriggerReadoutRecord.)"
127  << "\n Input tag for L1 GT record: " << m_l1GtRecordInputTag.label() << " \n"
128  << "\n Print verbosity level: " << m_printVerbosity << " \n"
129  << "\n Print output: " << m_printOutput << " \n" << std::endl;
130 
131 }
#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
const edm::InputTag m_l1GtRecordInputTag
input tag for GT record (L1 GT DAQ record or L1 GT &quot;lite&quot; record):
unsigned int m_numberDaqPartitions
number of DAQ partitions
unsigned long long m_l1GtStableParCacheID
const unsigned int m_physicsDaqPartition
index of physics DAQ partition
unsigned long long m_l1GtPfTechCacheID
unsigned int m_numberDaqPartitionsMax
std::list< L1GtTrigReportEntry * > m_entryList
list of individual entries in the report for physics algorithms
const int m_printVerbosity
print verbosity
const int m_printOutput
print output
unsigned long long m_l1GtPfAlgoCacheID
const bool m_useL1GlobalTriggerRecord
boolean flag to select the input record
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
const edm::EDGetTokenT< L1GlobalTriggerRecord > m_l1GtRecordInputToken1
std::string const & label() const
Definition: InputTag.h:36
unsigned int m_numberPhysTriggers
number of physics triggers
const edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtRecordInputToken2
unsigned long long m_l1GtTmVetoAlgoCacheID
L1GtTrigReport::~L1GtTrigReport ( )
virtual

destructor

Definition at line 134 of file L1GtTrigReport.cc.

References m_entryList, and m_entryListTechTrig.

134  {
135 
136  for (ItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
137  if (*itEntry != 0) {
138  delete *itEntry;
139  *itEntry = 0;
140  }
141  }
142 
143  m_entryList.clear();
144 
145  for (ItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
146  if (*itEntry != 0) {
147  delete *itEntry;
148  *itEntry = 0;
149  }
150  }
151 
152  m_entryListTechTrig.clear();
153 
154 }
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::one::EDAnalyzerBase.

Definition at line 167 of file L1GtTrigReport.cc.

References L1GtTrigReportEntry::addErrorEntry(), L1GtTrigReportEntry::addValidEntry(), edm::EventSetup::get(), edm::Event::getByToken(), 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_l1GtRecordInputToken1, m_l1GtRecordInputToken2, 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.

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

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 160 of file L1GtTrigReport.cc.

160  {
161 
162  // empty
163 
164 }
void L1GtTrigReport::endJob ( void  )
privatevirtual

end of job

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 693 of file L1GtTrigReport.cc.

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

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

Member Data Documentation

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

list of individual entries in the report for physics algorithms

Definition at line 147 of file L1GtTrigReport.h.

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

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

list of individual entries in the report for technical triggers

Definition at line 150 of file L1GtTrigReport.h.

Referenced by analyze(), endJob(), 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 144 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 141 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().

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().

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().

const 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 edm::EDGetTokenT<L1GlobalTriggerRecord> L1GtTrigReport::m_l1GtRecordInputToken1
private

Definition at line 126 of file L1GtTrigReport.h.

Referenced by analyze().

const edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> L1GtTrigReport::m_l1GtRecordInputToken2
private

Definition at line 127 of file L1GtTrigReport.h.

Referenced by analyze().

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().

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().

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().

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().

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().

unsigned int L1GtTrigReport::m_numberDaqPartitions
private

number of DAQ partitions

Definition at line 81 of file L1GtTrigReport.h.

Referenced by analyze(), and endJob().

unsigned int L1GtTrigReport::m_numberDaqPartitionsMax
private

Definition at line 82 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned int L1GtTrigReport::m_numberPhysTriggers
private

number of physics triggers

Definition at line 75 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned int L1GtTrigReport::m_numberTechnicalTriggers
private

number of technical triggers

Definition at line 78 of file L1GtTrigReport.h.

Referenced by analyze().

const unsigned int L1GtTrigReport::m_physicsDaqPartition
private

index of physics DAQ partition

Definition at line 156 of file L1GtTrigReport.h.

Referenced by analyze(), and endJob().

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().

const int L1GtTrigReport::m_printOutput
private

print output

Definition at line 133 of file L1GtTrigReport.h.

Referenced by endJob(), and L1GtTrigReport().

const int L1GtTrigReport::m_printVerbosity
private

print verbosity

Definition at line 130 of file L1GtTrigReport.h.

Referenced by endJob(), and L1GtTrigReport().

int L1GtTrigReport::m_totalEvents
private

counters

global number of events processed

Definition at line 138 of file L1GtTrigReport.h.

Referenced by analyze(), and endJob().

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().

const 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().