CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/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         // FIXME move to names when technical triggers available in menu
00533         //for (CItAlgo itAlgo = technicalTriggerMap.begin(); itAlgo != technicalTriggerMap.end(); itAlgo++) {
00534         for (unsigned int iTechTrig = 0; iTechTrig < m_numberTechnicalTriggers; ++iTechTrig) {
00535 
00536             //std::string ttName = itAlgo->first;
00537             //int ttBitNumber = ( itAlgo->second ).algoBitNumber();
00538             std::string ttName = boost::lexical_cast<std::string>(iTechTrig);
00539             int ttBitNumber = iTechTrig;
00540 
00541             // the result before applying the trigger masks is available
00542             // in both L1GlobalTriggerReadoutRecord or L1GlobalTriggerRecord
00543             bool ttResultBeforeMask = technicalTriggerWordBeforeMask[ttBitNumber];
00544 
00545             int prescaleFactor = prescaleFactorsTechTrig.at(ttBitNumber);
00546 
00547             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00548 
00549                 unsigned int triggerMask = ( m_triggerMaskTechTrig.at(ttBitNumber) ) & ( 1
00550                         << iDaqPartition );
00551 
00552                 bool ttResultAfterMask = false;
00553 
00554                 if (m_useL1GlobalTriggerRecord) {
00555                     if (iDaqPartition == m_physicsDaqPartition) {
00556                         // result available already for physics DAQ partition
00557                         // in lite record
00558                         ttResultAfterMask = technicalTriggerWordAfterMask[ttBitNumber];
00559                     } else {
00560                         // apply the masks for other partitions
00561                         ttResultAfterMask = ttResultBeforeMask;
00562 
00563                         if (triggerMask) {
00564                             ttResultAfterMask = false;
00565                         }
00566                     }
00567                 } else {
00568                     // apply the masks for L1GlobalTriggerReadoutRecord
00569                     ttResultAfterMask = ttResultBeforeMask;
00570 
00571                     if (triggerMask) {
00572                         ttResultAfterMask = false;
00573                     }
00574                 }
00575 
00576                 L1GtTrigReportEntry* entryRep = new L1GtTrigReportEntry(
00577                         menuName, ttName, prescaleFactor, triggerMask, iDaqPartition);
00578 
00579                 int iCount = 0;
00580 
00581                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00582                         != m_entryListTechTrig.end(); itEntry++) {
00583                     if ( ( *entryRep ) == * ( *itEntry )) {
00584                         iCount++;
00585                         // increase the corresponding counter in the list entry
00586                         ( *itEntry )->addValidEntry(ttResultAfterMask, ttResultBeforeMask);
00587                     }
00588                 }
00589 
00590                 if (iCount == 0) {
00591                     // if entry not in the list, increase the corresponding counter
00592                     // and push the entry in the list
00593                     entryRep->addValidEntry(ttResultAfterMask, ttResultBeforeMask);
00594                     m_entryListTechTrig.push_back(entryRep);
00595                 } else {
00596                     delete entryRep;
00597                 }
00598             }
00599         }
00600 
00601     } else {
00602 
00603         // loop over algorithms and increase the error counters
00604         for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
00605 
00606             std::string algName = itAlgo->first;
00607             int algBitNumber = ( itAlgo->second ).algoBitNumber();
00608 
00609             int prescaleFactor = prescaleFactorsAlgoTrig.at(algBitNumber);
00610 
00611             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00612 
00613                 unsigned int triggerMask = ( m_triggerMaskAlgoTrig.at(algBitNumber) ) & ( 1
00614                         << iDaqPartition );
00615 
00616                 L1GtTrigReportEntry* entryRep = new L1GtTrigReportEntry(
00617                         menuName, algName, prescaleFactor, triggerMask, iDaqPartition);
00618 
00619                 int iCount = 0;
00620 
00621                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00622 
00623                     if ( ( *entryRep ) == * ( *itEntry )) {
00624                         iCount++;
00625                         // increase the corresponding counter in the list entry
00626                         ( *itEntry )->addErrorEntry();
00627                     }
00628                 }
00629 
00630                 if (iCount == 0) {
00631                     // if entry not in the list, increase the corresponding counter
00632                     // and push the entry in the list
00633                     entryRep->addErrorEntry();
00634                     m_entryList.push_back(entryRep);
00635                 } else {
00636                     delete entryRep;
00637                 }
00638             }
00639 
00640         }
00641 
00642         // loop over technical triggers and increase the error counters
00643         // FIXME move to names when technical triggers available in menu
00644         //for (CItAlgo itAlgo = technicalTriggerMap.begin(); itAlgo != technicalTriggerMap.end(); itAlgo++) {
00645         for (unsigned int iTechTrig = 0; iTechTrig < m_numberTechnicalTriggers; ++iTechTrig) {
00646 
00647             //std::string ttName = itAlgo->first;
00648             //int ttBitNumber = ( itAlgo->second ).algoBitNumber();
00649             std::string ttName = boost::lexical_cast<std::string>(iTechTrig);
00650             int ttBitNumber = iTechTrig;
00651 
00652             int prescaleFactor = prescaleFactorsTechTrig.at(ttBitNumber);
00653 
00654             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00655 
00656                 unsigned int triggerMask = ( m_triggerMaskTechTrig.at(ttBitNumber) ) & ( 1
00657                         << iDaqPartition );
00658 
00659                 L1GtTrigReportEntry* entryRep = new L1GtTrigReportEntry(
00660                         menuName, ttName, prescaleFactor, triggerMask, iDaqPartition);
00661 
00662                 int iCount = 0;
00663 
00664                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00665                         != m_entryListTechTrig.end(); itEntry++) {
00666 
00667                     if ( ( *entryRep ) == * ( *itEntry )) {
00668                         iCount++;
00669                         // increase the corresponding counter in the list entry
00670                         ( *itEntry )->addErrorEntry();
00671                     }
00672                 }
00673 
00674                 if (iCount == 0) {
00675                     // if entry not in the list, increase the corresponding counter
00676                     // and push the entry in the list
00677                     entryRep->addErrorEntry();
00678                     m_entryListTechTrig.push_back(entryRep);
00679                 } else {
00680                     delete entryRep;
00681                 }
00682             }
00683 
00684         }
00685 
00686     }
00687 
00688 }
00689 
00690 // method called once each job just after ending the event loop
00691 void L1GtTrigReport::endJob() {
00692 
00693     // define an output stream to print into
00694     // it can then be directed to whatever log level is desired
00695     std::ostringstream myCout;
00696 
00697     myCout << std::dec << std::endl;
00698     myCout << "L1T-Report " << "----------       Event Summary       ----------\n";
00699     myCout << "L1T-Report " << "Total number of events processed: " << m_totalEvents << "\n";
00700     myCout << "L1T-Report\n";
00701 
00702     myCout
00703         << "\n"
00704         << "   DAQ partition "
00705         << "           Total "
00706         << " Passed[finalOR] "
00707         << "        Rejected "
00708         << "          Errors "
00709         << "\n" << std::endl;
00710 
00711     for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
00712 
00713         int rejectedEvents = m_totalEvents - m_globalNrErrors[iDaqPartition]
00714                 - m_globalNrAccepts[iDaqPartition];
00715 
00716         if (m_useL1GlobalTriggerRecord && ( iDaqPartition != m_physicsDaqPartition )) {
00717             continue;
00718         } else {
00719 
00720             myCout
00721                 << std::right << std::setw(16) << iDaqPartition << " "
00722                 << std::right << std::setw(16) << m_totalEvents << " "
00723                 << std::right << std::setw(16) << m_globalNrAccepts[iDaqPartition] << " "
00724                 << std::right << std::setw(16) << rejectedEvents << " "
00725                 << std::right << std::setw(16) << m_globalNrErrors[iDaqPartition] << std::endl;
00726 
00727         }
00728 
00729     }
00730 
00731     switch (m_printVerbosity) {
00732         case 0: {
00733 
00734             myCout
00735                 << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
00736                 << m_physicsDaqPartition << "----------\n\n";
00737 
00738             myCout
00739                 << "\n\n Number of events written after applying L1 prescale factors"
00740                 << " and trigger masks\n" << " if not explicitly mentioned.\n\n";
00741 
00742             myCout
00743                 << std::right << std::setw(35) << "Algorithm Key" << " "
00744                 << std::right << std::setw(10) << "Passed" << " "
00745                 << std::right << std::setw(10) << "Rejected" << " "
00746                 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00747                 << std::right << std::setw(20) << "Trigger Menu Key"
00748                 << "\n";
00749 
00750             for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00751 
00752                 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
00753 
00754                     myCout
00755                         << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00756                         << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00757                         << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00758                         << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00759                         << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00760                         << "\n";
00761                 }
00762 
00763             }
00764 
00765             myCout
00766                 << "\n\n"
00767                 << std::right << std::setw(35) << "Technical Trigger Key" << " "
00768                 << std::right << std::setw(10) << "Passed" << " "
00769                 << std::right << std::setw(10) << "Rejected" << " "
00770                 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00771                 << std::right << std::setw(20) << "Trigger Menu Key"
00772                 << "\n";
00773 
00774             for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00775                     != m_entryListTechTrig.end(); itEntry++) {
00776 
00777                 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
00778 
00779                     myCout
00780                         << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
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 
00790         }
00791 
00792             break;
00793         case 1: {
00794 
00795             myCout << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
00796                     << m_physicsDaqPartition << "----------\n\n";
00797 
00798             myCout << "\n\n Number of events written after applying L1 prescale factors"
00799                     << " and trigger masks\n" << " if not explicitly mentioned.\n\n";
00800 
00801             myCout
00802                 << std::right << std::setw(35) << "Algorithm Key" << " "
00803                 << std::right << std::setw(10) << "Prescale" << " "
00804                 << std::right << std::setw(5)  << "Mask" << " "
00805                 << std::right << std::setw(10) << "Passed" << " "
00806                 << std::right << std::setw(10) << "Rejected" << " "
00807                 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00808                 << std::right << std::setw(20) << "Trigger Menu Key"
00809                 << "\n";
00810 
00811             for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00812 
00813                 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
00814                     myCout
00815                         << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00816                         << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << "    "
00817                         << std::right << std::setw(2) //<< std::setfill('0')
00818                         << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
00819                         << std::dec << " "
00820                         << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00821                         << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00822                         << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00823                         << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00824                         << "\n";
00825                 }
00826             }
00827 
00828             myCout
00829                 << "\n\n"
00830                 << std::right << std::setw(35) << "Technical Trigger Key" << " "
00831                 << std::right << std::setw(10) << "Prescale" << " "
00832                 << std::right << std::setw(5)  << "Mask" << " "
00833                 << std::right << std::setw(10) << "Passed" << " "
00834                 << std::right << std::setw(10) << "Rejected" << " "
00835                 << std::right << std::setw(10) << "Error" << std::setw(2) << " "
00836                 << std::right << std::setw(20) << "Trigger Menu Key"
00837                 << "\n";
00838 
00839             for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
00840 
00841                 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
00842                     myCout
00843                         << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
00844                         << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << "    "
00845                         << std::right << std::setw(2) //<< std::setfill('0')
00846                         << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
00847                         << std::dec << " "
00848                         << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
00849                         << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
00850                         << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
00851                         << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
00852                         << "\n";
00853                 }
00854             }
00855 
00856         }
00857 
00858             break;
00859         case 2: {
00860 
00861             // get the list of menus for the sample analyzed
00862             //
00863             std::set<std::string> menuList;
00864             typedef std::set<std::string>::const_iterator CItL1Menu;
00865 
00866             for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00867                 menuList.insert( ( *itEntry )->gtTriggerMenuName());
00868             }
00869 
00870             myCout
00871                     << "\nThe following L1 menus were used for this sample: " << std::endl;
00872             for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
00873                 myCout << "  " << ( *itMenu ) << std::endl;
00874             }
00875             myCout << "\n" << std::endl;
00876 
00877             for (CItL1Menu itMenu = menuList.begin(); itMenu != menuList.end(); itMenu++) {
00878 
00879                 myCout << "Report for L1 menu:  " << ( *itMenu ) << "\n"
00880                         << std::endl;
00881 
00882                 myCout
00883                     << std::right << std::setw(35) << "Algorithm Key" << " "
00884                     << std::right << std::setw(10) << "Passed" << " "
00885                     << std::right << std::setw(10) << "Rejected" << " "
00886                     << std::right << std::setw(10) << "Error" << "\n";
00887 
00888                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00889 
00890                     if ( ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition )
00891                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
00892 
00893                         int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
00894                         int nrEventsReject = ( *itEntry )->gtNrEventsReject();
00895                         int nrEventsError = ( *itEntry )->gtNrEventsError();
00896 
00897                         myCout
00898                             << std::right << std::setw(35) << (( *itEntry )->gtAlgoName()) << " "
00899                             << std::right << std::setw(10) << nrEventsAccept << " "
00900                             << std::right << std::setw(10) << nrEventsReject << " "
00901                             << std::right << std::setw(10) << nrEventsError << "\n";
00902 
00903                     }
00904                 }
00905 
00906                 // efficiency and its statistical error
00907 
00908                 myCout << "\n\n"
00909                     << std::right << std::setw(35) << "Algorithm Key" << "    "
00910                     << std::right << std::setw(10) << "Efficiency " << " "
00911                     << std::right << std::setw(10) << "Stat error (%)" << "\n";
00912 
00913                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
00914 
00915                     if ( ( ( *itEntry )->gtDaqPartition() == 0 ) && ( ( *itEntry )->gtTriggerMenuName()
00916                             == *itMenu )) {
00917 
00918                         int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
00919                         int nrEventsReject = ( *itEntry )->gtNrEventsReject();
00920                         int nrEventsError = ( *itEntry )->gtNrEventsError();
00921 
00922                         int totalEvents = nrEventsAccept + nrEventsReject + nrEventsError;
00923 
00924                         // efficiency and their statistical error
00925                         float eff = 0.;
00926                         float statErrEff = 0.;
00927 
00928                         if (totalEvents != 0) {
00929                             eff = static_cast<float> (nrEventsAccept)
00930                                     / static_cast<float> (totalEvents);
00931                             statErrEff = sqrt(eff * ( 1.0 - eff )
00932                                     / static_cast<float> (totalEvents));
00933 
00934                         }
00935 
00936                         myCout
00937                             << std::right << std::setw(35) << (( *itEntry )->gtAlgoName()) << " "
00938                             << std::right << std::setw(10) << std::fixed << std::setprecision(2)
00939                             << 100.*eff << " +- "
00940                             << std::right << std::setw(10) << std::setprecision(2)
00941                             << 100.*statErrEff << "\n";
00942 
00943 
00944                     }
00945 
00946                 }
00947 
00948                 myCout
00949                     << "\n\n"
00950                     << std::right << std::setw(35) << "Technical Trigger Key" << " "
00951                     << std::right << std::setw(10) << "Passed" << " "
00952                     << std::right << std::setw(10) << "Rejected" << " "
00953                     << std::right << std::setw(10) << "Error" << "\n";
00954 
00955                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00956                         != m_entryListTechTrig.end(); itEntry++) {
00957 
00958                     if ( ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition )
00959                             && ( ( *itEntry )->gtTriggerMenuName() == *itMenu )) {
00960 
00961                         int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
00962                         int nrEventsReject = ( *itEntry )->gtNrEventsReject();
00963                         int nrEventsError = ( *itEntry )->gtNrEventsError();
00964 
00965                         myCout
00966                             << std::right << std::setw(35) << (( *itEntry )->gtAlgoName()) << " "
00967                             << std::right << std::setw(10) << nrEventsAccept << " "
00968                             << std::right << std::setw(10) << nrEventsReject << " "
00969                             << std::right << std::setw(10) << nrEventsError << "\n";
00970 
00971                     }
00972                 }
00973 
00974                 // efficiency and its statistical error
00975 
00976                 myCout << "\n\n"
00977                     << std::right << std::setw(35) << "Technical Trigger Key" << "    "
00978                     << std::right << std::setw(10) << "Efficiency " << " "
00979                     << std::right << std::setw(10) << "Stat error (%)" << "\n";
00980 
00981                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry
00982                         != m_entryListTechTrig.end(); itEntry++) {
00983 
00984                     if ( ( ( *itEntry )->gtDaqPartition() == 0 ) && ( ( *itEntry )->gtTriggerMenuName()
00985                             == *itMenu )) {
00986 
00987                         int nrEventsAccept = ( *itEntry )->gtNrEventsAccept();
00988                         int nrEventsReject = ( *itEntry )->gtNrEventsReject();
00989                         int nrEventsError = ( *itEntry )->gtNrEventsError();
00990 
00991                         int totalEvents = nrEventsAccept + nrEventsReject + nrEventsError;
00992 
00993                         // efficiency and their statistical error
00994                         float eff = 0.;
00995                         float statErrEff = 0.;
00996 
00997                         if (totalEvents != 0) {
00998                             eff = static_cast<float> (nrEventsAccept)
00999                                     / static_cast<float> (totalEvents);
01000                             statErrEff = sqrt(eff * ( 1.0 - eff )
01001                                     / static_cast<float> (totalEvents));
01002 
01003                         }
01004 
01005                         myCout
01006                             << std::right << std::setw(35) << (( *itEntry )->gtAlgoName()) << " "
01007                             << std::right << std::setw(10) << std::fixed << std::setprecision(2)
01008                             << 100.*eff << " +- "
01009                             << std::right << std::setw(10) << std::setprecision(2)
01010                             << 100.*statErrEff << "\n";
01011 
01012 
01013                     }
01014 
01015                 }
01016 
01017             }
01018 
01019 
01020         }
01021             break;
01022 
01023         case 10: {
01024 
01025             myCout << "\nL1T-Report " << "---------- L1 Trigger Global Summary - DAQ Partition "
01026                     << m_physicsDaqPartition << "----------\n\n";
01027 
01028             myCout
01029                 << std::right << std::setw(35) << "Algorithm Key" << " "
01030                 << std::right << std::setw(10) << "Prescale" << " "
01031                 << std::right << std::setw(5)  << "Mask" << " "
01032                 << std::right << std::setw(15) << "Before Mask" << " "
01033                 << std::right << std::setw(15) << "After Mask" << " "
01034                 << std::right << std::setw(15) << "Error" << std::setw(2) << " "
01035                 << std::right << std::setw(20) << "Trigger Menu Key"
01036                 << "\n"
01037                 << std::right << std::setw(53) << " " << std::setw(15) << "Passed" << " "
01038                 << std::right << std::setw(15) << "Passed" << " " << "\n"
01039                 << std::right << std::setw(53) << " " << std::setw(15) << "Rejected" << " "
01040                 << std::right << std::setw(15) << "Rejected" << " "
01041                 << "\n";
01042 
01043             for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
01044 
01045                 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
01046                     myCout
01047                         << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
01048                         << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
01049                         << std::right << std::setw(3) << " " << std::setw(2) //<< std::setfill('0')
01050                         << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
01051                         << std::dec << " "
01052                         << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAcceptBeforeMask() << " "
01053                         << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAccept() << " "
01054                         << std::right << std::setw(15) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
01055                         << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
01056                         << "\n"
01057                         << std::right << std::setw(53) << " "
01058                         << std::right << std::setw(15) << ( *itEntry )->gtNrEventsRejectBeforeMask() << " "
01059                         << std::right << std::setw(15) << ( *itEntry )->gtNrEventsReject()
01060                         << "\n";
01061                 }
01062             }
01063 
01064             myCout
01065                 << "\n\n"
01066                 << std::right << std::setw(35) << "Technical Trigger Key" << " "
01067                 << std::right << std::setw(10) << "Prescale" << " "
01068                 << std::right << std::setw(5)  << "Mask" << " "
01069                 << std::right << std::setw(15) << "Before Mask" << " "
01070                 << std::right << std::setw(15) << "After Mask" << " "
01071                 << std::right << std::setw(15) << "Error" << std::setw(2) << " "
01072                 << std::right << std::setw(20) << "Trigger Menu Key"
01073                 << "\n"
01074                 << std::right << std::setw(53) << " " << std::setw(15) << "Passed" << " "
01075                 << std::right << std::setw(15) << "Passed" << " "
01076                 << "\n"
01077                 << std::right << std::setw(53) << " " << std::setw(15) << "Rejected" << " "
01078                 << std::right << std::setw(15) << "Rejected" << " "
01079                 << "\n";
01080 
01081             for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
01082 
01083                 if ( ( *itEntry )->gtDaqPartition() == m_physicsDaqPartition) {
01084                     myCout
01085                     << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
01086                     << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << " "
01087                     << std::right << std::setw(3) << " " << std::setw(2) //<< std::setfill('0')
01088                     << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
01089                     << std::dec << " "
01090                     << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAcceptBeforeMask() << " "
01091                     << std::right << std::setw(15) << ( *itEntry )->gtNrEventsAccept() << " "
01092                     << std::right << std::setw(15) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
01093                     << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
01094                     << "\n"
01095                     << std::right << std::setw(53) << " "
01096                     << std::right << std::setw(15) << ( *itEntry )->gtNrEventsRejectBeforeMask() << " "
01097                     << std::right << std::setw(15) << ( *itEntry )->gtNrEventsReject()
01098                     << "\n";
01099                 }
01100             }
01101         }
01102 
01103             break;
01104         case 100: {
01105 
01106             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
01107 
01108                 myCout << "\nL1T-Report "
01109                         << "---------- L1 Trigger Global Summary - DAQ Partition " << iDaqPartition
01110                         << " " << "----------\n\n";
01111 
01112                 myCout
01113                     << std::right << std::setw(35) << "Algorithm Key" << " "
01114                     << std::right << std::setw(10) << "Passed" << " "
01115                     << std::right << std::setw(10) << "Rejected" << " "
01116                     << std::right << std::setw(10) << "Error" << std::setw(2) << " "
01117                     << std::right << std::setw(20) << "Trigger Menu Key"
01118                     << "\n";
01119 
01120                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
01121 
01122                     if ( ( *itEntry )->gtDaqPartition() == 0) {
01123 
01124                         myCout
01125                             << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
01126                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
01127                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
01128                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
01129                             << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
01130                             << "\n";
01131                     }
01132 
01133                 }
01134 
01135                 myCout
01136                     << "\n\n"
01137                     << std::right << std::setw(35) << "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                     << std::right << std::setw(20) << "Trigger Menu Key"
01142                     << "\n";
01143 
01144                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
01145 
01146                     if ( ( *itEntry )->gtDaqPartition() == 0) {
01147 
01148                         myCout
01149                             << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
01150                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
01151                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
01152                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
01153                             << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
01154                             << "\n";
01155                     }
01156 
01157                 }
01158 
01159             }
01160         }
01161 
01162             break;
01163         case 101: {
01164 
01165             for (unsigned int iDaqPartition = 0; iDaqPartition < m_numberDaqPartitions; ++iDaqPartition) {
01166 
01167                 myCout << "\nL1T-Report "
01168                         << "---------- L1 Trigger Global Summary - DAQ Partition " << iDaqPartition
01169                         << " " << "----------\n\n";
01170 
01171                 myCout
01172                     << std::right << std::setw(35) << "Algorithm Key" << " "
01173                     << std::right << std::setw(10) << "Prescale" << " "
01174                     << std::right << std::setw(5)  << "Mask" << " "
01175                     << std::right << std::setw(10) << "Passed" << " "
01176                     << std::right << std::setw(10) << "Rejected" << " "
01177                     << std::right << std::setw(10) << "Error" << std::setw(2) << " "
01178                     << std::right << std::setw(20) << "Trigger Menu Key"
01179                     << "\n";
01180 
01181                 for (CItEntry itEntry = m_entryList.begin(); itEntry != m_entryList.end(); itEntry++) {
01182 
01183                     if ( ( *itEntry )->gtDaqPartition() == 0) {
01184                         myCout
01185                             << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
01186                             << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << "   "
01187                             << std::right << std::setw(2) //<< std::setfill('0')
01188                             << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
01189                             << std::dec << " "
01190                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
01191                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
01192                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
01193                             << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
01194                             << "\n";
01195                     }
01196                 }
01197 
01198                 myCout
01199                     << "\n\n"
01200                     << std::right << std::setw(35) << "Technical Trigger Key" << " "
01201                     << std::right << std::setw(10) << "Prescale" << " "
01202                     << std::right << std::setw(5)  << "Mask" << " "
01203                     << std::right << std::setw(10) << "Passed" << " "
01204                     << std::right << std::setw(10) << "Rejected" << " "
01205                     << std::right << std::setw(10) << "Error" << std::setw(2) << " "
01206                     << std::right << std::setw(20) << "Trigger Menu Key"
01207                     << "\n";
01208 
01209                 for (CItEntry itEntry = m_entryListTechTrig.begin(); itEntry != m_entryListTechTrig.end(); itEntry++) {
01210 
01211                     if ( ( *itEntry )->gtDaqPartition() == 0) {
01212                         myCout
01213                             << std::right << std::setw(35) << ( *itEntry )->gtAlgoName() << " "
01214                             << std::right << std::setw(10) << ( *itEntry )->gtPrescaleFactor() << "   "
01215                             << std::right << std::setw(2) //<< std::setfill('0')
01216                             << std::hex << ( *itEntry )->gtTriggerMask() //<< std::setfill(' ')
01217                             << std::dec << " "
01218                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsAccept() << " "
01219                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsReject() << " "
01220                             << std::right << std::setw(10) << ( *itEntry )->gtNrEventsError() << std::setw(2) << " "
01221                             << std::right << std::setw(20) << ( *itEntry )->gtTriggerMenuName()
01222                             << "\n";
01223                     }
01224                 }
01225 
01226             }
01227         }
01228 
01229             break;
01230         default: {
01231             myCout
01232                 << "\n\nL1GtTrigReport: Error - no print verbosity level = " << m_printVerbosity
01233                 << " defined! \nCheck available values in the cfi file." << "\n";
01234         }
01235 
01236             break;
01237     }
01238 
01239     // TODO for other verbosity levels
01240     // print the trigger menu, the prescale factors and the trigger mask, etc
01241 
01242 
01243     myCout << std::endl;
01244     myCout << "L1T-Report end!" << std::endl;
01245     myCout << std::endl;
01246 
01247     switch (m_printOutput) {
01248         case 0: {
01249 
01250             std::cout << myCout.str() << std::endl;
01251 
01252         }
01253 
01254             break;
01255         case 1: {
01256 
01257             LogTrace("L1GtTrigReport") << myCout.str() << std::endl;
01258 
01259         }
01260             break;
01261 
01262         case 2: {
01263 
01264             edm::LogVerbatim("L1GtTrigReport") << myCout.str() << std::endl;
01265 
01266         }
01267 
01268             break;
01269         case 3: {
01270 
01271             edm::LogInfo("L1GtTrigReport") << myCout.str();
01272 
01273         }
01274 
01275             break;
01276         default: {
01277             std::cout
01278                 << "\n\n  L1GtTrigReport: Error - no print output = " << m_printOutput
01279                 << " defined! \n  Check available values in the cfi file." << "\n" << std::endl;
01280 
01281         }
01282             break;
01283     }
01284 
01285 }
01286