CMS 3D CMS Logo

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...
 
 ~L1GtTrigReport () override
 destructor More...
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

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

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 analyze each event More...
 
void beginJob () override
 
void endJob () override
 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< L1GlobalTriggerRecordm_l1GtRecordInputToken1
 
const edm::EDGetTokenT< L1GlobalTriggerReadoutRecordm_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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 44 of file L1GtTrigReport.h.

Member Typedef Documentation

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

Definition at line 144 of file L1GtTrigReport.h.

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

69  :
70 
71  // initialize cached IDs
72 
73  //
75 
80 
81  //
82  m_l1GtPfAlgoCacheID(0ULL),
83  m_l1GtPfTechCacheID(0ULL),
84 
85  m_l1GtTmAlgoCacheID(0ULL),
86  m_l1GtTmTechCacheID(0ULL),
87 
90 
91  //
92  m_l1GtMenuCacheID(0ULL),
93 
94  // boolean flag to select the input record
95  // if true, it will use L1GlobalTriggerRecord
96  m_useL1GlobalTriggerRecord(pSet.getParameter<bool>("UseL1GlobalTriggerRecord")),
97 
99  m_l1GtRecordInputTag(pSet.getParameter<edm::InputTag>("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"
130  << std::endl;
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 "lite" 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 ( )
override

destructor

Definition at line 134 of file L1GtTrigReport.cc.

References m_entryList, and m_entryListTechTrig.

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

analyze each event

Definition at line 162 of file L1GtTrigReport.cc.

References L1GtTrigReportEntry::addErrorEntry(), L1GtTrigReportEntry::addValidEntry(), L1GlobalTriggerRecord::decision(), L1GlobalTriggerRecord::decisionWord(), L1GlobalTriggerReadoutRecord::decisionWord(), L1GlobalTriggerRecord::decisionWordBeforeMask(), L1GlobalTriggerReadoutRecord::finalOR(), edm::EventSetup::get(), edm::Event::getByToken(), L1GtTriggerMenu::gtAlgorithmMap(), L1GlobalTriggerReadoutRecord::gtFdlVector(), L1GlobalTriggerReadoutRecord::gtFdlWord(), L1GtStableParameters::gtNumberPhysTriggers(), L1GtStableParameters::gtNumberTechnicalTriggers(), L1GlobalTriggerRecord::gtPrescaleFactorIndexAlgo(), L1GlobalTriggerRecord::gtPrescaleFactorIndexTech(), 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, Skims_PDWG_cff::prescaleFactor, edm::ESHandle< T >::product(), AlCaHLTBitMon_QueryRunRegistry::string, L1GlobalTriggerRecord::technicalTriggerWord(), L1GlobalTriggerReadoutRecord::technicalTriggerWord(), and L1GlobalTriggerRecord::technicalTriggerWordBeforeMask().

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

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 157 of file L1GtTrigReport.cc.

157  {
158  // empty
159 }
void L1GtTrigReport::endJob ( void  )
overrideprivatevirtual

end of job

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 619 of file L1GtTrigReport.cc.

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

619  {
620  // define an output stream to print into
621  // it can then be directed to whatever log level is desired
622  std::ostringstream myCout;
623 
624  myCout << std::dec << std::endl;
625  myCout << "L1T-Report "
626  << "---------- Event Summary ----------\n";
627  myCout << "L1T-Report "
628  << "Total number of events processed: " << m_totalEvents << "\n";
629  myCout << "L1T-Report\n";
630 
631  myCout << "\n"
632  << " DAQ partition "
633  << " Total "
634  << " Passed[finalOR] "
635  << " Rejected "
636  << " Errors "
637  << "\n"
638  << std::endl;
639 
640  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
641  int rejectedEvents = m_totalEvents - m_globalNrErrors[iDaqPartition] - m_globalNrAccepts[iDaqPartition];
642 
643  if (m_useL1GlobalTriggerRecord && (iDaqPartition != m_physicsDaqPartition)) {
644  continue;
645  } else {
646  myCout << std::right << std::setw(16) << iDaqPartition << " " << std::right << std::setw(16) << m_totalEvents
647  << " " << std::right << std::setw(16) << m_globalNrAccepts[iDaqPartition] << " " << std::right
648  << std::setw(16) << rejectedEvents << " " << std::right << std::setw(16) << m_globalNrErrors[iDaqPartition]
649  << std::endl;
650  }
651  }
652 
653  // get the list of menus for the sample analyzed
654  //
655  std::set<std::string> menuList;
656  typedef std::set<std::string>::const_iterator CItL1Menu;
657 
658  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
659  menuList.insert((*itEntry)->gtTriggerMenuName());
660  }
661 
662  myCout << "\nThe following L1 menus were used for this sample: " << std::endl;
663  for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
664  myCout << " " << (*itMenu) << std::endl;
665  }
666  myCout << "\n" << std::endl;
667 
668  switch (m_printVerbosity) {
669  case 0: {
670  myCout << "\nL1T-Report "
671  << "---------- L1 Trigger Global Summary - DAQ Partition " << m_physicsDaqPartition << "----------\n\n";
672 
673  myCout << "\n\n Number of events written after applying L1 prescale factors"
674  << " and trigger masks\n"
675  << " if not explicitly mentioned.\n\n";
676 
677  for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
678  myCout << "\nReport for L1 menu: " << (*itMenu) << "\n" << std::endl;
679 
680  myCout << std::right << std::setw(45) << "Algorithm Key"
681  << " " << std::right << std::setw(10) << "Passed"
682  << " " << std::right << std::setw(10) << "Rejected"
683  << " " << std::right << std::setw(10) << "Error"
684  << "\n";
685 
686  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
687  if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition) && ((*itEntry)->gtTriggerMenuName() == *itMenu)) {
688  myCout << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " " << std::right << std::setw(10)
689  << (*itEntry)->gtNrEventsAccept() << " " << std::right << std::setw(10)
690  << (*itEntry)->gtNrEventsReject() << " " << std::right << std::setw(10)
691  << (*itEntry)->gtNrEventsError() << "\n";
692  }
693  }
694 
695  myCout << "\n\n"
696  << std::right << std::setw(45) << "Technical Trigger Key"
697  << " " << std::right << std::setw(10) << "Passed"
698  << " " << std::right << std::setw(10) << "Rejected"
699  << " " << std::right << std::setw(10) << "Error"
700  << "\n";
701 
702  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
703  if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition) && ((*itEntry)->gtTriggerMenuName() == *itMenu)) {
704  myCout << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " " << std::right << std::setw(10)
705  << (*itEntry)->gtNrEventsAccept() << " " << std::right << std::setw(10)
706  << (*itEntry)->gtNrEventsReject() << " " << std::right << std::setw(10)
707  << (*itEntry)->gtNrEventsError() << "\n";
708  }
709  }
710  }
711 
712  }
713 
714  break;
715  case 1: {
716  myCout << "\nL1T-Report "
717  << "---------- L1 Trigger Global Summary - DAQ Partition " << m_physicsDaqPartition << "----------\n\n";
718 
719  myCout << "\n\n Number of events written after applying L1 prescale factors"
720  << " and trigger masks\n"
721  << " if not explicitly mentioned.\n\n";
722 
723  for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
724  myCout << "\nReport for L1 menu: " << (*itMenu) << "\n" << std::endl;
725  myCout << std::right << std::setw(45) << "Algorithm Key"
726  << " " << std::right << std::setw(10) << "Prescale"
727  << " " << std::right << std::setw(5) << "Mask"
728  << " " << std::right << std::setw(10) << "Passed"
729  << " " << std::right << std::setw(10) << "Rejected"
730  << " " << std::right << std::setw(10) << "Error" << std::setw(2) << " "
731  << "\n";
732 
733  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
734  if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition) && ((*itEntry)->gtTriggerMenuName() == *itMenu)) {
735  myCout << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " " << std::right << std::setw(10)
736  << (*itEntry)->gtPrescaleFactor() << " " << std::right << std::setw(2) //<< std::setfill('0')
737  << std::hex << (*itEntry)->gtTriggerMask() //<< std::setfill(' ')
738  << std::dec << " " << std::right << std::setw(10) << (*itEntry)->gtNrEventsAccept() << " "
739  << std::right << std::setw(10) << (*itEntry)->gtNrEventsReject() << " " << std::right
740  << std::setw(10) << (*itEntry)->gtNrEventsError() << std::setw(2) << " "
741  << "\n";
742  }
743  }
744 
745  myCout << "\n\n"
746  << std::right << std::setw(45) << "Technical Trigger Key"
747  << " " << std::right << std::setw(10) << "Prescale"
748  << " " << std::right << std::setw(5) << "Mask"
749  << " " << std::right << std::setw(10) << "Passed"
750  << " " << std::right << std::setw(10) << "Rejected"
751  << " " << std::right << std::setw(10) << "Error" << std::setw(2) << " "
752  << "\n";
753 
754  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
755  if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition) && ((*itEntry)->gtTriggerMenuName() == *itMenu)) {
756  myCout << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " " << std::right << std::setw(10)
757  << (*itEntry)->gtPrescaleFactor() << " " << std::right << std::setw(2) //<< std::setfill('0')
758  << std::hex << (*itEntry)->gtTriggerMask() //<< std::setfill(' ')
759  << std::dec << " " << std::right << std::setw(10) << (*itEntry)->gtNrEventsAccept() << " "
760  << std::right << std::setw(10) << (*itEntry)->gtNrEventsReject() << " " << std::right
761  << std::setw(10) << (*itEntry)->gtNrEventsError() << std::setw(2) << " "
762  << "\n";
763  }
764  }
765  }
766 
767  }
768 
769  break;
770  case 2: {
771  for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
772  myCout << "\nReport for L1 menu: " << (*itMenu) << "\n" << std::endl;
773 
774  myCout << std::right << std::setw(45) << "Algorithm Key"
775  << " " << std::right << std::setw(10) << "Passed"
776  << " " << std::right << std::setw(10) << "Rejected"
777  << " " << std::right << std::setw(10) << "Error"
778  << "\n";
779 
780  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
781  if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition) && ((*itEntry)->gtTriggerMenuName() == *itMenu)) {
782  int nrEventsAccept = (*itEntry)->gtNrEventsAccept();
783  int nrEventsReject = (*itEntry)->gtNrEventsReject();
784  int nrEventsError = (*itEntry)->gtNrEventsError();
785 
786  myCout << std::right << std::setw(45) << ((*itEntry)->gtAlgoName()) << " " << std::right << std::setw(10)
787  << nrEventsAccept << " " << std::right << std::setw(10) << nrEventsReject << " " << std::right
788  << std::setw(10) << nrEventsError << "\n";
789  }
790  }
791 
792  // efficiency and its statistical error
793 
794  myCout << "\n\n"
795  << std::right << std::setw(45) << "Algorithm Key"
796  << " " << std::right << std::setw(10) << "Efficiency "
797  << " " << std::right << std::setw(10) << "Stat error (%)"
798  << "\n";
799 
800  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
801  if (((*itEntry)->gtDaqPartition() == 0) && ((*itEntry)->gtTriggerMenuName() == *itMenu)) {
802  int nrEventsAccept = (*itEntry)->gtNrEventsAccept();
803  int nrEventsReject = (*itEntry)->gtNrEventsReject();
804  int nrEventsError = (*itEntry)->gtNrEventsError();
805 
806  int totalEvents = nrEventsAccept + nrEventsReject + nrEventsError;
807 
808  // efficiency and their statistical error
809  float eff = 0.;
810  float statErrEff = 0.;
811 
812  if (totalEvents != 0) {
813  eff = static_cast<float>(nrEventsAccept) / static_cast<float>(totalEvents);
814  statErrEff = sqrt(eff * (1.0 - eff) / static_cast<float>(totalEvents));
815  }
816 
817  myCout << std::right << std::setw(45) << ((*itEntry)->gtAlgoName()) << " " << std::right << std::setw(10)
818  << std::fixed << std::setprecision(2) << 100. * eff << " +- " << std::right << std::setw(10)
819  << std::setprecision(2) << 100. * statErrEff << "\n";
820  }
821  }
822 
823  myCout << "\n\n"
824  << std::right << std::setw(45) << "Technical Trigger Key"
825  << " " << std::right << std::setw(10) << "Passed"
826  << " " << std::right << std::setw(10) << "Rejected"
827  << " " << std::right << std::setw(10) << "Error"
828  << "\n";
829 
830  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
831  if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition) && ((*itEntry)->gtTriggerMenuName() == *itMenu)) {
832  int nrEventsAccept = (*itEntry)->gtNrEventsAccept();
833  int nrEventsReject = (*itEntry)->gtNrEventsReject();
834  int nrEventsError = (*itEntry)->gtNrEventsError();
835 
836  myCout << std::right << std::setw(45) << ((*itEntry)->gtAlgoName()) << " " << std::right << std::setw(10)
837  << nrEventsAccept << " " << std::right << std::setw(10) << nrEventsReject << " " << std::right
838  << std::setw(10) << nrEventsError << "\n";
839  }
840  }
841 
842  // efficiency and its statistical error
843 
844  myCout << "\n\n"
845  << std::right << std::setw(45) << "Technical Trigger Key"
846  << " " << std::right << std::setw(10) << "Efficiency "
847  << " " << std::right << std::setw(10) << "Stat error (%)"
848  << "\n";
849 
850  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
851  if (((*itEntry)->gtDaqPartition() == 0) && ((*itEntry)->gtTriggerMenuName() == *itMenu)) {
852  int nrEventsAccept = (*itEntry)->gtNrEventsAccept();
853  int nrEventsReject = (*itEntry)->gtNrEventsReject();
854  int nrEventsError = (*itEntry)->gtNrEventsError();
855 
856  int totalEvents = nrEventsAccept + nrEventsReject + nrEventsError;
857 
858  // efficiency and their statistical error
859  float eff = 0.;
860  float statErrEff = 0.;
861 
862  if (totalEvents != 0) {
863  eff = static_cast<float>(nrEventsAccept) / static_cast<float>(totalEvents);
864  statErrEff = sqrt(eff * (1.0 - eff) / static_cast<float>(totalEvents));
865  }
866 
867  myCout << std::right << std::setw(45) << ((*itEntry)->gtAlgoName()) << " " << std::right << std::setw(10)
868  << std::fixed << std::setprecision(2) << 100. * eff << " +- " << std::right << std::setw(10)
869  << std::setprecision(2) << 100. * statErrEff << "\n";
870  }
871  }
872  }
873 
874  } break;
875 
876  case 10: {
877  myCout << "\nL1T-Report "
878  << "---------- L1 Trigger Global Summary - DAQ Partition " << m_physicsDaqPartition << "----------\n\n";
879 
880  for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
881  myCout << "\nReport for L1 menu: " << (*itMenu) << "\n" << std::endl;
882  myCout << std::right << std::setw(45) << "Algorithm Key"
883  << " " << std::right << std::setw(10) << "Prescale"
884  << " " << std::right << std::setw(5) << "Mask"
885  << " " << std::right << std::setw(25) << "Before Mask"
886  << " " << std::right << std::setw(30) << "After Mask"
887  << " " << std::right << std::setw(22) << "Error"
888  << "\n"
889  << std::right << std::setw(64) << " " << std::setw(15) << "Passed" << std::right << std::setw(1) << " "
890  << std::setw(15) << "Rejected" << std::right << std::setw(1) << " " << std::setw(15) << "Passed"
891  << std::right << std::setw(1) << " " << std::setw(15) << "Rejected"
892  << "\n";
893 
894  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
895  if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition) && ((*itEntry)->gtTriggerMenuName() == *itMenu)) {
896  myCout << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " " << std::right << std::setw(10)
897  << (*itEntry)->gtPrescaleFactor() << " " << std::right << std::setw(5) << " " << std::hex
898  << (*itEntry)->gtTriggerMask() << std::dec << " " << std::right << std::setw(15)
899  << (*itEntry)->gtNrEventsAcceptBeforeMask() << " " << std::right << std::setw(15)
900  << (*itEntry)->gtNrEventsRejectBeforeMask() << " " << std::right << std::setw(15)
901  << (*itEntry)->gtNrEventsAccept() << " " << std::right << std::setw(15)
902  << (*itEntry)->gtNrEventsReject() << " " << std::right << std::setw(15)
903  << (*itEntry)->gtNrEventsError() << "\n";
904  }
905  }
906 
907  myCout << "\n\n"
908  << std::right << std::setw(45) << "Technical Trigger Key"
909  << " " << std::right << std::setw(10) << "Prescale"
910  << " " << std::right << std::setw(5) << "Mask"
911  << " " << std::right << std::setw(25) << "Before Mask"
912  << " " << std::right << std::setw(30) << "After Mask"
913  << " " << std::right << std::setw(22) << "Error"
914  << "\n"
915  << std::right << std::setw(64) << " " << std::setw(15) << "Passed" << std::right << std::setw(1) << " "
916  << std::setw(15) << "Rejected" << std::right << std::setw(1) << " " << std::setw(15) << "Passed"
917  << std::right << std::setw(1) << " " << std::setw(15) << "Rejected"
918  << "\n";
919 
920  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
921  if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition) && ((*itEntry)->gtTriggerMenuName() == *itMenu)) {
922  myCout << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " " << std::right << std::setw(10)
923  << (*itEntry)->gtPrescaleFactor() << " " << std::right << std::setw(5) << " " << std::hex
924  << (*itEntry)->gtTriggerMask() << std::dec << " " << std::right << std::setw(15)
925  << (*itEntry)->gtNrEventsAcceptBeforeMask() << " " << std::right << std::setw(15)
926  << (*itEntry)->gtNrEventsRejectBeforeMask() << " " << std::right << std::setw(15)
927  << (*itEntry)->gtNrEventsAccept() << " " << std::right << std::setw(15)
928  << (*itEntry)->gtNrEventsReject() << " " << std::right << std::setw(15)
929  << (*itEntry)->gtNrEventsError() << "\n";
930  }
931  }
932  }
933  }
934 
935  break;
936  case 100: {
937  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
938  myCout << "\nL1T-Report "
939  << "---------- L1 Trigger Global Summary - DAQ Partition " << iDaqPartition << " "
940  << "----------\n\n";
941 
942  myCout << std::right << std::setw(45) << "Algorithm Key"
943  << " " << std::right << std::setw(10) << "Passed"
944  << " " << std::right << std::setw(10) << "Rejected"
945  << " " << std::right << std::setw(10) << "Error" << std::setw(2) << " "
946  << "\n";
947 
948  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
949  if (((*itEntry)->gtDaqPartition() == 0)) {
950  myCout << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " " << std::right << std::setw(10)
951  << (*itEntry)->gtNrEventsAccept() << " " << std::right << std::setw(10)
952  << (*itEntry)->gtNrEventsReject() << " " << std::right << std::setw(10)
953  << (*itEntry)->gtNrEventsError() << std::setw(2) << " "
954  << "\n";
955  }
956  }
957 
958  myCout << "\n\n"
959  << std::right << std::setw(45) << "Technical Trigger Key"
960  << " " << std::right << std::setw(10) << "Passed"
961  << " " << std::right << std::setw(10) << "Rejected"
962  << " " << std::right << std::setw(10) << "Error" << std::setw(2) << " "
963  << "\n";
964 
965  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
966  if ((*itEntry)->gtDaqPartition() == 0) {
967  myCout << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " " << std::right << std::setw(10)
968  << (*itEntry)->gtNrEventsAccept() << " " << std::right << std::setw(10)
969  << (*itEntry)->gtNrEventsReject() << " " << std::right << std::setw(10)
970  << (*itEntry)->gtNrEventsError() << std::setw(2) << " " << std::right << std::setw(20)
971  << (*itEntry)->gtTriggerMenuName() << "\n";
972  }
973  }
974  }
975  }
976 
977  break;
978  case 101: {
979  for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
980  myCout << "\nL1T-Report "
981  << "---------- L1 Trigger Global Summary - DAQ Partition " << iDaqPartition << " "
982  << "----------\n\n";
983 
984  myCout << std::right << std::setw(45) << "Algorithm Key"
985  << " " << std::right << std::setw(10) << "Prescale"
986  << " " << std::right << std::setw(5) << "Mask"
987  << " " << std::right << std::setw(10) << "Passed"
988  << " " << std::right << std::setw(10) << "Rejected"
989  << " " << std::right << std::setw(10) << "Error" << std::setw(2) << " "
990  << "\n";
991 
992  for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
993  if ((*itEntry)->gtDaqPartition() == 0) {
994  myCout << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " " << std::right << std::setw(10)
995  << (*itEntry)->gtPrescaleFactor() << " " << std::right << std::setw(2) //<< std::setfill('0')
996  << std::hex << (*itEntry)->gtTriggerMask() //<< std::setfill(' ')
997  << std::dec << " " << std::right << std::setw(10) << (*itEntry)->gtNrEventsAccept() << " "
998  << std::right << std::setw(10) << (*itEntry)->gtNrEventsReject() << " " << std::right
999  << std::setw(10) << (*itEntry)->gtNrEventsError() << std::setw(2) << " "
1000  << "\n";
1001  }
1002  }
1003 
1004  myCout << "\n\n"
1005  << std::right << std::setw(45) << "Technical Trigger Key"
1006  << " " << std::right << std::setw(10) << "Prescale"
1007  << " " << std::right << std::setw(5) << "Mask"
1008  << " " << std::right << std::setw(10) << "Passed"
1009  << " " << std::right << std::setw(10) << "Rejected"
1010  << " " << std::right << std::setw(10) << "Error" << std::setw(2) << " "
1011  << "\n";
1012 
1013  for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
1014  if ((*itEntry)->gtDaqPartition() == 0) {
1015  myCout << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " " << std::right << std::setw(10)
1016  << (*itEntry)->gtPrescaleFactor() << " " << std::right << std::setw(2) //<< std::setfill('0')
1017  << std::hex << (*itEntry)->gtTriggerMask() //<< std::setfill(' ')
1018  << std::dec << " " << std::right << std::setw(10) << (*itEntry)->gtNrEventsAccept() << " "
1019  << std::right << std::setw(10) << (*itEntry)->gtNrEventsReject() << " " << std::right
1020  << std::setw(10) << (*itEntry)->gtNrEventsError() << std::setw(2) << " "
1021  << "\n";
1022  }
1023  }
1024  }
1025  }
1026 
1027  break;
1028  default: {
1029  myCout << "\n\nL1GtTrigReport: Error - no print verbosity level = " << m_printVerbosity
1030  << " defined! \nCheck available values in the cfi file."
1031  << "\n";
1032  }
1033 
1034  break;
1035  }
1036 
1037  // TODO for other verbosity levels
1038  // print the trigger menu, the prescale factors and the trigger mask, etc
1039 
1040  myCout << std::endl;
1041  myCout << "L1T-Report end!" << std::endl;
1042  myCout << std::endl;
1043 
1044  switch (m_printOutput) {
1045  case 0: {
1046  std::cout << myCout.str() << std::endl;
1047 
1048  }
1049 
1050  break;
1051  case 1: {
1052  LogTrace("L1GtTrigReport") << myCout.str() << std::endl;
1053 
1054  } break;
1055 
1056  case 2: {
1057  edm::LogVerbatim("L1GtTrigReport") << myCout.str() << std::endl;
1058 
1059  }
1060 
1061  break;
1062  case 3: {
1063  edm::LogInfo("L1GtTrigReport") << myCout.str();
1064 
1065  }
1066 
1067  break;
1068  default: {
1069  std::cout << "\n\n L1GtTrigReport: Error - no print output = " << m_printOutput
1070  << " defined! \n Check available values in the cfi file."
1071  << "\n"
1072  << std::endl;
1073 
1074  } break;
1075  }
1076 }
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:19
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

Member Data Documentation

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

list of individual entries in the report for physics algorithms

Definition at line 139 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 142 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 136 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 133 of file L1GtTrigReport.h.

Referenced by analyze(), and endJob().

const L1GtTriggerMenu* L1GtTrigReport::m_l1GtMenu
private

Definition at line 108 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtMenuCacheID
private

Definition at line 109 of file L1GtTrigReport.h.

Referenced by analyze().

const L1GtPrescaleFactors* L1GtTrigReport::m_l1GtPfAlgo
private

prescale factors

Definition at line 79 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtPfAlgoCacheID
private

Definition at line 80 of file L1GtTrigReport.h.

Referenced by analyze().

const L1GtPrescaleFactors* L1GtTrigReport::m_l1GtPfTech
private

Definition at line 82 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtPfTechCacheID
private

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

Referenced by analyze(), and L1GtTrigReport().

const edm::EDGetTokenT<L1GlobalTriggerRecord> L1GtTrigReport::m_l1GtRecordInputToken1
private

Definition at line 118 of file L1GtTrigReport.h.

Referenced by analyze().

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

Definition at line 119 of file L1GtTrigReport.h.

Referenced by analyze().

const L1GtStableParameters* L1GtTrigReport::m_l1GtStablePar
private

cached stuff

stable parameters

Definition at line 65 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtStableParCacheID
private

Definition at line 66 of file L1GtTrigReport.h.

Referenced by analyze().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmAlgo
private

trigger masks & veto masks

Definition at line 89 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmAlgoCacheID
private

Definition at line 90 of file L1GtTrigReport.h.

Referenced by analyze().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmTech
private

Definition at line 92 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmTechCacheID
private

Definition at line 93 of file L1GtTrigReport.h.

Referenced by analyze().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmVetoAlgo
private

Definition at line 95 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmVetoAlgoCacheID
private

Definition at line 96 of file L1GtTrigReport.h.

Referenced by analyze().

const L1GtTriggerMask* L1GtTrigReport::m_l1GtTmVetoTech
private

Definition at line 98 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned long long L1GtTrigReport::m_l1GtTmVetoTechCacheID
private

Definition at line 99 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned int L1GtTrigReport::m_numberDaqPartitions
private

number of DAQ partitions

Definition at line 75 of file L1GtTrigReport.h.

Referenced by analyze(), and endJob().

unsigned int L1GtTrigReport::m_numberDaqPartitionsMax
private

Definition at line 76 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned int L1GtTrigReport::m_numberPhysTriggers
private

number of physics triggers

Definition at line 69 of file L1GtTrigReport.h.

Referenced by analyze().

unsigned int L1GtTrigReport::m_numberTechnicalTriggers
private

number of technical triggers

Definition at line 72 of file L1GtTrigReport.h.

Referenced by analyze().

const unsigned int L1GtTrigReport::m_physicsDaqPartition
private

index of physics DAQ partition

Definition at line 148 of file L1GtTrigReport.h.

Referenced by analyze(), and endJob().

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

Definition at line 85 of file L1GtTrigReport.h.

Referenced by analyze().

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

Definition at line 86 of file L1GtTrigReport.h.

Referenced by analyze().

const int L1GtTrigReport::m_printOutput
private

print output

Definition at line 125 of file L1GtTrigReport.h.

Referenced by endJob(), and L1GtTrigReport().

const int L1GtTrigReport::m_printVerbosity
private

print verbosity

Definition at line 122 of file L1GtTrigReport.h.

Referenced by endJob(), and L1GtTrigReport().

int L1GtTrigReport::m_totalEvents
private

counters

global number of events processed

Definition at line 130 of file L1GtTrigReport.h.

Referenced by analyze(), and endJob().

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

Definition at line 101 of file L1GtTrigReport.h.

Referenced by analyze().

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

Definition at line 102 of file L1GtTrigReport.h.

Referenced by analyze().

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

Definition at line 104 of file L1GtTrigReport.h.

Referenced by analyze().

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

Definition at line 105 of file L1GtTrigReport.h.

Referenced by analyze().

const bool L1GtTrigReport::m_useL1GlobalTriggerRecord
private

boolean flag to select the input record

Definition at line 113 of file L1GtTrigReport.h.

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