00001
00017
00018 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtTrigReport.h"
00019
00020
00021 #include <memory>
00022
00023 #include <iostream>
00024 #include <iomanip>
00025
00026 #include<map>
00027 #include <string>
00028
00029 #include "boost/lexical_cast.hpp"
00030
00031
00032 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
00033 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
00034 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerRecord.h"
00035
00036 #include "FWCore/Framework/interface/Frameworkfwd.h"
00037 #include "FWCore/Framework/interface/EDAnalyzer.h"
00038
00039 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00040
00041 #include "FWCore/Framework/interface/Event.h"
00042 #include "FWCore/Framework/interface/MakerMacros.h"
00043
00044 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00045 #include "FWCore/ParameterSet/interface/InputTag.h"
00046
00047 #include "FWCore/Framework/interface/EventSetup.h"
00048 #include "FWCore/Framework/interface/ESHandle.h"
00049
00050 #include "CondFormats/L1TObjects/interface/L1GtStableParameters.h"
00051 #include "CondFormats/DataRecord/interface/L1GtStableParametersRcd.h"
00052
00053 #include "CondFormats/L1TObjects/interface/L1GtPrescaleFactors.h"
00054 #include "CondFormats/DataRecord/interface/L1GtPrescaleFactorsAlgoTrigRcd.h"
00055 #include "CondFormats/DataRecord/interface/L1GtPrescaleFactorsTechTrigRcd.h"
00056
00057 #include "CondFormats/L1TObjects/interface/L1GtTriggerMask.h"
00058 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskAlgoTrigRcd.h"
00059 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskTechTrigRcd.h"
00060
00061 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskVetoAlgoTrigRcd.h"
00062 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskVetoTechTrigRcd.h"
00063
00064 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
00065 #include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
00066
00067 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtTrigReportEntry.h"
00068
00069
00070 L1GtTrigReport::L1GtTrigReport(const edm::ParameterSet& pSet) {
00071
00072
00073
00074 m_useL1GlobalTriggerRecord = pSet.getParameter<bool>("UseL1GlobalTriggerRecord");
00075
00077 m_l1GtRecordInputTag = pSet.getParameter<edm::InputTag>("L1GtRecordInputTag");
00078
00079
00080 m_printVerbosity = pSet.getUntrackedParameter<int>("PrintVerbosity", 0);
00081
00082
00083 m_printOutput = pSet.getUntrackedParameter<int>("PrintOutput", 3);
00084
00085 LogDebug("L1GtTrigReport") << "\nUse L1GlobalTriggerRecord: "
00086 << "\n (if false: L1GtTrigReport uses L1GlobalTriggerReadoutRecord.)"
00087 << "\nInput tag for L1 GT record: " << m_l1GtRecordInputTag.label() << " \n"
00088 << "\nPrint verbosity level: " << m_printVerbosity << " \n"
00089 << "\nPrint output: " << m_printOutput << " \n" << std::endl;
00090
00091
00092
00093
00094 m_l1GtStableParCacheID = 0ULL;
00095
00096 m_numberPhysTriggers = 0;
00097 m_numberTechnicalTriggers = 0;
00098 m_numberDaqPartitions = 0;
00099 m_numberDaqPartitionsMax = 0;
00100
00101
00102 m_l1GtPfAlgoCacheID = 0ULL;
00103 m_l1GtPfTechCacheID = 0ULL;
00104
00105 m_l1GtTmAlgoCacheID = 0ULL;
00106 m_l1GtTmTechCacheID = 0ULL;
00107
00108 m_l1GtTmVetoAlgoCacheID = 0ULL;
00109 m_l1GtTmVetoTechCacheID = 0ULL;
00110
00111
00112 m_l1GtMenuCacheID = 0ULL;
00113
00114
00115
00116
00117 m_totalEvents = 0;
00118
00119
00120 m_entryList.clear();
00121 m_entryListTechTrig.clear();
00122
00123
00124 m_physicsDaqPartition = 0;
00125
00126 }
00127
00128
00129 L1GtTrigReport::~L1GtTrigReport() {
00130
00131 for (ItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00132 if (*itEntry != 0) {
00133 delete *itEntry;
00134 *itEntry = 0;
00135 }
00136 }
00137
00138 m_entryList.clear();
00139
00140 for (ItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
00141 if (*itEntry != 0) {
00142 delete *itEntry;
00143 *itEntry = 0;
00144 }
00145 }
00146
00147 m_entryListTechTrig.clear();
00148
00149 }
00150
00151
00152
00153
00154
00155 void L1GtTrigReport::beginJob(const edm::EventSetup& evSetup) {
00156
00157
00158
00159 }
00160
00161
00162 void L1GtTrigReport::analyze(const edm::Event& iEvent, const edm::EventSetup& evSetup) {
00163
00164
00165 m_totalEvents++;
00166
00167
00168
00169
00170 unsigned long long l1GtStableParCacheID =
00171 evSetup.get<L1GtStableParametersRcd>().cacheIdentifier();
00172
00173 if (m_l1GtStableParCacheID != l1GtStableParCacheID) {
00174
00175 edm::ESHandle<L1GtStableParameters> l1GtStablePar;
00176 evSetup.get<L1GtStableParametersRcd>().get(l1GtStablePar);
00177 m_l1GtStablePar = l1GtStablePar.product();
00178
00179
00180 m_numberPhysTriggers = m_l1GtStablePar->gtNumberPhysTriggers();
00181
00182
00183 m_numberTechnicalTriggers = m_l1GtStablePar->gtNumberTechnicalTriggers();
00184
00185
00186 m_numberDaqPartitions = 8;
00187
00188 if (m_numberDaqPartitionsMax < m_numberDaqPartitions) {
00189
00190 int numberDaqPartitionsOld = m_numberDaqPartitionsMax;
00191 m_numberDaqPartitionsMax = m_numberDaqPartitions;
00192
00193 m_globalNrErrors.reserve(m_numberDaqPartitionsMax);
00194 m_globalNrAccepts.reserve(m_numberDaqPartitionsMax);
00195
00196 for (unsigned int iDaq = numberDaqPartitionsOld; iDaq < m_numberDaqPartitionsMax; ++iDaq) {
00197
00198 m_globalNrErrors.push_back(0);
00199 m_globalNrAccepts.push_back(0);
00200
00201 }
00202
00203 }
00204
00205
00206 m_l1GtStableParCacheID = l1GtStableParCacheID;
00207
00208 }
00209
00210
00211
00212
00213 unsigned long long l1GtPfAlgoCacheID =
00214 evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().cacheIdentifier();
00215
00216 if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
00217
00218 edm::ESHandle<L1GtPrescaleFactors> l1GtPfAlgo;
00219 evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
00220 m_l1GtPfAlgo = l1GtPfAlgo.product();
00221
00222 m_prescaleFactorsAlgoTrig = & ( m_l1GtPfAlgo->gtPrescaleFactors() );
00223
00224 m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
00225
00226 }
00227
00228 unsigned long long l1GtPfTechCacheID =
00229 evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().cacheIdentifier();
00230
00231 if (m_l1GtPfTechCacheID != l1GtPfTechCacheID) {
00232
00233 edm::ESHandle<L1GtPrescaleFactors> l1GtPfTech;
00234 evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech);
00235 m_l1GtPfTech = l1GtPfTech.product();
00236
00237 m_prescaleFactorsTechTrig = & ( m_l1GtPfTech->gtPrescaleFactors() );
00238
00239 m_l1GtPfTechCacheID = l1GtPfTechCacheID;
00240
00241 }
00242
00243
00244
00245
00246 unsigned long long l1GtTmAlgoCacheID =
00247 evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
00248
00249 if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
00250
00251 edm::ESHandle<L1GtTriggerMask> l1GtTmAlgo;
00252 evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo);
00253 m_l1GtTmAlgo = l1GtTmAlgo.product();
00254
00255 m_triggerMaskAlgoTrig = m_l1GtTmAlgo->gtTriggerMask();
00256
00257 m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
00258
00259 }
00260
00261 unsigned long long l1GtTmTechCacheID =
00262 evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
00263
00264 if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
00265
00266 edm::ESHandle<L1GtTriggerMask> l1GtTmTech;
00267 evSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech);
00268 m_l1GtTmTech = l1GtTmTech.product();
00269
00270 m_triggerMaskTechTrig = m_l1GtTmTech->gtTriggerMask();
00271
00272 m_l1GtTmTechCacheID = l1GtTmTechCacheID;
00273
00274 }
00275
00276 unsigned long long l1GtTmVetoAlgoCacheID =
00277 evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().cacheIdentifier();
00278
00279 if (m_l1GtTmVetoAlgoCacheID != l1GtTmVetoAlgoCacheID) {
00280
00281 edm::ESHandle<L1GtTriggerMask> l1GtTmVetoAlgo;
00282 evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().get(l1GtTmVetoAlgo);
00283 m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
00284
00285 m_triggerMaskVetoAlgoTrig = m_l1GtTmVetoAlgo->gtTriggerMask();
00286
00287 m_l1GtTmVetoAlgoCacheID = l1GtTmVetoAlgoCacheID;
00288
00289 }
00290
00291 unsigned long long l1GtTmVetoTechCacheID =
00292 evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().cacheIdentifier();
00293
00294 if (m_l1GtTmVetoTechCacheID != l1GtTmVetoTechCacheID) {
00295
00296 edm::ESHandle<L1GtTriggerMask> l1GtTmVetoTech;
00297 evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().get(l1GtTmVetoTech);
00298 m_l1GtTmVetoTech = l1GtTmVetoTech.product();
00299
00300 m_triggerMaskVetoTechTrig = m_l1GtTmVetoTech->gtTriggerMask();
00301
00302 m_l1GtTmVetoTechCacheID = l1GtTmVetoTechCacheID;
00303
00304 }
00305
00306
00307
00308
00309 unsigned long long l1GtMenuCacheID = evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();
00310
00311 if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
00312
00313 edm::ESHandle<L1GtTriggerMenu> l1GtMenu;
00314 evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu);
00315 m_l1GtMenu = l1GtMenu.product();
00316
00317 m_l1GtMenuCacheID = l1GtMenuCacheID;
00318
00319 }
00320
00321 const AlgorithmMap& algorithmMap = m_l1GtMenu->gtAlgorithmMap();
00322
00323
00324 const std::string& menuName = m_l1GtMenu->gtTriggerMenuName();
00325
00326
00327
00328
00329
00330 edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecord;
00331 edm::Handle<L1GlobalTriggerRecord> gtRecord;
00332
00333 if (m_useL1GlobalTriggerRecord) {
00334 iEvent.getByLabel(m_l1GtRecordInputTag, gtRecord);
00335 } else {
00336 iEvent.getByLabel(m_l1GtRecordInputTag, gtReadoutRecord);
00337 }
00338
00339 bool validRecord = false;
00340
00341 unsigned int pfIndexAlgo = 0;
00342 unsigned int pfIndexTech = 0;
00343
00344 DecisionWord gtDecisionWordBeforeMask;
00345 DecisionWord gtDecisionWordAfterMask;
00346
00347 TechnicalTriggerWord technicalTriggerWordBeforeMask;
00348 TechnicalTriggerWord technicalTriggerWordAfterMask;
00349
00350 if (m_useL1GlobalTriggerRecord) {
00351
00352 if (gtRecord.isValid()) {
00353
00354
00355 bool gtDecision = gtRecord->decision();
00356
00357 gtDecisionWordBeforeMask = gtRecord->decisionWordBeforeMask();
00358 gtDecisionWordAfterMask = gtRecord->decisionWord();
00359
00360 technicalTriggerWordBeforeMask = gtRecord->technicalTriggerWordBeforeMask();
00361 technicalTriggerWordAfterMask = gtRecord->technicalTriggerWord();
00362
00363 if (gtDecision) {
00364 m_globalNrAccepts[m_physicsDaqPartition]++;
00365 }
00366
00367 pfIndexAlgo = gtRecord->gtPrescaleFactorIndexAlgo();
00368 pfIndexTech = gtRecord->gtPrescaleFactorIndexTech();
00369
00370 validRecord = true;
00371
00372 } else {
00373
00374 m_globalNrErrors[m_physicsDaqPartition]++;
00375
00376 LogDebug("L1GtTrigReport") << "L1GlobalTriggerRecord with input tag "
00377 << m_l1GtRecordInputTag.label() << " not found.\n\n" << std::endl;
00378
00379 }
00380
00381 } else {
00382 if (gtReadoutRecord.isValid()) {
00383
00384
00385 boost::uint16_t gtFinalOR = gtReadoutRecord->finalOR();
00386
00387 gtDecisionWordBeforeMask = gtReadoutRecord->decisionWord();
00388 technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
00389
00390 for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00391
00392 bool gtDecision = static_cast<bool>(gtFinalOR & ( 1 << iDaqPartition ));
00393 if (gtDecision) {
00394 m_globalNrAccepts[iDaqPartition]++;
00395 }
00396
00397 }
00398
00399 pfIndexAlgo
00400 = static_cast<unsigned int>( ( gtReadoutRecord->gtFdlWord() ).gtPrescaleFactorIndexAlgo());
00401 pfIndexTech
00402 = static_cast<unsigned int>( ( gtReadoutRecord->gtFdlWord() ).gtPrescaleFactorIndexTech());
00403
00404 validRecord = true;
00405 } else {
00406
00407 for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00408 m_globalNrErrors[iDaqPartition]++;
00409 }
00410
00411 LogDebug("L1GtTrigReport") << "L1GlobalTriggerReadoutRecord with input tag "
00412 << m_l1GtRecordInputTag.label() << " not found.\n\n" << std::endl;
00413
00414 }
00415
00416 }
00417
00418
00419 const std::vector<int>& prescaleFactorsAlgoTrig =
00420 ( *m_prescaleFactorsAlgoTrig ).at(pfIndexAlgo);
00421
00422 const std::vector<int>& prescaleFactorsTechTrig =
00423 ( *m_prescaleFactorsTechTrig ).at(pfIndexTech);
00424
00425
00426 if (validRecord) {
00427
00428
00429 for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
00430
00431 std::string algName = itAlgo->first;
00432 int algBitNumber = ( itAlgo->second ).algoBitNumber();
00433
00434
00435
00436 bool algResultBeforeMask = gtDecisionWordBeforeMask[algBitNumber];
00437
00438 int prescaleFactor = prescaleFactorsAlgoTrig.at(algBitNumber);
00439
00440 for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00441
00442 unsigned int triggerMask = ( m_triggerMaskAlgoTrig.at(algBitNumber) ) & ( 1
00443 << iDaqPartition );
00444
00445 bool algResultAfterMask = false;
00446
00447 if (m_useL1GlobalTriggerRecord) {
00448 if (iDaqPartition == m_physicsDaqPartition) {
00449
00450
00451 algResultAfterMask = gtDecisionWordAfterMask[algBitNumber];
00452 } else {
00453
00454 algResultAfterMask = algResultBeforeMask;
00455
00456 if (triggerMask) {
00457 algResultAfterMask = false;
00458 }
00459 }
00460 } else {
00461
00462 algResultAfterMask = algResultBeforeMask;
00463
00464 if (triggerMask) {
00465 algResultAfterMask = false;
00466 }
00467 }
00468
00469 L1GtTrigReportEntry* entryRep = new L1GtTrigReportEntry(
00470 menuName, algName, prescaleFactor, triggerMask, iDaqPartition);
00471
00472 int iCount = 0;
00473
00474 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00475 if ( ( *entryRep ) == * ( *itEntry )) {
00476 iCount++;
00477
00478 ( *itEntry )->addValidEntry(algResultAfterMask, algResultBeforeMask);
00479 }
00480 }
00481
00482 if (iCount == 0) {
00483
00484
00485 entryRep->addValidEntry(algResultAfterMask, algResultBeforeMask);
00486 m_entryList.push_back(entryRep);
00487 } else {
00488 delete entryRep;
00489 }
00490 }
00491 }
00492
00493
00494
00495
00496 for (unsigned int iTechTrig = 0; iTechTrig < m_numberTechnicalTriggers; ++iTechTrig) {
00497
00498
00499
00500 std::string ttName = boost::lexical_cast<std::string>(iTechTrig);
00501 int ttBitNumber = iTechTrig;
00502
00503
00504
00505 bool ttResultBeforeMask = technicalTriggerWordBeforeMask[ttBitNumber];
00506
00507 int prescaleFactor = prescaleFactorsTechTrig.at(ttBitNumber);
00508
00509 for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00510
00511 unsigned int triggerMask = ( m_triggerMaskTechTrig.at(ttBitNumber) ) & ( 1
00512 << iDaqPartition );
00513
00514 bool ttResultAfterMask = false;
00515
00516 if (m_useL1GlobalTriggerRecord) {
00517 if (iDaqPartition == m_physicsDaqPartition) {
00518
00519
00520 ttResultAfterMask = technicalTriggerWordAfterMask[ttBitNumber];
00521 } else {
00522
00523 ttResultAfterMask = ttResultBeforeMask;
00524
00525 if (triggerMask) {
00526 ttResultAfterMask = false;
00527 }
00528 }
00529 } else {
00530
00531 ttResultAfterMask = ttResultBeforeMask;
00532
00533 if (triggerMask) {
00534 ttResultAfterMask = false;
00535 }
00536 }
00537
00538 L1GtTrigReportEntry* entryRep = new L1GtTrigReportEntry(
00539 menuName, ttName, prescaleFactor, triggerMask, iDaqPartition);
00540
00541 int iCount = 0;
00542
00543 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00544 != m_entryListTechTrig.end(); itEntry++) {
00545 if ( ( *entryRep ) == * ( *itEntry )) {
00546 iCount++;
00547
00548 ( *itEntry )->addValidEntry(ttResultAfterMask, ttResultBeforeMask);
00549 }
00550 }
00551
00552 if (iCount == 0) {
00553
00554
00555 entryRep->addValidEntry(ttResultAfterMask, ttResultBeforeMask);
00556 m_entryListTechTrig.push_back(entryRep);
00557 } else {
00558 delete entryRep;
00559 }
00560 }
00561 }
00562
00563 } else {
00564
00565
00566 for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
00567
00568 std::string algName = itAlgo->first;
00569 int algBitNumber = ( itAlgo->second ).algoBitNumber();
00570
00571 int prescaleFactor = prescaleFactorsAlgoTrig.at(algBitNumber);
00572
00573 for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00574
00575 unsigned int triggerMask = ( m_triggerMaskAlgoTrig.at(algBitNumber) ) & ( 1
00576 << iDaqPartition );
00577
00578 L1GtTrigReportEntry* entryRep = new L1GtTrigReportEntry(
00579 menuName, algName, prescaleFactor, triggerMask, iDaqPartition);
00580
00581 int iCount = 0;
00582
00583 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00584
00585 if ( ( *entryRep ) == * ( *itEntry )) {
00586 iCount++;
00587
00588 ( *itEntry )->addErrorEntry();
00589 }
00590 }
00591
00592 if (iCount == 0) {
00593
00594
00595 entryRep->addErrorEntry();
00596 m_entryList.push_back(entryRep);
00597 } else {
00598 delete entryRep;
00599 }
00600 }
00601
00602 }
00603
00604
00605
00606
00607 for (unsigned int iTechTrig = 0; iTechTrig < m_numberTechnicalTriggers; ++iTechTrig) {
00608
00609
00610
00611 std::string ttName = boost::lexical_cast<std::string>(iTechTrig);
00612 int ttBitNumber = iTechTrig;
00613
00614 int prescaleFactor = prescaleFactorsTechTrig.at(ttBitNumber);
00615
00616 for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00617
00618 unsigned int triggerMask = ( m_triggerMaskTechTrig.at(ttBitNumber) ) & ( 1
00619 << iDaqPartition );
00620
00621 L1GtTrigReportEntry* entryRep = new L1GtTrigReportEntry(
00622 menuName, ttName, prescaleFactor, triggerMask, iDaqPartition);
00623
00624 int iCount = 0;
00625
00626 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00627 != m_entryListTechTrig.end(); itEntry++) {
00628
00629 if ( ( *entryRep ) == * ( *itEntry )) {
00630 iCount++;
00631
00632 ( *itEntry )->addErrorEntry();
00633 }
00634 }
00635
00636 if (iCount == 0) {
00637
00638
00639 entryRep->addErrorEntry();
00640 m_entryListTechTrig.push_back(entryRep);
00641 } else {
00642 delete entryRep;
00643 }
00644 }
00645
00646 }
00647
00648 }
00649
00650 }
00651
00652
00653 void L1GtTrigReport::endJob() {
00654
00655
00656
00657 std::ostringstream myCout;
00658
00659 myCout << std::dec << std::endl;
00660 myCout << "L1T-Report " << "---------- Event Summary ----------\n";
00661 myCout << "L1T-Report\n";
00662
00663 myCout
00664 << "\n"
00665 << " DAQ partition "
00666 << " Total "
00667 << " Passed[finalOR] "
00668 << " Rejected "
00669 << " Errors "
00670 << "\n" << std::endl;
00671
00672 for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00673
00674 int rejectedEvents = m_totalEvents - m_globalNrErrors[iDaqPartition]
00675 - m_globalNrAccepts[iDaqPartition];
00676
00677 if (m_useL1GlobalTriggerRecord && ( iDaqPartition != m_physicsDaqPartition )) {
00678 continue;
00679 } else {
00680
00681 myCout
00682 << std::right << std::setw(16) << iDaqPartition << " "
00683 << std::right << std::setw(16) << m_totalEvents << " "
00684 << std::right << std::setw(16) << m_globalNrAccepts[iDaqPartition] << " "
00685 << std::right << std::setw(16) << rejectedEvents << " "
00686 << std::right << std::setw(16) << m_globalNrErrors[iDaqPartition] << std::endl;
00687
00688 }
00689
00690 }
00691
00692 switch (m_printVerbosity) {
00693 case 0: {
00694
00695 myCout
00696 << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
00697 << m_physicsDaqPartition << "----------\n\n";
00698
00699 myCout
00700 << "\n\n Number of events written after applying L1 prescale factors"
00701 << " and trigger masks\n" << " if not explicitly mentioned.\n\n";
00702
00703 myCout
00704 << std::right << std::setw(35) << "Algorithm Key" << " "
00705 << std::right << std::setw(10) << "Passed" << " "
00706 << std::right << std::setw(10) << "Rejected" << " "
00707 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00708 << std::right << std::setw(20) << "Trigger Menu Key"
00709 << "\n";
00710
00711 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00712
00713 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
00714
00715 myCout
00716 << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00717 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00718 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00719 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00720 << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00721 << "\n";
00722 }
00723
00724 }
00725
00726 myCout
00727 << "\n\n"
00728 << std::right << std::setw(35) << "Technical Trigger Key" << " "
00729 << std::right << std::setw(10) << "Passed" << " "
00730 << std::right << std::setw(10) << "Rejected" << " "
00731 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00732 << std::right << std::setw(20) << "Trigger Menu Key"
00733 << "\n";
00734
00735 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00736 != m_entryListTechTrig.end(); itEntry++) {
00737
00738 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
00739
00740 myCout
00741 << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00742 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00743 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00744 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00745 << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00746 << "\n";
00747 }
00748
00749 }
00750
00751 }
00752
00753 break;
00754 case 1: {
00755
00756 myCout << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
00757 << m_physicsDaqPartition << "----------\n\n";
00758
00759 myCout << "\n\n Number of events written after applying L1 prescale factors"
00760 << " and trigger masks\n" << " if not explicitly mentioned.\n\n";
00761
00762 myCout
00763 << std::right << std::setw(35) << "Algorithm Key" << " "
00764 << std::right << std::setw(10) << "Prescale" << " "
00765 << std::right << std::setw(5) << "Mask" << " "
00766 << std::right << std::setw(10) << "Passed" << " "
00767 << std::right << std::setw(10) << "Rejected" << " "
00768 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00769 << std::right << std::setw(20) << "Trigger Menu Key"
00770 << "\n";
00771
00772 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00773
00774 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
00775 myCout
00776 << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00777 << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
00778 << std::right << std::setw(2)
00779 << std::hex << ( *itEntry )->gtTriggerMask()
00780 << std::dec << " "
00781 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00782 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00783 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00784 << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00785 << "\n";
00786 }
00787 }
00788
00789 myCout
00790 << "\n\n"
00791 << std::right << std::setw(35) << "Technical Trigger Key" << " "
00792 << std::right << std::setw(10) << "Prescale" << " "
00793 << std::right << std::setw(5) << "Mask" << " "
00794 << std::right << std::setw(10) << "Passed" << " "
00795 << std::right << std::setw(10) << "Rejected" << " "
00796 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00797 << std::right << std::setw(20) << "Trigger Menu Key"
00798 << "\n";
00799
00800 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
00801
00802 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
00803 myCout
00804 << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00805 << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
00806 << std::right << std::setw(2)
00807 << std::hex << ( *itEntry )->gtTriggerMask()
00808 << std::dec << " "
00809 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00810 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00811 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00812 << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00813 << "\n";
00814 }
00815 }
00816
00817 }
00818
00819 break;
00820 case 10: {
00821
00822 myCout << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
00823 << m_physicsDaqPartition << "----------\n\n";
00824
00825 myCout
00826 << std::right << std::setw(35) << "Algorithm Key" << " "
00827 << std::right << std::setw(10) << "Prescale" << " "
00828 << std::right << std::setw(5) << "Mask" << " "
00829 << std::right << std::setw(15) << "Before Mask" << " "
00830 << std::right << std::setw(15) << "After Mask" << " "
00831 << std::right << std::setw(15) << "Error" << std::setw(2) << " "
00832 << std::right << std::setw(20) << "Trigger Menu Key"
00833 << "\n"
00834 << std::right << std::setw(53) << " " << std::setw(15) << "Passed" << " "
00835 << std::right << std::setw(15) << "Passed" << " " << "\n"
00836 << std::right << std::setw(53) << " " << std::setw(15) << "Rejected" << " "
00837 << std::right << std::setw(15) << "Rejected" << " "
00838 << "\n";
00839
00840 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00841
00842 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
00843 myCout
00844 << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00845 << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
00846 << std::right << std::setw(3) << " " << std::setw(2)
00847 << std::hex << ( *itEntry )->gtTriggerMask()
00848 << std::dec << " "
00849 << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAcceptBeforeMask() << " "
00850 << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAccept() << " "
00851 << std::right << std::setw(15) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00852 << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00853 << "\n"
00854 << std::right << std::setw(53) << " "
00855 << std::right << std::setw(15) << ( *itEntry )->gtNrEventsRejectBeforeMask() << " "
00856 << std::right << std::setw(15) << ( *itEntry )->gtNrEventsReject()
00857 << "\n";
00858 }
00859 }
00860
00861 myCout
00862 << "\n\n"
00863 << std::right << std::setw(35) << "Technical Trigger Key" << " "
00864 << std::right << std::setw(10) << "Prescale" << " "
00865 << std::right << std::setw(5) << "Mask" << " "
00866 << std::right << std::setw(15) << "Before Mask" << " "
00867 << std::right << std::setw(15) << "After Mask" << " "
00868 << std::right << std::setw(15) << "Error" << std::setw(2) << " "
00869 << std::right << std::setw(20) << "Trigger Menu Key"
00870 << "\n"
00871 << std::right << std::setw(53) << " " << std::setw(15) << "Passed" << " "
00872 << std::right << std::setw(15) << "Passed" << " "
00873 << "\n"
00874 << std::right << std::setw(53) << " " << std::setw(15) << "Rejected" << " "
00875 << std::right << std::setw(15) << "Rejected" << " "
00876 << "\n";
00877
00878 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
00879
00880 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
00881 myCout
00882 << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00883 << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
00884 << std::right << std::setw(3) << " " << std::setw(2)
00885 << std::hex << ( *itEntry )->gtTriggerMask()
00886 << std::dec << " "
00887 << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAcceptBeforeMask() << " "
00888 << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAccept() << " "
00889 << std::right << std::setw(15) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00890 << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00891 << "\n"
00892 << std::right << std::setw(53) << " "
00893 << std::right << std::setw(15) << ( *itEntry )->gtNrEventsRejectBeforeMask() << " "
00894 << std::right << std::setw(15) << ( *itEntry )->gtNrEventsReject()
00895 << "\n";
00896 }
00897 }
00898 }
00899
00900 break;
00901 case 100: {
00902
00903 for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00904
00905 myCout << "\nL1T-Report "
00906 << "---------- L1 Trigger Global Summary - DAQ Partition " << iDaqPartition
00907 << " " << "----------\n\n";
00908
00909 myCout
00910 << std::right << std::setw(35) << "Algorithm Key" << " "
00911 << std::right << std::setw(10) << "Passed" << " "
00912 << std::right << std::setw(10) << "Rejected" << " "
00913 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00914 << std::right << std::setw(20) << "Trigger Menu Key"
00915 << "\n";
00916
00917 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00918
00919 if ( ( *itEntry )->gtDaqPartition() == 0) {
00920
00921 myCout
00922 << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00923 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00924 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00925 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00926 << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00927 << "\n";
00928 }
00929
00930 }
00931
00932 myCout
00933 << "\n\n"
00934 << std::right << std::setw(35) << "Technical Trigger Key" << " "
00935 << std::right << std::setw(10) << "Passed" << " "
00936 << std::right << std::setw(10) << "Rejected" << " "
00937 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00938 << std::right << std::setw(20) << "Trigger Menu Key"
00939 << "\n";
00940
00941 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
00942
00943 if ( ( *itEntry )->gtDaqPartition() == 0) {
00944
00945 myCout
00946 << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00947 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00948 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00949 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00950 << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00951 << "\n";
00952 }
00953
00954 }
00955
00956 }
00957 }
00958
00959 break;
00960 case 101: {
00961
00962 for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00963
00964 myCout << "\nL1T-Report "
00965 << "---------- L1 Trigger Global Summary - DAQ Partition " << iDaqPartition
00966 << " " << "----------\n\n";
00967
00968 myCout
00969 << std::right << std::setw(35) << "Algorithm Key" << " "
00970 << std::right << std::setw(10) << "Prescale" << " "
00971 << std::right << std::setw(5) << "Mask" << " "
00972 << std::right << std::setw(10) << "Passed" << " "
00973 << std::right << std::setw(10) << "Rejected" << " "
00974 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00975 << std::right << std::setw(20) << "Trigger Menu Key"
00976 << "\n";
00977
00978 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00979
00980 if ( ( *itEntry )->gtDaqPartition() == 0) {
00981 myCout
00982 << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00983 << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
00984 << std::right << std::setw(2)
00985 << std::hex << ( *itEntry )->gtTriggerMask()
00986 << std::dec << " "
00987 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00988 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00989 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00990 << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00991 << "\n";
00992 }
00993 }
00994
00995 myCout
00996 << "\n\n"
00997 << std::right << std::setw(35) << "Technical Trigger Key" << " "
00998 << std::right << std::setw(10) << "Prescale" << " "
00999 << std::right << std::setw(5) << "Mask" << " "
01000 << std::right << std::setw(10) << "Passed" << " "
01001 << std::right << std::setw(10) << "Rejected" << " "
01002 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
01003 << std::right << std::setw(20) << "Trigger Menu Key"
01004 << "\n";
01005
01006 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
01007
01008 if ( ( *itEntry )->gtDaqPartition() == 0) {
01009 myCout
01010 << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
01011 << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
01012 << std::right << std::setw(2)
01013 << std::hex << ( *itEntry )->gtTriggerMask()
01014 << std::dec << " "
01015 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
01016 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
01017 << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
01018 << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
01019 << "\n";
01020 }
01021 }
01022
01023 }
01024 }
01025
01026 break;
01027 default: {
01028 myCout
01029 << "\n\nL1GtTrigReport: Error - no print verbosity level = " << m_printVerbosity
01030 << " defined! \nCheck available values in the cfi file." << "\n";
01031 }
01032
01033 break;
01034 }
01035
01036
01037
01038
01039
01040 myCout << std::endl;
01041 myCout << "L1T-Report end!" << std::endl;
01042 myCout << std::endl;
01043
01044 switch (m_printOutput) {
01045 case 0: {
01046
01047 std::cout << myCout.str() << std::endl;
01048
01049 }
01050
01051 break;
01052 case 1: {
01053
01054 LogTrace("L1GtTrigReport") << myCout.str() << std::endl;
01055
01056 }
01057 break;
01058
01059 case 2: {
01060
01061 edm::LogVerbatim("L1GtTrigReport") << myCout.str() << std::endl;
01062
01063 }
01064
01065 break;
01066 case 3: {
01067
01068 edm::LogInfo("L1GtTrigReport") << myCout.str();
01069
01070 }
01071
01072 break;
01073 default: {
01074 std::cout
01075 << "\n\nL1GtTrigReport: Error - no print output = " << m_printOutput
01076 << " defined! \nCheck available values in the cfi file." << "\n" << std::endl;
01077
01078 }
01079 break;
01080 }
01081
01082 }
01083