CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/L1Trigger/GlobalTriggerAnalyzer/src/L1GtTrigReport.cc

Go to the documentation of this file.
00001 
00017 // this class header
00018 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtTrigReport.h"
00019 
00020 // system include files
00021 #include <memory>
00022 
00023 #include <iostream>
00024 #include <iomanip>
00025 
00026 #include<map>
00027 #include<set>
00028 #include <cmath>
00029 #include <string>
00030 
00031 #include "boost/lexical_cast.hpp"
00032 
00033 // user include files
00034 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
00035 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
00036 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerRecord.h"
00037 
00038 #include "FWCore/Framework/interface/Frameworkfwd.h"
00039 #include "FWCore/Framework/interface/EDAnalyzer.h"
00040 
00041 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00042 
00043 #include "FWCore/Framework/interface/Event.h"
00044 #include "FWCore/Framework/interface/MakerMacros.h"
00045 
00046 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00047 #include "FWCore/Utilities/interface/InputTag.h"
00048 
00049 #include "FWCore/Framework/interface/EventSetup.h"
00050 #include "FWCore/Framework/interface/ESHandle.h"
00051 
00052 #include "CondFormats/L1TObjects/interface/L1GtStableParameters.h"
00053 #include "CondFormats/DataRecord/interface/L1GtStableParametersRcd.h"
00054 
00055 #include "CondFormats/L1TObjects/interface/L1GtPrescaleFactors.h"
00056 #include "CondFormats/DataRecord/interface/L1GtPrescaleFactorsAlgoTrigRcd.h"
00057 #include "CondFormats/DataRecord/interface/L1GtPrescaleFactorsTechTrigRcd.h"
00058 
00059 #include "CondFormats/L1TObjects/interface/L1GtTriggerMask.h"
00060 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskAlgoTrigRcd.h"
00061 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskTechTrigRcd.h"
00062 
00063 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskVetoAlgoTrigRcd.h"
00064 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskVetoTechTrigRcd.h"
00065 
00066 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
00067 #include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
00068 
00069 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtTrigReportEntry.h"
00070 
00071 // constructor(s)
00072 L1GtTrigReport::L1GtTrigReport(const edm::ParameterSet& pSet) {
00073 
00074     // boolean flag to select the input record
00075     // if true, it will use L1GlobalTriggerRecord
00076     m_useL1GlobalTriggerRecord = pSet.getParameter<bool>("UseL1GlobalTriggerRecord");
00077 
00079     m_l1GtRecordInputTag = pSet.getParameter<edm::InputTag>("L1GtRecordInputTag");
00080 
00081     // print verbosity
00082     m_printVerbosity = pSet.getUntrackedParameter<int>("PrintVerbosity", 2);
00083 
00084     // print output
00085     m_printOutput = pSet.getUntrackedParameter<int>("PrintOutput", 3);
00086 
00087     LogDebug("L1GtTrigReport") << "\n  Use L1GlobalTriggerRecord:   " << m_useL1GlobalTriggerRecord
00088             << "\n   (if false: L1GtTrigReport uses L1GlobalTriggerReadoutRecord.)"
00089             << "\n  Input tag for L1 GT record:  " << m_l1GtRecordInputTag.label() << " \n"
00090             << "\n  Print verbosity level:           " << m_printVerbosity << " \n"
00091             << "\n  Print output:                    " << m_printOutput << " \n" << std::endl;
00092 
00093     // initialize cached IDs
00094 
00095     //
00096     m_l1GtStableParCacheID = 0ULL;
00097 
00098     m_numberPhysTriggers = 0;
00099     m_numberTechnicalTriggers = 0;
00100     m_numberDaqPartitions = 0;
00101     m_numberDaqPartitionsMax = 0;
00102 
00103     //
00104     m_l1GtPfAlgoCacheID = 0ULL;
00105     m_l1GtPfTechCacheID = 0ULL;
00106 
00107     m_l1GtTmAlgoCacheID = 0ULL;
00108     m_l1GtTmTechCacheID = 0ULL;
00109 
00110     m_l1GtTmVetoAlgoCacheID = 0ULL;
00111     m_l1GtTmVetoTechCacheID = 0ULL;
00112 
00113     //
00114     m_l1GtMenuCacheID = 0ULL;
00115 
00116     // initialize global counters
00117 
00118     // number of events processed
00119     m_totalEvents = 0;
00120 
00121     //
00122     m_entryList.clear();
00123     m_entryListTechTrig.clear();
00124 
00125     // set the index of physics DAQ partition TODO input parameter?
00126     m_physicsDaqPartition = 0;
00127 
00128 }
00129 
00130 // destructor
00131 L1GtTrigReport::~L1GtTrigReport() {
00132 
00133     for (ItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00134         if (*itEntry != 0) {
00135             delete *itEntry;
00136             *itEntry = 0;
00137         }
00138     }
00139 
00140     m_entryList.clear();
00141 
00142     for (ItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
00143         if (*itEntry != 0) {
00144             delete *itEntry;
00145             *itEntry = 0;
00146         }
00147     }
00148 
00149     m_entryListTechTrig.clear();
00150 
00151 }
00152 
00153 // member functions
00154 
00155 
00156 // method called once each job just before starting event loop
00157 void L1GtTrigReport::beginJob() {
00158 
00159     // empty
00160 
00161 }
00162 
00163 // analyze each event
00164 void L1GtTrigReport::analyze(const edm::Event& iEvent, const edm::EventSetup& evSetup) {
00165 
00166     // increase the number of processed events
00167     m_totalEvents++;
00168 
00169     // get / update the stable parameters from the EventSetup
00170     // local cache & check on cacheIdentifier
00171 
00172     unsigned long long l1GtStableParCacheID =
00173             evSetup.get<L1GtStableParametersRcd>().cacheIdentifier();
00174 
00175     if (m_l1GtStableParCacheID != l1GtStableParCacheID) {
00176 
00177         edm::ESHandle<L1GtStableParameters> l1GtStablePar;
00178         evSetup.get<L1GtStableParametersRcd>().get(l1GtStablePar);
00179         m_l1GtStablePar = l1GtStablePar.product();
00180 
00181         // number of physics triggers
00182         m_numberPhysTriggers = m_l1GtStablePar->gtNumberPhysTriggers();
00183 
00184         // number of technical triggers
00185         m_numberTechnicalTriggers = m_l1GtStablePar->gtNumberTechnicalTriggers();
00186 
00187         // number of DAQ partitions
00188         m_numberDaqPartitions = 8; // FIXME add it to stable parameters
00189 
00190         if (m_numberDaqPartitionsMax < m_numberDaqPartitions) {
00191 
00192             int numberDaqPartitionsOld = m_numberDaqPartitionsMax;
00193             m_numberDaqPartitionsMax = m_numberDaqPartitions;
00194 
00195             m_globalNrErrors.reserve(m_numberDaqPartitionsMax);
00196             m_globalNrAccepts.reserve(m_numberDaqPartitionsMax);
00197 
00198             for (unsigned int iDaq = numberDaqPartitionsOld; iDaq < m_numberDaqPartitionsMax; ++iDaq) {
00199 
00200                 m_globalNrErrors.push_back(0);
00201                 m_globalNrAccepts.push_back(0);
00202 
00203             }
00204 
00205         }
00206 
00207         //
00208         m_l1GtStableParCacheID = l1GtStableParCacheID;
00209 
00210     }
00211 
00212     // get / update the prescale factors from the EventSetup
00213     // local cache & check on cacheIdentifier
00214 
00215     unsigned long long l1GtPfAlgoCacheID =
00216             evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().cacheIdentifier();
00217 
00218     if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
00219 
00220         edm::ESHandle<L1GtPrescaleFactors> l1GtPfAlgo;
00221         evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
00222         m_l1GtPfAlgo = l1GtPfAlgo.product();
00223 
00224         m_prescaleFactorsAlgoTrig = & ( m_l1GtPfAlgo->gtPrescaleFactors() );
00225 
00226         m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
00227 
00228     }
00229 
00230     unsigned long long l1GtPfTechCacheID =
00231             evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().cacheIdentifier();
00232 
00233     if (m_l1GtPfTechCacheID != l1GtPfTechCacheID) {
00234 
00235         edm::ESHandle<L1GtPrescaleFactors> l1GtPfTech;
00236         evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech);
00237         m_l1GtPfTech = l1GtPfTech.product();
00238 
00239         m_prescaleFactorsTechTrig = & ( m_l1GtPfTech->gtPrescaleFactors() );
00240 
00241         m_l1GtPfTechCacheID = l1GtPfTechCacheID;
00242 
00243     }
00244 
00245     // get / update the trigger mask from the EventSetup
00246     // local cache & check on cacheIdentifier
00247 
00248     unsigned long long l1GtTmAlgoCacheID =
00249             evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
00250 
00251     if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
00252 
00253         edm::ESHandle<L1GtTriggerMask> l1GtTmAlgo;
00254         evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo);
00255         m_l1GtTmAlgo = l1GtTmAlgo.product();
00256 
00257         m_triggerMaskAlgoTrig = m_l1GtTmAlgo->gtTriggerMask();
00258 
00259         m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
00260 
00261     }
00262 
00263     unsigned long long l1GtTmTechCacheID =
00264             evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
00265 
00266     if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
00267 
00268         edm::ESHandle<L1GtTriggerMask> l1GtTmTech;
00269         evSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech);
00270         m_l1GtTmTech = l1GtTmTech.product();
00271 
00272         m_triggerMaskTechTrig = m_l1GtTmTech->gtTriggerMask();
00273 
00274         m_l1GtTmTechCacheID = l1GtTmTechCacheID;
00275 
00276     }
00277 
00278     unsigned long long l1GtTmVetoAlgoCacheID =
00279             evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().cacheIdentifier();
00280 
00281     if (m_l1GtTmVetoAlgoCacheID != l1GtTmVetoAlgoCacheID) {
00282 
00283         edm::ESHandle<L1GtTriggerMask> l1GtTmVetoAlgo;
00284         evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().get(l1GtTmVetoAlgo);
00285         m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
00286 
00287         m_triggerMaskVetoAlgoTrig = m_l1GtTmVetoAlgo->gtTriggerMask();
00288 
00289         m_l1GtTmVetoAlgoCacheID = l1GtTmVetoAlgoCacheID;
00290 
00291     }
00292 
00293     unsigned long long l1GtTmVetoTechCacheID =
00294             evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().cacheIdentifier();
00295 
00296     if (m_l1GtTmVetoTechCacheID != l1GtTmVetoTechCacheID) {
00297 
00298         edm::ESHandle<L1GtTriggerMask> l1GtTmVetoTech;
00299         evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().get(l1GtTmVetoTech);
00300         m_l1GtTmVetoTech = l1GtTmVetoTech.product();
00301 
00302         m_triggerMaskVetoTechTrig = m_l1GtTmVetoTech->gtTriggerMask();
00303 
00304         m_l1GtTmVetoTechCacheID = l1GtTmVetoTechCacheID;
00305 
00306     }
00307 
00308     // get / update the trigger menu from the EventSetup
00309     // local cache & check on cacheIdentifier
00310 
00311     unsigned long long l1GtMenuCacheID =
00312             evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();
00313 
00314     if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
00315 
00316         edm::ESHandle<L1GtTriggerMenu> l1GtMenu;
00317         evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu);
00318         m_l1GtMenu = l1GtMenu.product();
00319 
00320         m_l1GtMenuCacheID = l1GtMenuCacheID;
00321 
00322         LogDebug("L1GtTrigReport") << "\n  Changing L1 menu to : \n"
00323                 << m_l1GtMenu->gtTriggerMenuName() << "\n\n" << std::endl;
00324 
00325     }
00326 
00327 
00328     const AlgorithmMap& algorithmMap = m_l1GtMenu->gtAlgorithmMap();
00329     const AlgorithmMap& technicalTriggerMap = m_l1GtMenu->gtTechnicalTriggerMap();
00330 
00331     const std::string& menuName = m_l1GtMenu->gtTriggerMenuName();
00332 
00333     // ... end EventSetup
00334 
00335     // get L1GlobalTriggerReadoutRecord or L1GlobalTriggerRecord
00336     // in L1GlobalTriggerRecord, only the physics partition is available
00337     edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecord;
00338     edm::Handle<L1GlobalTriggerRecord> gtRecord;
00339 
00340     if (m_useL1GlobalTriggerRecord) {
00341         iEvent.getByLabel(m_l1GtRecordInputTag, gtRecord);
00342     } else {
00343         iEvent.getByLabel(m_l1GtRecordInputTag, gtReadoutRecord);
00344     }
00345 
00346     bool validRecord = false;
00347 
00348     unsigned int pfIndexAlgo = 0; // get them later from the record
00349     unsigned int pfIndexTech = 0;
00350 
00351     DecisionWord gtDecisionWordBeforeMask;
00352     DecisionWord gtDecisionWordAfterMask;
00353 
00354     TechnicalTriggerWord technicalTriggerWordBeforeMask;
00355     TechnicalTriggerWord technicalTriggerWordAfterMask;
00356 
00357     if (m_useL1GlobalTriggerRecord) {
00358 
00359         if (gtRecord.isValid()) {
00360 
00361             // get Global Trigger decision and the decision word
00362             bool gtDecision = gtRecord->decision();
00363 
00364             gtDecisionWordBeforeMask = gtRecord->decisionWordBeforeMask();
00365             gtDecisionWordAfterMask = gtRecord->decisionWord();
00366 
00367             technicalTriggerWordBeforeMask = gtRecord->technicalTriggerWordBeforeMask();
00368             technicalTriggerWordAfterMask = gtRecord->technicalTriggerWord();
00369 
00370             if (gtDecision) {
00371                 m_globalNrAccepts[m_physicsDaqPartition]++;
00372             }
00373 
00374             pfIndexAlgo = gtRecord->gtPrescaleFactorIndexAlgo();
00375             pfIndexTech = gtRecord->gtPrescaleFactorIndexTech();
00376 
00377             validRecord = true;
00378 
00379         } else {
00380 
00381             m_globalNrErrors[m_physicsDaqPartition]++;
00382 
00383             edm::LogWarning("L1GtTrigReport") << "\n  L1GlobalTriggerRecord with input tag "
00384                     << m_l1GtRecordInputTag.label() << " not found."
00385                     << "\n  Event classified as Error\n\n"
00386                     << std::endl;
00387 
00388         }
00389 
00390     } else {
00391         if (gtReadoutRecord.isValid()) {
00392 
00393             // check if the readout record has size greater than zero, then proceeds
00394             const std::vector<L1GtFdlWord>& fdlVec = gtReadoutRecord->gtFdlVector();
00395             size_t fdlVecSize = fdlVec.size();
00396 
00397             if (fdlVecSize > 0) {
00398 
00399                 LogDebug("L1GtTrigReport") << "\n  L1GlobalTriggerReadoutRecord with input tag "
00400                         << m_l1GtRecordInputTag.label() << " has gtFdlVector of size " << fdlVecSize
00401                         << std::endl;
00402 
00403                 // get Global Trigger finalOR and the decision word
00404                 boost::uint16_t gtFinalOR = gtReadoutRecord->finalOR();
00405 
00406                 gtDecisionWordBeforeMask = gtReadoutRecord->decisionWord();
00407                 technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
00408 
00409                 for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00410 
00411                     bool gtDecision = static_cast<bool>(gtFinalOR & ( 1 << iDaqPartition ));
00412                     if (gtDecision) {
00413                         m_globalNrAccepts[iDaqPartition]++;
00414                     }
00415 
00416                 }
00417 
00418                 pfIndexAlgo
00419                         = static_cast<unsigned int>( ( gtReadoutRecord->gtFdlWord() ).gtPrescaleFactorIndexAlgo());
00420                 pfIndexTech
00421                         = static_cast<unsigned int>( ( gtReadoutRecord->gtFdlWord() ).gtPrescaleFactorIndexTech());
00422 
00423                 validRecord = true;
00424 
00425             } else {
00426 
00427                 for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00428                     m_globalNrErrors[iDaqPartition]++;
00429                 }
00430 
00431                 edm::LogWarning("L1GtTrigReport") << "\n  L1GlobalTriggerReadoutRecord with input tag "
00432                         << m_l1GtRecordInputTag.label() << " has gtFdlVector of size " << fdlVecSize
00433                         << "\n  Invalid L1GlobalTriggerReadoutRecord!"
00434                         << "\n  Event classified as Error\n\n"
00435                         << std::endl;
00436 
00437                 validRecord = false;
00438 
00439             }
00440 
00441         } else {
00442 
00443             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00444                 m_globalNrErrors[iDaqPartition]++;
00445             }
00446 
00447             edm::LogWarning("L1GtTrigReport") << "\n  L1GlobalTriggerReadoutRecord with input tag "
00448                     << m_l1GtRecordInputTag.label() << " not found."
00449                     << "\n  Event classified as Error\n\n"
00450                     << std::endl;
00451 
00452         }
00453 
00454     }
00455 
00456     // get the prescale factor set used in the actual luminosity segment
00457     const std::vector<int>& prescaleFactorsAlgoTrig =
00458             ( *m_prescaleFactorsAlgoTrig ).at(pfIndexAlgo);
00459 
00460     const std::vector<int>& prescaleFactorsTechTrig =
00461             ( *m_prescaleFactorsTechTrig ).at(pfIndexTech);
00462 
00463 
00464     if (validRecord) {
00465 
00466         // loop over algorithms and increase the corresponding counters
00467         for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
00468 
00469             std::string algName = itAlgo->first;
00470             int algBitNumber = ( itAlgo->second ).algoBitNumber();
00471 
00472             // the result before applying the trigger masks is available
00473             // in both L1GlobalTriggerReadoutRecord or L1GlobalTriggerRecord
00474             bool algResultBeforeMask = gtDecisionWordBeforeMask[algBitNumber];
00475 
00476             int prescaleFactor = prescaleFactorsAlgoTrig.at(algBitNumber);
00477 
00478             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00479 
00480                 unsigned int triggerMask = ( m_triggerMaskAlgoTrig.at(algBitNumber) ) & ( 1
00481                         << iDaqPartition );
00482 
00483                 bool algResultAfterMask = false;
00484 
00485                 if (m_useL1GlobalTriggerRecord) {
00486                     if (iDaqPartition == m_physicsDaqPartition) {
00487                         // result available already for physics DAQ partition
00488                         // in lite record
00489                         algResultAfterMask = gtDecisionWordAfterMask[algBitNumber];
00490                     } else {
00491                         // apply the masks for other partitions
00492                         algResultAfterMask = algResultBeforeMask;
00493 
00494                         if (triggerMask) {
00495                             algResultAfterMask = false;
00496                         }
00497                     }
00498                 } else {
00499                     // apply the masks for L1GlobalTriggerReadoutRecord
00500                     algResultAfterMask = algResultBeforeMask;
00501 
00502                     if (triggerMask) {
00503                         algResultAfterMask = false;
00504                     }
00505                 }
00506 
00507                 L1GtTrigReportEntry* entryRep = new L1GtTrigReportEntry(
00508                         menuName, algName, prescaleFactor, triggerMask, iDaqPartition);
00509 
00510                 int iCount = 0;
00511 
00512                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00513                     if ( ( *entryRep ) == * ( *itEntry )) {
00514                         iCount++;
00515                         // increase the corresponding counter in the list entry
00516                         ( *itEntry )->addValidEntry(algResultAfterMask, algResultBeforeMask);
00517                     }
00518                 }
00519 
00520                 if (iCount == 0) {
00521                     // if entry not in the list, increase the corresponding counter
00522                     // and push the entry in the list
00523                     entryRep->addValidEntry(algResultAfterMask, algResultBeforeMask);
00524                     m_entryList.push_back(entryRep);
00525                 } else {
00526                     delete entryRep;
00527                 }
00528             }
00529         }
00530 
00531         // loop over technical triggers and increase the corresponding counters
00532         for (CItAlgo itAlgo = technicalTriggerMap.begin(); itAlgo != technicalTriggerMap.end(); itAlgo++) {
00533         //for (unsigned int iTechTrig = 0; iTechTrig < m_numberTechnicalTriggers; ++iTechTrig) {
00534 
00535             std::string ttName = itAlgo->first;
00536             int ttBitNumber = ( itAlgo->second ).algoBitNumber();
00537             // std::string ttName = boost::lexical_cast<std::string>(iTechTrig);
00538             // int ttBitNumber = iTechTrig;
00539 
00540             // the result before applying the trigger masks is available
00541             // in both L1GlobalTriggerReadoutRecord or L1GlobalTriggerRecord
00542             bool ttResultBeforeMask = technicalTriggerWordBeforeMask[ttBitNumber];
00543 
00544             int prescaleFactor = prescaleFactorsTechTrig.at(ttBitNumber);
00545 
00546             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00547 
00548                 unsigned int triggerMask = ( m_triggerMaskTechTrig.at(ttBitNumber) ) & ( 1
00549                         << iDaqPartition );
00550 
00551                 bool ttResultAfterMask = false;
00552 
00553                 if (m_useL1GlobalTriggerRecord) {
00554                     if (iDaqPartition == m_physicsDaqPartition) {
00555                         // result available already for physics DAQ partition
00556                         // in lite record
00557                         ttResultAfterMask = technicalTriggerWordAfterMask[ttBitNumber];
00558                     } else {
00559                         // apply the masks for other partitions
00560                         ttResultAfterMask = ttResultBeforeMask;
00561 
00562                         if (triggerMask) {
00563                             ttResultAfterMask = false;
00564                         }
00565                     }
00566                 } else {
00567                     // apply the masks for L1GlobalTriggerReadoutRecord
00568                     ttResultAfterMask = ttResultBeforeMask;
00569 
00570                     if (triggerMask) {
00571                         ttResultAfterMask = false;
00572                     }
00573                 }
00574 
00575                 L1GtTrigReportEntry* entryRep = new L1GtTrigReportEntry(
00576                         menuName, ttName, prescaleFactor, triggerMask, iDaqPartition);
00577 
00578                 int iCount = 0;
00579 
00580                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00581                         != m_entryListTechTrig.end(); itEntry++) {
00582                     if ( ( *entryRep ) == * ( *itEntry )) {
00583                         iCount++;
00584                         // increase the corresponding counter in the list entry
00585                         ( *itEntry )->addValidEntry(ttResultAfterMask, ttResultBeforeMask);
00586                     }
00587                 }
00588 
00589                 if (iCount == 0) {
00590                     // if entry not in the list, increase the corresponding counter
00591                     // and push the entry in the list
00592                     entryRep->addValidEntry(ttResultAfterMask, ttResultBeforeMask);
00593                     m_entryListTechTrig.push_back(entryRep);
00594                 } else {
00595                     delete entryRep;
00596                 }
00597             }
00598         }
00599 
00600     } else {
00601 
00602         // loop over algorithms and increase the error counters
00603         for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
00604 
00605             std::string algName = itAlgo->first;
00606             int algBitNumber = ( itAlgo->second ).algoBitNumber();
00607 
00608             int prescaleFactor = prescaleFactorsAlgoTrig.at(algBitNumber);
00609 
00610             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00611 
00612                 unsigned int triggerMask = ( m_triggerMaskAlgoTrig.at(algBitNumber) ) & ( 1
00613                         << iDaqPartition );
00614 
00615                 L1GtTrigReportEntry* entryRep = new L1GtTrigReportEntry(
00616                         menuName, algName, prescaleFactor, triggerMask, iDaqPartition);
00617 
00618                 int iCount = 0;
00619 
00620                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00621 
00622                     if ( ( *entryRep ) == * ( *itEntry )) {
00623                         iCount++;
00624                         // increase the corresponding counter in the list entry
00625                         ( *itEntry )->addErrorEntry();
00626                     }
00627                 }
00628 
00629                 if (iCount == 0) {
00630                     // if entry not in the list, increase the corresponding counter
00631                     // and push the entry in the list
00632                     entryRep->addErrorEntry();
00633                     m_entryList.push_back(entryRep);
00634                 } else {
00635                     delete entryRep;
00636                 }
00637             }
00638 
00639         }
00640 
00641         // loop over technical triggers and increase the error counters
00642         // FIXME move to names when technical triggers available in menu
00643         //for (CItAlgo itAlgo = technicalTriggerMap.begin(); itAlgo != technicalTriggerMap.end(); itAlgo++) {
00644         for (unsigned int iTechTrig = 0; iTechTrig < m_numberTechnicalTriggers; ++iTechTrig) {
00645 
00646             //std::string ttName = itAlgo->first;
00647             //int ttBitNumber = ( itAlgo->second ).algoBitNumber();
00648             std::string ttName = boost::lexical_cast<std::string>(iTechTrig);
00649             int ttBitNumber = iTechTrig;
00650 
00651             int prescaleFactor = prescaleFactorsTechTrig.at(ttBitNumber);
00652 
00653             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00654 
00655                 unsigned int triggerMask = ( m_triggerMaskTechTrig.at(ttBitNumber) ) & ( 1
00656                         << iDaqPartition );
00657 
00658                 L1GtTrigReportEntry* entryRep = new L1GtTrigReportEntry(
00659                         menuName, ttName, prescaleFactor, triggerMask, iDaqPartition);
00660 
00661                 int iCount = 0;
00662 
00663                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00664                         != m_entryListTechTrig.end(); itEntry++) {
00665 
00666                     if ( ( *entryRep ) == * ( *itEntry )) {
00667                         iCount++;
00668                         // increase the corresponding counter in the list entry
00669                         ( *itEntry )->addErrorEntry();
00670                     }
00671                 }
00672 
00673                 if (iCount == 0) {
00674                     // if entry not in the list, increase the corresponding counter
00675                     // and push the entry in the list
00676                     entryRep->addErrorEntry();
00677                     m_entryListTechTrig.push_back(entryRep);
00678                 } else {
00679                     delete entryRep;
00680                 }
00681             }
00682 
00683         }
00684 
00685     }
00686 
00687 }
00688 
00689 // method called once each job just after ending the event loop
00690 void L1GtTrigReport::endJob() {
00691 
00692     // define an output stream to print into
00693     // it can then be directed to whatever log level is desired
00694     std::ostringstream myCout;
00695 
00696     myCout << std::dec << std::endl;
00697     myCout << "L1T-Report " << "----------       Event Summary       ----------\n";
00698     myCout << "L1T-Report " << "Total number of events processed: " << m_totalEvents << "\n";
00699     myCout << "L1T-Report\n";
00700 
00701     myCout
00702         << "\n"
00703         << "   DAQ partition "
00704         << "           Total "
00705         << " Passed[finalOR] "
00706         << "        Rejected "
00707         << "          Errors "
00708         << "\n" << std::endl;
00709 
00710     for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00711 
00712         int rejectedEvents = m_totalEvents - m_globalNrErrors[iDaqPartition]
00713                 - m_globalNrAccepts[iDaqPartition];
00714 
00715         if (m_useL1GlobalTriggerRecord && ( iDaqPartition != m_physicsDaqPartition )) {
00716             continue;
00717         } else {
00718 
00719             myCout
00720                 << std::right << std::setw(16) << iDaqPartition << " "
00721                 << std::right << std::setw(16) << m_totalEvents << " "
00722                 << std::right << std::setw(16) << m_globalNrAccepts[iDaqPartition] << " "
00723                 << std::right << std::setw(16) << rejectedEvents << " "
00724                 << std::right << std::setw(16) << m_globalNrErrors[iDaqPartition] << std::endl;
00725 
00726         }
00727 
00728     }
00729 
00730     // get the list of menus for the sample analyzed
00731     //
00732     std::set<std::string> menuList;
00733     typedef std::set<std::string>::const_iterator CItL1Menu;
00734 
00735     for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00736         menuList.insert( ( *itEntry )->gtTriggerMenuName());
00737     }
00738 
00739     myCout
00740             << "\nThe following L1 menus were used for this sample: " << std::endl;
00741     for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
00742         myCout << "  " << ( *itMenu ) << std::endl;
00743     }
00744     myCout << "\n" << std::endl;
00745 
00746     switch (m_printVerbosity) {
00747         case 0: {
00748 
00749             myCout
00750                 << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
00751                 << m_physicsDaqPartition << "----------\n\n";
00752 
00753             myCout
00754                 << "\n\n Number of events written after applying L1 prescale factors"
00755                 << " and trigger masks\n" << " if not explicitly mentioned.\n\n";
00756 
00757             for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
00758 
00759                 myCout << "\nReport for L1 menu:  " << (*itMenu) << "\n"
00760                         << std::endl;
00761 
00762                 myCout
00763                     << std::right << std::setw(45) << "Algorithm Key" << " "
00764                     << std::right << std::setw(10) << "Passed" << " "
00765                     << std::right << std::setw(10) << "Rejected" << " "
00766                     << std::right << std::setw(10) << "Error"
00767                     << "\n";
00768 
00769                 for (CItEntry itEntry = m_entryList.begin(); itEntry
00770                         != m_entryList.end(); itEntry++) {
00771 
00772                     if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition)
00773                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
00774 
00775                         myCout
00776                             << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " "
00777                             << std::right << std::setw(10) << (*itEntry)->gtNrEventsAccept() << " "
00778                             << std::right << std::setw(10) << (*itEntry)->gtNrEventsReject() << " "
00779                             << std::right << std::setw(10) << (*itEntry)->gtNrEventsError()
00780                             << "\n";
00781                     }
00782 
00783                 }
00784 
00785                 myCout
00786                     << "\n\n"
00787                     << std::right << std::setw(45) << "Technical Trigger Key" << " "
00788                     << std::right << std::setw(10) << "Passed" << " "
00789                     << std::right << std::setw(10) << "Rejected" << " "
00790                     << std::right << std::setw(10) << "Error"
00791                     << "\n";
00792 
00793                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00794                         != m_entryListTechTrig.end(); itEntry++) {
00795 
00796                     if (((*itEntry)->gtDaqPartition() == m_physicsDaqPartition)
00797                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
00798 
00799                         myCout
00800                             << std::right << std::setw(45) << (*itEntry)->gtAlgoName() << " "
00801                             << std::right << std::setw(10) << (*itEntry)->gtNrEventsAccept() << " "
00802                             << std::right << std::setw(10) << (*itEntry)->gtNrEventsReject() << " "
00803                             << std::right << std::setw(10) << (*itEntry)->gtNrEventsError()
00804                             << "\n";
00805                     }
00806 
00807                 }
00808             }
00809 
00810         }
00811 
00812             break;
00813         case 1: {
00814 
00815             myCout << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
00816                     << m_physicsDaqPartition << "----------\n\n";
00817 
00818             myCout << "\n\n Number of events written after applying L1 prescale factors"
00819                     << " and trigger masks\n" << " if not explicitly mentioned.\n\n";
00820 
00821             for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
00822 
00823                 myCout << "\nReport for L1 menu:  " << (*itMenu) << "\n"
00824                         << std::endl;
00825                 myCout
00826                     << std::right << std::setw(45) << "Algorithm Key" << " "
00827                     << std::right << std::setw(10) << "Prescale" << " "
00828                     << std::right << std::setw(5)  << "Mask" << " "
00829                     << std::right << std::setw(10) << "Passed" << " "
00830                     << std::right << std::setw(10) << "Rejected" << " "
00831                     << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00832                     << "\n";
00833 
00834                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00835 
00836                     if ( (( *itEntry )->gtDaqPartition() == m_physicsDaqPartition)
00837                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
00838                         myCout
00839                             << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
00840                             << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << "    "
00841                             << std::right << std::setw(2) //<< std::setfill('0')
00842                             << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
00843                             << std::dec << " "
00844                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00845                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00846                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00847                             << "\n";
00848                     }
00849                 }
00850 
00851                 myCout
00852                     << "\n\n"
00853                     << std::right << std::setw(45) << "Technical Trigger Key" << " "
00854                     << std::right << std::setw(10) << "Prescale" << " "
00855                     << std::right << std::setw(5)  << "Mask" << " "
00856                     << std::right << std::setw(10) << "Passed" << " "
00857                     << std::right << std::setw(10) << "Rejected" << " "
00858                     << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00859                     << "\n";
00860 
00861                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
00862 
00863                     if ( (( *itEntry )->gtDaqPartition() == m_physicsDaqPartition)
00864                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
00865                         myCout
00866                             << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
00867                             << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << "    "
00868                             << std::right << std::setw(2) //<< std::setfill('0')
00869                             << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
00870                             << std::dec << " "
00871                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00872                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00873                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00874                             << "\n";
00875                     }
00876                 }
00877             }
00878 
00879         }
00880 
00881             break;
00882         case 2: {
00883 
00884 
00885             for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
00886 
00887                 myCout << "\nReport for L1 menu:  " << ( *itMenu ) << "\n"
00888                         << std::endl;
00889 
00890                 myCout
00891                     << std::right << std::setw(45) << "Algorithm Key" << " "
00892                     << std::right << std::setw(10) << "Passed" << " "
00893                     << std::right << std::setw(10) << "Rejected" << " "
00894                     << std::right << std::setw(10) << "Error" << "\n";
00895 
00896                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00897 
00898                     if ( ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition )
00899                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
00900 
00901                         int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
00902                         int nrEventsReject = ( *itEntry )->gtNrEventsReject();
00903                         int nrEventsError = ( *itEntry )->gtNrEventsError();
00904 
00905                         myCout
00906                             << std::right << std::setw(45) << (( *itEntry )->gtAlgoName()) << " "
00907                             << std::right << std::setw(10) << nrEventsAccept << " "
00908                             << std::right << std::setw(10) << nrEventsReject << " "
00909                             << std::right << std::setw(10) << nrEventsError << "\n";
00910 
00911                     }
00912                 }
00913 
00914                 // efficiency and its statistical error
00915 
00916                 myCout << "\n\n"
00917                     << std::right << std::setw(45) << "Algorithm Key" << "    "
00918                     << std::right << std::setw(10) << "Efficiency " << " "
00919                     << std::right << std::setw(10) << "Stat error (%)" << "\n";
00920 
00921                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00922 
00923                     if ( ( ( *itEntry )->gtDaqPartition() == 0 )
00924                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
00925 
00926                         int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
00927                         int nrEventsReject = ( *itEntry )->gtNrEventsReject();
00928                         int nrEventsError = ( *itEntry )->gtNrEventsError();
00929 
00930                         int totalEvents = nrEventsAccept + nrEventsReject + nrEventsError;
00931 
00932                         // efficiency and their statistical error
00933                         float eff = 0.;
00934                         float statErrEff = 0.;
00935 
00936                         if (totalEvents != 0) {
00937                             eff = static_cast<float> (nrEventsAccept)
00938                                     / static_cast<float> (totalEvents);
00939                             statErrEff = sqrt(eff * ( 1.0 - eff )
00940                                     / static_cast<float> (totalEvents));
00941 
00942                         }
00943 
00944                         myCout
00945                             << std::right << std::setw(45) << (( *itEntry )->gtAlgoName()) << " "
00946                             << std::right << std::setw(10) << std::fixed << std::setprecision(2)
00947                             << 100.*eff << " +- "
00948                             << std::right << std::setw(10) << std::setprecision(2)
00949                             << 100.*statErrEff << "\n";
00950 
00951 
00952                     }
00953 
00954                 }
00955 
00956                 myCout
00957                     << "\n\n"
00958                     << std::right << std::setw(45) << "Technical Trigger Key" << " "
00959                     << std::right << std::setw(10) << "Passed" << " "
00960                     << std::right << std::setw(10) << "Rejected" << " "
00961                     << std::right << std::setw(10) << "Error" << "\n";
00962 
00963                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00964                         != m_entryListTechTrig.end(); itEntry++) {
00965 
00966                     if ( ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition )
00967                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
00968 
00969                         int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
00970                         int nrEventsReject = ( *itEntry )->gtNrEventsReject();
00971                         int nrEventsError = ( *itEntry )->gtNrEventsError();
00972 
00973                         myCout
00974                             << std::right << std::setw(45) << (( *itEntry )->gtAlgoName()) << " "
00975                             << std::right << std::setw(10) << nrEventsAccept << " "
00976                             << std::right << std::setw(10) << nrEventsReject << " "
00977                             << std::right << std::setw(10) << nrEventsError << "\n";
00978 
00979                     }
00980                 }
00981 
00982                 // efficiency and its statistical error
00983 
00984                 myCout << "\n\n"
00985                     << std::right << std::setw(45) << "Technical Trigger Key" << "    "
00986                     << std::right << std::setw(10) << "Efficiency " << " "
00987                     << std::right << std::setw(10) << "Stat error (%)" << "\n";
00988 
00989                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00990                         != m_entryListTechTrig.end(); itEntry++) {
00991 
00992                     if ( ( ( *itEntry )->gtDaqPartition() == 0 )
00993                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
00994 
00995                         int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
00996                         int nrEventsReject = ( *itEntry )->gtNrEventsReject();
00997                         int nrEventsError = ( *itEntry )->gtNrEventsError();
00998 
00999                         int totalEvents = nrEventsAccept + nrEventsReject + nrEventsError;
01000 
01001                         // efficiency and their statistical error
01002                         float eff = 0.;
01003                         float statErrEff = 0.;
01004 
01005                         if (totalEvents != 0) {
01006                             eff = static_cast<float> (nrEventsAccept)
01007                                     / static_cast<float> (totalEvents);
01008                             statErrEff = sqrt(eff * ( 1.0 - eff )
01009                                     / static_cast<float> (totalEvents));
01010 
01011                         }
01012 
01013                         myCout
01014                             << std::right << std::setw(45) << (( *itEntry )->gtAlgoName()) << " "
01015                             << std::right << std::setw(10) << std::fixed << std::setprecision(2)
01016                             << 100.*eff << " +- "
01017                             << std::right << std::setw(10) << std::setprecision(2)
01018                             << 100.*statErrEff << "\n";
01019 
01020 
01021                     }
01022 
01023                 }
01024 
01025             }
01026 
01027 
01028         }
01029             break;
01030 
01031         case 10: {
01032 
01033             myCout << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
01034                     << m_physicsDaqPartition << "----------\n\n";
01035 
01036             for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
01037 
01038                 myCout << "\nReport for L1 menu:  " << ( *itMenu ) << "\n"
01039                         << std::endl;
01040                 myCout
01041                     << std::right << std::setw(45) << "Algorithm Key" << " "
01042                     << std::right << std::setw(10) << "Prescale" << "  "
01043                     << std::right << std::setw(5)  << "Mask" << " "
01044                     << std::right << std::setw(25) << "Before Mask" << " "
01045                     << std::right << std::setw(30) << "After Mask" << " "
01046                     << std::right << std::setw(22) << "Error"
01047                     << "\n"
01048                     << std::right << std::setw(64) << " " << std::setw(15) << "Passed"
01049                     << std::right << std::setw(1)  << " " << std::setw(15) << "Rejected"
01050                     << std::right << std::setw(1)  << " " << std::setw(15) << "Passed"
01051                     << std::right << std::setw(1)  << " " << std::setw(15) << "Rejected"
01052                     << "\n";
01053 
01054                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
01055 
01056                     if ( (( *itEntry )->gtDaqPartition() == m_physicsDaqPartition)
01057                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
01058                         myCout
01059                             << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
01060                             << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
01061                             << std::right << std::setw(5)  << " " << std::hex << ( *itEntry )->gtTriggerMask() << std::dec << " "
01062                             << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAcceptBeforeMask() << " "
01063                             << std::right << std::setw(15) << ( *itEntry )->gtNrEventsRejectBeforeMask() << " "
01064                             << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAccept() << " "
01065                             << std::right << std::setw(15) << ( *itEntry )->gtNrEventsReject() << " "
01066                             << std::right << std::setw(15) << ( *itEntry )->gtNrEventsError()
01067                             << "\n";
01068                     }
01069                 }
01070 
01071                 myCout
01072                     << "\n\n"
01073                     << std::right << std::setw(45) << "Technical Trigger Key" << " "
01074                     << std::right << std::setw(10) << "Prescale" << "  "
01075                     << std::right << std::setw(5)  << "Mask" << " "
01076                     << std::right << std::setw(25) << "Before Mask" << " "
01077                     << std::right << std::setw(30) << "After Mask" << " "
01078                     << std::right << std::setw(22) << "Error"
01079                     << "\n"
01080                     << std::right << std::setw(64) << " " << std::setw(15) << "Passed"
01081                     << std::right << std::setw(1)  << " " << std::setw(15) << "Rejected"
01082                     << std::right << std::setw(1)  << " " << std::setw(15) << "Passed"
01083                     << std::right << std::setw(1)  << " " << std::setw(15) << "Rejected"
01084                     << "\n";
01085 
01086                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
01087 
01088                     if ( (( *itEntry )->gtDaqPartition() == m_physicsDaqPartition)
01089                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
01090                         myCout
01091                             << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
01092                             << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
01093                             << std::right << std::setw(5)  << " " << std::hex << ( *itEntry )->gtTriggerMask() << std::dec << " "
01094                             << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAcceptBeforeMask() << " "
01095                             << std::right << std::setw(15) << ( *itEntry )->gtNrEventsRejectBeforeMask() << " "
01096                             << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAccept() << " "
01097                             << std::right << std::setw(15) << ( *itEntry )->gtNrEventsReject() << " "
01098                             << std::right << std::setw(15) << ( *itEntry )->gtNrEventsError()
01099                             << "\n";
01100                     }
01101                 }
01102             }
01103         }
01104 
01105             break;
01106         case 100: {
01107 
01108             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
01109 
01110                 myCout << "\nL1T-Report "
01111                         << "---------- L1 Trigger Global Summary - DAQ Partition " << iDaqPartition
01112                         << " " << "----------\n\n";
01113 
01114                 myCout
01115                     << std::right << std::setw(45) << "Algorithm Key" << " "
01116                     << std::right << std::setw(10) << "Passed" << " "
01117                     << std::right << std::setw(10) << "Rejected" << " "
01118                     << std::right << std::setw(10) << "Error" << std::setw(2) << " "
01119                     << "\n";
01120 
01121                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
01122 
01123                     if ( (( *itEntry )->gtDaqPartition() == 0)) {
01124 
01125                         myCout
01126                             << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
01127                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
01128                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
01129                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
01130                             << "\n";
01131                     }
01132 
01133                 }
01134 
01135                 myCout
01136                     << "\n\n"
01137                     << std::right << std::setw(45) << "Technical Trigger Key" << " "
01138                     << std::right << std::setw(10) << "Passed" << " "
01139                     << std::right << std::setw(10) << "Rejected" << " "
01140                     << std::right << std::setw(10) << "Error" << std::setw(2) << " "
01141                     << "\n";
01142 
01143                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
01144 
01145                     if ( ( *itEntry )->gtDaqPartition() == 0) {
01146 
01147                         myCout
01148                             << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
01149                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
01150                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
01151                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
01152                             << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
01153                             << "\n";
01154                     }
01155 
01156                 }
01157 
01158             }
01159         }
01160 
01161             break;
01162         case 101: {
01163 
01164             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
01165 
01166                 myCout << "\nL1T-Report "
01167                         << "---------- L1 Trigger Global Summary - DAQ Partition " << iDaqPartition
01168                         << " " << "----------\n\n";
01169 
01170                 myCout
01171                     << std::right << std::setw(45) << "Algorithm Key" << " "
01172                     << std::right << std::setw(10) << "Prescale" << " "
01173                     << std::right << std::setw(5)  << "Mask" << " "
01174                     << std::right << std::setw(10) << "Passed" << " "
01175                     << std::right << std::setw(10) << "Rejected" << " "
01176                     << std::right << std::setw(10) << "Error" << std::setw(2) << " "
01177                     << "\n";
01178 
01179                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
01180 
01181                     if ( ( *itEntry )->gtDaqPartition() == 0) {
01182                         myCout
01183                             << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
01184                             << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << "   "
01185                             << std::right << std::setw(2) //<< std::setfill('0')
01186                             << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
01187                             << std::dec << " "
01188                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
01189                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
01190                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
01191                             << "\n";
01192                     }
01193                 }
01194 
01195                 myCout
01196                     << "\n\n"
01197                     << std::right << std::setw(45) << "Technical Trigger Key" << " "
01198                     << std::right << std::setw(10) << "Prescale" << " "
01199                     << std::right << std::setw(5)  << "Mask" << " "
01200                     << std::right << std::setw(10) << "Passed" << " "
01201                     << std::right << std::setw(10) << "Rejected" << " "
01202                     << std::right << std::setw(10) << "Error" << std::setw(2) << " "
01203                     << "\n";
01204 
01205                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
01206 
01207                     if ( ( *itEntry )->gtDaqPartition() == 0) {
01208                         myCout
01209                             << std::right << std::setw(45) << ( *itEntry )->gtAlgoName() << " "
01210                             << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << "   "
01211                             << std::right << std::setw(2) //<< std::setfill('0')
01212                             << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
01213                             << std::dec << " "
01214                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
01215                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
01216                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
01217                             << "\n";
01218                     }
01219                 }
01220 
01221             }
01222         }
01223 
01224             break;
01225         default: {
01226             myCout
01227                 << "\n\nL1GtTrigReport: Error - no print verbosity level = " << m_printVerbosity
01228                 << " defined! \nCheck available values in the cfi file." << "\n";
01229         }
01230 
01231             break;
01232     }
01233 
01234     // TODO for other verbosity levels
01235     // print the trigger menu, the prescale factors and the trigger mask, etc
01236 
01237 
01238     myCout << std::endl;
01239     myCout << "L1T-Report end!" << std::endl;
01240     myCout << std::endl;
01241 
01242     switch (m_printOutput) {
01243         case 0: {
01244 
01245             std::cout << myCout.str() << std::endl;
01246 
01247         }
01248 
01249             break;
01250         case 1: {
01251 
01252             LogTrace("L1GtTrigReport") << myCout.str() << std::endl;
01253 
01254         }
01255             break;
01256 
01257         case 2: {
01258 
01259             edm::LogVerbatim("L1GtTrigReport") << myCout.str() << std::endl;
01260 
01261         }
01262 
01263             break;
01264         case 3: {
01265 
01266             edm::LogInfo("L1GtTrigReport") << myCout.str();
01267 
01268         }
01269 
01270             break;
01271         default: {
01272             std::cout
01273                 << "\n\n  L1GtTrigReport: Error - no print output = " << m_printOutput
01274                 << " defined! \n  Check available values in the cfi file." << "\n" << std::endl;
01275 
01276         }
01277             break;
01278     }
01279 
01280 }
01281