CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/L1Trigger/GlobalTriggerAnalyzer/src/L1GtAnalyzer.cc

Go to the documentation of this file.
00001 
00017 // this class header
00018 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtAnalyzer.h"
00019 
00020 // system include files
00021 #include <memory>
00022 #include <iomanip>
00023 
00024 // user include files
00025 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
00026 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
00027 
00028 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
00029 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerRecord.h"
00030 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h"
00031 
00032 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMap.h"
00033 
00034 #include "DataFormats/L1GlobalTrigger/interface/L1GtTriggerMenuLite.h"
00035 
00036 #include "DataFormats/Common/interface/ConditionsInEdm.h"
00037 
00038 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"
00039 
00040 #include "L1Trigger/GlobalTrigger/interface/L1GlobalTrigger.h"
00041 #include "L1Trigger/GlobalTrigger/interface/L1GlobalTriggerPSB.h"
00042 #include "L1Trigger/GlobalTrigger/interface/L1GlobalTriggerGTL.h"
00043 #include "L1Trigger/GlobalTrigger/interface/L1GlobalTriggerFDL.h"
00044 
00045 #include "FWCore/Framework/interface/ESHandle.h"
00046 #include "FWCore/Framework/interface/LuminosityBlock.h"
00047 
00048 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
00049 #include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
00050 
00051 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00052 
00053 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h"
00054 
00055 // constructor(s)
00056 L1GtAnalyzer::L1GtAnalyzer(const edm::ParameterSet& parSet) :
00057 
00058             // input tag for GT DAQ product
00059             m_l1GtDaqReadoutRecordInputTag(parSet.getParameter<edm::InputTag>(
00060                     "L1GtDaqReadoutRecordInputTag")),
00061 
00062             // input tag for GT lite product
00063             m_l1GtRecordInputTag(parSet.getParameter<edm::InputTag>(
00064                     "L1GtRecordInputTag")),
00065 
00066             // input tag for GT object map collection
00067             m_l1GtObjectMapTag(parSet.getParameter<edm::InputTag>(
00068                     "L1GtObjectMapTag")),
00069 
00070             // input tag for muon collection from GMT
00071             m_l1GmtInputTag(parSet.getParameter<edm::InputTag>(
00072                     "L1GmtInputTag")),
00073 
00074             // input tag for L1GtTriggerMenuLite
00075             m_l1GtTmLInputTag(parSet.getParameter<edm::InputTag> (
00076                     "L1GtTmLInputTag")),
00077 
00078             // input tag for ConditionInEdm products
00079             m_condInEdmInputTag(parSet.getParameter<edm::InputTag> (
00080                             "CondInEdmInputTag")),
00081 
00082             // an algorithm and a condition in that algorithm to test the object maps
00083             m_nameAlgTechTrig(parSet.getParameter<std::string> ("AlgorithmName")),
00084             m_condName(parSet.getParameter<std::string> ("ConditionName")),
00085             m_bitNumber(parSet.getParameter<unsigned int> ("BitNumber")),
00086 
00087             m_l1GtUtilsConfiguration(parSet.getParameter<unsigned int> ("L1GtUtilsConfiguration")),
00088             m_l1GtTmLInputTagProv(parSet.getParameter<bool> ("L1GtTmLInputTagProv"))
00089 
00090 {
00091     LogDebug("L1GtAnalyzer")
00092             << "\n Input parameters for L1 GT test analyzer"
00093             << "\n   L1 GT DAQ product:            "
00094             << m_l1GtDaqReadoutRecordInputTag
00095             << "\n   L1 GT lite product:           "
00096             << m_l1GtRecordInputTag
00097             << "\n   L1 GT object map collection:  "
00098             << m_l1GtObjectMapTag
00099             << "\n   Muon collection from GMT:     "
00100             << m_l1GmtInputTag
00101             << "\n   L1 trigger menu lite product: "
00102             << m_l1GtTmLInputTag
00103             << "\n   Algorithm name or alias, technical trigger name:  " << m_nameAlgTechTrig
00104             << "\n   Condition, if a physics algorithm is requested:   " << m_condName
00105             << "\n   Bit number for an algorithm or technical trigger: " << m_bitNumber
00106             << "\n   Requested L1 trigger configuration: " << m_l1GtUtilsConfiguration
00107             << "\n   Retrieve input tag from provenance for L1 trigger menu lite in the L1GtUtils: "
00108             << m_l1GtTmLInputTagProv
00109             << " \n" << std::endl;
00110 
00111 }
00112 
00113 // destructor
00114 L1GtAnalyzer::~L1GtAnalyzer() {
00115 
00116     // empty
00117 
00118 }
00119 
00120 // method called once each job just before starting event loop
00121 void L1GtAnalyzer::beginJob()
00122 {
00123 
00124     // empty
00125 
00126 }
00127 
00128 void L1GtAnalyzer::beginRun(const edm::Run& iRun,
00129         const edm::EventSetup& evSetup) {
00130 
00131     analyzeConditionsInRunBlock(iRun, evSetup);
00132 
00133 }
00134 
00135 void L1GtAnalyzer::beginLuminosityBlock(const edm::LuminosityBlock& iLumi,
00136         const edm::EventSetup& evSetup) {
00137 
00138     analyzeConditionsInLumiBlock(iLumi, evSetup);
00139 
00140 }
00141 
00142 
00143 // member functions
00144 
00145 // analyze: decision and decision word
00146 //   bunch cross in event BxInEvent = 0 - L1Accept event
00147 void L1GtAnalyzer::analyzeDecisionReadoutRecord(const edm::Event& iEvent, const edm::EventSetup& evSetup)
00148 {
00149 
00150     LogDebug("L1GtAnalyzer")
00151     << "\n**** L1GtAnalyzer::analyzeDecisionReadoutRecord ****\n"
00152     << std::endl;
00153 
00154     // define an output stream to print into
00155     // it can then be directed to whatever log level is desired
00156     std::ostringstream myCoutStream;
00157 
00158     // get L1GlobalTriggerReadoutRecord
00159     edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecord;
00160     iEvent.getByLabel(m_l1GtDaqReadoutRecordInputTag, gtReadoutRecord);
00161 
00162     if (!gtReadoutRecord.isValid()) {
00163 
00164         LogDebug("L1GtAnalyzer") << "\nL1GlobalTriggerReadoutRecord with \n  "
00165                 << m_l1GtDaqReadoutRecordInputTag
00166                 << "\nrequested in configuration, but not found in the event."
00167                 << "\nExit the method.\n" << std::endl;
00168 
00169         return;
00170     }
00171 
00172     // get Global Trigger decision and the decision word
00173     bool gtDecision = gtReadoutRecord->decision();
00174     DecisionWord gtDecisionWord = gtReadoutRecord->decisionWord();
00175 
00176     // print Global Trigger decision and the decision word
00177     edm::LogVerbatim("L1GtAnalyzer")
00178     << "\n GlobalTrigger decision: " << gtDecision << std::endl;
00179 
00180     // print via supplied "print" function (
00181     gtReadoutRecord->printGtDecision(myCoutStream);
00182 
00183     // print technical trigger word via supplied "print" function
00184     gtReadoutRecord->printTechnicalTrigger(myCoutStream);
00185 
00186     LogDebug("L1GtAnalyzer") << myCoutStream.str() << std::endl;
00187 
00188     myCoutStream.str("");
00189     myCoutStream.clear();
00190 
00191 }
00192 
00193 // analyze: decision for a given algorithm via trigger menu
00194 void L1GtAnalyzer::analyzeDecisionLiteRecord(const edm::Event& iEvent,
00195         const edm::EventSetup& evSetup) {
00196 
00197     LogDebug("L1GtAnalyzer")
00198     << "\n**** L1GtAnalyzer::analyzeDecisionLiteRecord ****\n"
00199     << std::endl;
00200 
00201     edm::Handle<L1GlobalTriggerRecord> gtRecord;
00202     iEvent.getByLabel(m_l1GtRecordInputTag, gtRecord);
00203 
00204     if (!gtRecord.isValid()) {
00205 
00206         LogDebug("L1GtAnalyzer") << "\nL1GlobalTriggerRecord with \n  "
00207                 << m_l1GtRecordInputTag
00208                 << "\nrequested in configuration, but not found in the event."
00209                 << "\nExit the method.\n" << std::endl;
00210 
00211         return;
00212 
00213     }
00214 
00215     const DecisionWord gtDecisionWord = gtRecord->decisionWord();
00216 
00217     edm::ESHandle<L1GtTriggerMenu> l1GtMenu;
00218     evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu) ;
00219     const L1GtTriggerMenu* m_l1GtMenu = l1GtMenu.product();
00220 
00221     const bool algResult = m_l1GtMenu->gtAlgorithmResult(m_nameAlgTechTrig,
00222             gtDecisionWord);
00223 
00224     edm::LogVerbatim("L1GtAnalyzer") << "\nResult for algorithm " << m_nameAlgTechTrig
00225             << ": " << algResult << "\n" << std::endl;
00226 
00227 }
00228 
00229 void L1GtAnalyzer::analyzeL1GtUtilsCore(const edm::Event& iEvent,
00230         const edm::EventSetup& evSetup) {
00231 
00232 
00233     // define an output stream to print into
00234     // it can then be directed to whatever log level is desired
00235     std::ostringstream myCoutStream;
00236 
00237 
00238     // example to access L1 trigger results using public methods from L1GtUtils
00239     // all must be called after one or both of the commands retrieving the L1 configuration
00240     //   m_l1GtUtils.retrieveL1EventSetup(evSetup);
00241     //   m_l1GtUtils.retrieveL1GtTriggerMenuLite(iEvent, m_l1GtTmLInputTag);
00242     //
00243     //
00244 
00245     // testing which environment is used
00246 
00247     int iErrorCode = -1;
00248     int l1ConfCode = -1;
00249 
00250     const bool l1Conf = m_l1GtUtils.availableL1Configuration(iErrorCode, l1ConfCode);
00251 
00252     myCoutStream << "\nL1 configuration code: \n"
00253             << "\n Legend: "
00254             << "\n      0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only"
00255             << "\n  10000     L1GtTriggerMenuLite product is valid"
00256             << "\n  99999     L1GtTriggerMenuLite product not valid. Error."
00257             << "\n"
00258             << "\n 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup."
00259             << "\n 110000     L1GtTriggerMenuLite product is valid"
00260             << "\n 120000     L1GtTriggerMenuLite product not valid, event setup valid."
00261             << "\n 199999     L1GtTriggerMenuLite product not valid, event setup not valid. Error."
00262             << "\n"
00263             << "\n 200000 - Retrieve L1 trigger configuration from event setup only."
00264             << "\n 210000     Event setup valid."
00265             << "\n 299999     Event setup not valid. Error."
00266             << "\n"
00267             << "\n 300000 - No L1 trigger configuration requested to be retrieved. Error"
00268             << "\n            Must call before using L1GtUtils methods at least one of the following:"
00269             << "\n            retrieveL1GtTriggerMenuLite or retrieveL1EventSetup.\n"
00270 
00271            << std::endl;
00272 
00273 
00274     if (l1Conf) {
00275         myCoutStream << "\nL1 configuration code:" << l1ConfCode
00276                 << "\nValid L1 trigger configuration." << std::endl;
00277 
00278         myCoutStream << "\nL1 trigger menu name and implementation:" << "\n"
00279                 << m_l1GtUtils.l1TriggerMenu() << "\n"
00280                 << m_l1GtUtils.l1TriggerMenuImplementation() << std::endl;
00281 
00282     } else {
00283         myCoutStream << "\nL1 configuration code:" << l1ConfCode
00284                 << "\nNo valid L1 trigger configuration available."
00285                 << "\nSee text above for error code interpretation"
00286                 << "\nNo return here, in order to test each method, protected against configuration error."
00287                 << std::endl;
00288     }
00289 
00290 
00291 
00292     myCoutStream
00293             << "\n******** Results found with input tags retrieved from provenance ******** \n"
00294             << std::endl;
00295 
00296     //
00297     // no input tags; for the appropriate EDM product, it will be found
00298     // from provenance
00299 
00300     // the following methods share the same error code, therefore one can check only once
00301     // the validity of the result
00302 
00303     iErrorCode = -1;
00304 
00305     bool decisionBeforeMaskAlgTechTrig = m_l1GtUtils.decisionBeforeMask(iEvent,
00306             m_nameAlgTechTrig, iErrorCode);
00307 
00308     bool decisionAfterMaskAlgTechTrig = m_l1GtUtils.decisionAfterMask(iEvent,
00309             m_nameAlgTechTrig, iErrorCode);
00310 
00311     bool decisionAlgTechTrig = m_l1GtUtils.decision(iEvent, m_nameAlgTechTrig,
00312             iErrorCode);
00313 
00314     int prescaleFactorAlgTechTrig = m_l1GtUtils.prescaleFactor(iEvent,
00315             m_nameAlgTechTrig, iErrorCode);
00316 
00317     int triggerMaskAlgTechTrig = m_l1GtUtils.triggerMask(iEvent,
00318             m_nameAlgTechTrig, iErrorCode);
00319 
00320     myCoutStream << "\n\nMethods:"
00321             << "\n  decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
00322             << "\n  decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
00323             << "\n  decision(iEvent, m_nameAlgTechTrig, iErrorCode)"
00324             << "\n  prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode)"
00325             << "\n  triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
00326             << "\n  triggerMask(m_nameAlgTechTrig,iErrorCode)"
00327             << "\n\n" << std::endl;
00328 
00329 
00330     if (iErrorCode == 0) {
00331         myCoutStream << "\nDecision before trigger mask for "
00332                 << m_nameAlgTechTrig << ":   " << decisionBeforeMaskAlgTechTrig
00333                 << std::endl;
00334         myCoutStream << "Decision after trigger mask for " << m_nameAlgTechTrig
00335                 << ":    " << decisionAfterMaskAlgTechTrig << std::endl;
00336         myCoutStream << "Decision (after trigger mask) for "
00337                 << m_nameAlgTechTrig << ":  " << decisionAlgTechTrig
00338                 << std::endl;
00339 
00340         myCoutStream << "Prescale factor for " << m_nameAlgTechTrig
00341                 << ":                " << prescaleFactorAlgTechTrig
00342                 << std::endl;
00343 
00344         myCoutStream << "Trigger mask for " << m_nameAlgTechTrig
00345                 << ":                   " << triggerMaskAlgTechTrig
00346                 << std::endl;
00347 
00348     } else if (iErrorCode == 1) {
00349         myCoutStream << "\n" << m_nameAlgTechTrig
00350                 << " does not exist in the L1 menu "
00351                 << m_l1GtUtils.l1TriggerMenu() << "\n" << std::endl;
00352 
00353     } else {
00354         myCoutStream << "\nError: "
00355                 << "\n  An error was encountered when retrieving decision, mask and prescale factor for "
00356                 << m_nameAlgTechTrig << "\n  L1 Menu: "
00357                 << m_l1GtUtils.l1TriggerMenu() << "\n  Error code: "
00358                 << iErrorCode << std::endl;
00359 
00360     }
00361 
00362     // another method to get the trigger mask (no common errorCode)
00363 
00364     iErrorCode = -1;
00365     triggerMaskAlgTechTrig = m_l1GtUtils.triggerMask(m_nameAlgTechTrig,
00366             iErrorCode);
00367 
00368     if (iErrorCode == 0) {
00369         myCoutStream << "\nTrigger mask for " << m_nameAlgTechTrig
00370                 << "(faster method):    " << triggerMaskAlgTechTrig
00371                 << std::endl;
00372 
00373     } else if (iErrorCode == 1) {
00374         myCoutStream << "\n" << m_nameAlgTechTrig
00375                 << " does not exist in the L1 menu "
00376                 << m_l1GtUtils.l1TriggerMenu() << "\n" << std::endl;
00377 
00378     } else {
00379         myCoutStream << "\nError: "
00380                 << "\n  An error was encountered when fast retrieving trigger mask for "
00381                 << m_nameAlgTechTrig << "\n  L1 Menu: "
00382                 << m_l1GtUtils.l1TriggerMenu() << "\n  Error code: "
00383                 << iErrorCode << std::endl;
00384 
00385     }
00386 
00387     // index of the actual prescale factor set, and the actual prescale
00388     // factor set for algorithm triggers
00389 
00390 
00391 
00392     L1GtUtils::TriggerCategory trigCategory = L1GtUtils::AlgorithmTrigger;
00393 
00394     myCoutStream << "\nMethods:"
00395             << "\n  prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
00396             << "\n  prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
00397             << std::endl;
00398 
00399     iErrorCode = -1;
00400     const int pfSetIndexAlgorithmTrigger = m_l1GtUtils.prescaleFactorSetIndex(
00401             iEvent, trigCategory, iErrorCode);
00402 
00403     if (iErrorCode == 0) {
00404         myCoutStream
00405                 << "\nAlgorithm triggers: index for prescale factor set = "
00406                 << pfSetIndexAlgorithmTrigger << "\nfor run " << iEvent.run()
00407                 << ", luminosity block " << iEvent.luminosityBlock()
00408                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00409                 << std::endl;
00410 
00411 
00412     } else {
00413         myCoutStream
00414                 << "\nError encountered when retrieving the prescale factor set index"
00415                 << "\n  for algorithm triggers, for run " << iEvent.run()
00416                 << ", luminosity block " << iEvent.luminosityBlock()
00417                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00418                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00419     }
00420 
00421     iErrorCode = -1;
00422     const std::vector<int>& pfSetAlgorithmTrigger =
00423             m_l1GtUtils.prescaleFactorSet(iEvent, trigCategory, iErrorCode);
00424 
00425     if (iErrorCode == 0) {
00426         myCoutStream << "\nAlgorithm triggers: prescale factor set index = "
00427                 << pfSetIndexAlgorithmTrigger << "\nfor run " << iEvent.run()
00428                 << ", luminosity block " << iEvent.luminosityBlock()
00429                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00430                 << std::endl;
00431 
00432         int iBit = -1;
00433         for (std::vector<int>::const_iterator cItBit =
00434                 pfSetAlgorithmTrigger.begin(); cItBit
00435                 != pfSetAlgorithmTrigger.end(); ++cItBit) {
00436 
00437             iBit++;
00438             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
00439                     << ": prescale factor = " << (*cItBit) << std::endl;
00440 
00441         }
00442 
00443     } else {
00444         myCoutStream
00445                 << "\nError encountered when retrieving the prescale factor set "
00446                 << "\n  for algorithm triggers, for run " << iEvent.run()
00447                 << ", luminosity block " << iEvent.luminosityBlock()
00448                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00449                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00450     }
00451 
00452     // the actual trigger mask set for algorithm triggers
00453 
00454     myCoutStream << "\nMethod:"
00455             << "\n  triggerMaskSet(trigCategory, iErrorCode)"
00456             << std::endl;
00457 
00458     iErrorCode = -1;
00459     const std::vector<unsigned int>& tmSetAlgorithmTrigger =
00460             m_l1GtUtils.triggerMaskSet(trigCategory, iErrorCode);
00461 
00462     if (iErrorCode == 0) {
00463         myCoutStream << "\nAlgorithm triggers: trigger mask set for run "
00464                 << iEvent.run() << ", luminosity block "
00465                 << iEvent.luminosityBlock() << ", with L1 menu \n  "
00466                 << m_l1GtUtils.l1TriggerMenu() << "\n" << std::endl;
00467 
00468         int iBit = -1;
00469         for (std::vector<unsigned int>::const_iterator cItBit =
00470                 tmSetAlgorithmTrigger.begin(); cItBit
00471                 != tmSetAlgorithmTrigger.end(); ++cItBit) {
00472 
00473             iBit++;
00474             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
00475                     << ": trigger mask = " << (*cItBit) << std::endl;
00476 
00477         }
00478 
00479     } else {
00480         myCoutStream
00481                 << "\nError encountered when retrieving the trigger mask set "
00482                 << "\n  for algorithm triggers, for run " << iEvent.run()
00483                 << ", luminosity block " << iEvent.luminosityBlock()
00484                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00485                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00486     }
00487 
00488     // deprecated methods using std::string
00489 
00490     std::string triggerAlgTechTrig = "PhysicsAlgorithms";
00491 
00492     myCoutStream << "\nDeprecated methods:"
00493             << "\n  prescaleFactorSetIndex(iEvent, triggerAlgTechTrig, iErrorCode)"
00494             << "\n  prescaleFactorSet(iEvent, triggerAlgTechTrig, iErrorCode)"
00495             << std::endl;
00496 
00497     iErrorCode = -1;
00498     const int pfSetIndexPhysicsAlgorithms = m_l1GtUtils.prescaleFactorSetIndex(
00499             iEvent, triggerAlgTechTrig, iErrorCode);
00500 
00501     if (iErrorCode == 0) {
00502         myCoutStream << "\nAlgorithm triggers: index for prescale factor set = "
00503                 << pfSetIndexPhysicsAlgorithms << "\nfor run " << iEvent.run()
00504                 << ", luminosity block " << iEvent.luminosityBlock()
00505                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu() << "\n"
00506                 << "Warning: deprecated method.\n" << std::endl;
00507 
00508     } else {
00509         myCoutStream
00510                 << "\nError encountered when retrieving the prescale factor set index"
00511                 << "\n  for algorithm triggers, for run " << iEvent.run()
00512                 << ", luminosity block " << iEvent.luminosityBlock()
00513                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00514                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00515     }
00516 
00517 
00518     iErrorCode = -1;
00519     const std::vector<int>& pfSetPhysicsAlgorithms =
00520             m_l1GtUtils.prescaleFactorSet(iEvent, triggerAlgTechTrig,
00521                     iErrorCode);
00522 
00523     if (iErrorCode == 0) {
00524         myCoutStream << "\nAlgorithm triggers: prescale factor set index = "
00525                 << pfSetIndexPhysicsAlgorithms << "\nfor run " << iEvent.run()
00526                 << ", luminosity block " << iEvent.luminosityBlock()
00527                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00528                 << "\nWarning: deprecated method.\n" << std::endl;
00529 
00530         int iBit = -1;
00531         for (std::vector<int>::const_iterator cItBit =
00532                 pfSetPhysicsAlgorithms.begin(); cItBit
00533                 != pfSetPhysicsAlgorithms.end(); ++cItBit) {
00534 
00535             iBit++;
00536             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
00537                     << ": prescale factor = " << (*cItBit) << std::endl;
00538 
00539         }
00540 
00541     } else {
00542         myCoutStream
00543                 << "\nError encountered when retrieving the prescale factor set "
00544                 << "\n  for algorithm triggers, for run " << iEvent.run()
00545                 << ", luminosity block " << iEvent.luminosityBlock()
00546                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00547                 << "\n  Error code: " << iErrorCode  << "\n" << std::endl;
00548     }
00549 
00550     // the actual trigger mask set for algorithm triggers
00551 
00552     myCoutStream << "\nDeprecated methods:"
00553             << "\n  triggerMaskSet(triggerAlgTechTrig, iErrorCode)"
00554             << std::endl;
00555 
00556     iErrorCode = -1;
00557     const std::vector<unsigned int>& tmSetPhysicsAlgorithms =
00558             m_l1GtUtils.triggerMaskSet(triggerAlgTechTrig, iErrorCode);
00559 
00560     if (iErrorCode == 0) {
00561         myCoutStream << "\nAlgorithm triggers: trigger mask set for run "
00562                 << iEvent.run() << ", luminosity block "
00563                 << iEvent.luminosityBlock() << ", with L1 menu \n  "
00564                 << m_l1GtUtils.l1TriggerMenu()
00565                 << "\nWarning: deprecated method.\n" << std::endl;
00566 
00567         int iBit = -1;
00568         for (std::vector<unsigned int>::const_iterator cItBit =
00569                 tmSetPhysicsAlgorithms.begin(); cItBit
00570                 != tmSetPhysicsAlgorithms.end(); ++cItBit) {
00571 
00572             iBit++;
00573             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
00574                     << ": trigger mask = " << (*cItBit) << std::endl;
00575 
00576         }
00577 
00578     } else {
00579         myCoutStream
00580                 << "\nError encountered when retrieving the trigger mask set "
00581                 << "\n  for algorithm triggers, for run " << iEvent.run()
00582                 << ", luminosity block " << iEvent.luminosityBlock()
00583                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00584                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00585     }
00586 
00587 
00588 
00589     // index of the actual prescale factor set, and the actual prescale
00590     // factor set for technical triggers
00591 
00592     trigCategory = L1GtUtils::TechnicalTrigger;
00593 
00594     myCoutStream << "\nMethods:"
00595             << "\n  prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
00596             << "\n  prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
00597             << std::endl;
00598 
00599     iErrorCode = -1;
00600     const int pfSetIndexTechnicalTrigger = m_l1GtUtils.prescaleFactorSetIndex(
00601             iEvent, trigCategory, iErrorCode);
00602 
00603     if (iErrorCode == 0) {
00604         myCoutStream
00605                 << "\nTechnical triggers: index for prescale factor set = "
00606                 << pfSetIndexTechnicalTrigger << "\nfor run " << iEvent.run()
00607                 << ", luminosity block " << iEvent.luminosityBlock()
00608                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00609                 << "\nMethod: prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)\n"
00610                 << std::endl;
00611 
00612     } else {
00613         myCoutStream
00614                 << "\nError encountered when retrieving the prescale factor set index"
00615                 << "\n  for technical triggers, for run " << iEvent.run()
00616                 << ", luminosity block " << iEvent.luminosityBlock()
00617                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00618                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00619     }
00620 
00621     iErrorCode = -1;
00622     const std::vector<int>& pfSetTechnicalTrigger =
00623             m_l1GtUtils.prescaleFactorSet(iEvent, trigCategory, iErrorCode);
00624 
00625     if (iErrorCode == 0) {
00626         myCoutStream << "\nTechnical triggers: prescale factor set index = "
00627                 << pfSetIndexTechnicalTrigger << "\nfor run " << iEvent.run()
00628                 << ", luminosity block " << iEvent.luminosityBlock()
00629                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00630                 << "\nMethod: prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
00631                 << std::endl;
00632 
00633         int iBit = -1;
00634         for (std::vector<int>::const_iterator cItBit =
00635                 pfSetTechnicalTrigger.begin(); cItBit
00636                 != pfSetTechnicalTrigger.end(); ++cItBit) {
00637 
00638             iBit++;
00639             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
00640                     << ": prescale factor = " << (*cItBit) << std::endl;
00641 
00642         }
00643 
00644     } else {
00645         myCoutStream
00646                 << "\nError encountered when retrieving the prescale factor set "
00647                 << "\n  for technical triggers, for run " << iEvent.run()
00648                 << ", luminosity block " << iEvent.luminosityBlock()
00649                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00650                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00651     }
00652 
00653     // the actual trigger mask set for technical triggers
00654 
00655     myCoutStream << "\nMethod:"
00656             << "\n  triggerMaskSet(trigCategory, iErrorCode)"
00657             << std::endl;
00658 
00659     iErrorCode = -1;
00660     const std::vector<unsigned int>& tmSetTechnicalTrigger =
00661             m_l1GtUtils.triggerMaskSet(trigCategory, iErrorCode);
00662 
00663     if (iErrorCode == 0) {
00664         myCoutStream << "\nTechnical triggers: trigger mask set for run "
00665                 << iEvent.run() << ", luminosity block "
00666                 << iEvent.luminosityBlock() << ", with L1 menu \n  "
00667                 << m_l1GtUtils.l1TriggerMenu() << "\n" << std::endl;
00668 
00669         int iBit = -1;
00670         for (std::vector<unsigned int>::const_iterator cItBit =
00671                 tmSetTechnicalTrigger.begin(); cItBit
00672                 != tmSetTechnicalTrigger.end(); ++cItBit) {
00673 
00674             iBit++;
00675             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
00676                     << ": trigger mask = " << (*cItBit) << std::endl;
00677 
00678         }
00679 
00680     } else {
00681         myCoutStream
00682                 << "\nError encountered when retrieving the trigger mask set "
00683                 << "\n  for technical triggers, for run " << iEvent.run()
00684                 << ", luminosity block " << iEvent.luminosityBlock()
00685                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00686                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00687     }
00688 
00689     // deprecated methods using std::string
00690 
00691     triggerAlgTechTrig = "TechnicalTriggers";
00692 
00693     myCoutStream << "\nDeprecated methods:"
00694             << "\n  prescaleFactorSetIndex(iEvent, triggerAlgTechTrig, iErrorCode)"
00695             << "\n  prescaleFactorSet(iEvent, triggerAlgTechTrig, iErrorCode)"
00696             << std::endl;
00697 
00698     iErrorCode = -1;
00699     const int pfSetIndexTechnicalTriggers = m_l1GtUtils.prescaleFactorSetIndex(
00700             iEvent, triggerAlgTechTrig, iErrorCode);
00701 
00702     if (iErrorCode == 0) {
00703         myCoutStream << "\nTechnical triggers: index for prescale factor set = "
00704                 << pfSetIndexTechnicalTriggers << "\nfor run " << iEvent.run()
00705                 << ", luminosity block " << iEvent.luminosityBlock()
00706                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu() << "\n"
00707                 << "Warning: deprecated method.\n" << std::endl;
00708 
00709     } else {
00710         myCoutStream
00711                 << "\nError encountered when retrieving the prescale factor set index"
00712                 << "\n  for technical triggers, for run " << iEvent.run()
00713                 << ", luminosity block " << iEvent.luminosityBlock()
00714                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00715                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00716     }
00717 
00718 
00719     iErrorCode = -1;
00720     const std::vector<int>& pfSetTechnicalTriggers =
00721             m_l1GtUtils.prescaleFactorSet(iEvent, triggerAlgTechTrig,
00722                     iErrorCode);
00723 
00724     if (iErrorCode == 0) {
00725         myCoutStream << "\nTechnical triggers: prescale factor set index = "
00726                 << pfSetIndexTechnicalTriggers << "\nfor run " << iEvent.run()
00727                 << ", luminosity block " << iEvent.luminosityBlock()
00728                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00729                 << "\nWarning: deprecated method.\n" << std::endl;
00730 
00731         int iBit = -1;
00732         for (std::vector<int>::const_iterator cItBit =
00733                 pfSetTechnicalTriggers.begin(); cItBit
00734                 != pfSetTechnicalTriggers.end(); ++cItBit) {
00735 
00736             iBit++;
00737             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
00738                     << ": prescale factor = " << (*cItBit) << std::endl;
00739 
00740         }
00741 
00742     } else {
00743         myCoutStream
00744                 << "\nError encountered when retrieving the prescale factor set "
00745                 << "\n  for technical triggers, for run " << iEvent.run()
00746                 << ", luminosity block " << iEvent.luminosityBlock()
00747                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00748                 << "\n  Error code: " << iErrorCode  << "\n" << std::endl;
00749     }
00750 
00751     // the actual trigger mask set for algorithm triggers
00752 
00753     myCoutStream << "\nDeprecated methods:"
00754             << "\n  triggerMaskSet(triggerAlgTechTrig, iErrorCode)"
00755             << std::endl;
00756 
00757     iErrorCode = -1;
00758     const std::vector<unsigned int>& tmSetTechnicalTriggers =
00759             m_l1GtUtils.triggerMaskSet(triggerAlgTechTrig, iErrorCode);
00760 
00761     if (iErrorCode == 0) {
00762         myCoutStream << "\nTechnical triggers: trigger mask set for run "
00763                 << iEvent.run() << ", luminosity block "
00764                 << iEvent.luminosityBlock() << ", with L1 menu \n  "
00765                 << m_l1GtUtils.l1TriggerMenu()
00766                 << "\nWarning: deprecated method.\n" << std::endl;
00767 
00768         int iBit = -1;
00769         for (std::vector<unsigned int>::const_iterator cItBit =
00770                 tmSetTechnicalTriggers.begin(); cItBit
00771                 != tmSetTechnicalTriggers.end(); ++cItBit) {
00772 
00773             iBit++;
00774             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
00775                     << ": trigger mask = " << (*cItBit) << std::endl;
00776 
00777         }
00778 
00779     } else {
00780         myCoutStream
00781                 << "\nError encountered when retrieving the trigger mask set "
00782                 << "\n  for technical triggers, for run " << iEvent.run()
00783                 << ", luminosity block " << iEvent.luminosityBlock()
00784                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00785                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00786     }
00787 
00788 
00789 
00790     //
00791     // same methods as above, but with input tag given explicitly, allowing to select
00792     // the EDM products used to get the results
00793 
00794     myCoutStream
00795             << "\n******** Results found with input tags provided in the configuration file ******** \n"
00796             << "\n  L1GlobalTriggerRecord: " << m_l1GtRecordInputTag
00797             << "\n  L1GlobalTriggerReadoutRecord: "
00798             << m_l1GtDaqReadoutRecordInputTag << std::endl;
00799 
00800 
00801     // the following methods share the same error code, therefore one can check only once
00802     // the validity of the result
00803 
00804     iErrorCode = -1;
00805 
00806     bool decisionBeforeMaskAlgTechTrigITag = m_l1GtUtils.decisionBeforeMask(iEvent,
00807             m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag,
00808             m_nameAlgTechTrig, iErrorCode);
00809 
00810     bool decisionAfterMaskAlgTechTrigITag = m_l1GtUtils.decisionAfterMask(iEvent,
00811             m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag,
00812             m_nameAlgTechTrig, iErrorCode);
00813 
00814     bool decisionAlgTechTrigITag = m_l1GtUtils.decision(iEvent,
00815             m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag,
00816             m_nameAlgTechTrig, iErrorCode);
00817 
00818     int prescaleFactorAlgTechTrigITag = m_l1GtUtils.prescaleFactor(iEvent,
00819             m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag,
00820             m_nameAlgTechTrig, iErrorCode);
00821 
00822     int triggerMaskAlgTechTrigITag = m_l1GtUtils.triggerMask(iEvent,
00823             m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag,
00824             m_nameAlgTechTrig, iErrorCode);
00825 
00826     myCoutStream << "\n\nMethods:"
00827             << "\n  decisionBeforeMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
00828             << "\n  decisionAfterMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
00829             << "\n  decision(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
00830             << "\n  prescaleFactor(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
00831             << "\n  triggerMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
00832             << "\n\n"
00833             << std::endl;
00834 
00835 
00836     if (iErrorCode == 0) {
00837         myCoutStream << "\nDecision before trigger mask for "
00838                 << m_nameAlgTechTrig << ":   " << decisionBeforeMaskAlgTechTrigITag
00839                 << std::endl;
00840         myCoutStream << "Decision after trigger mask for " << m_nameAlgTechTrig
00841                 << ":    " << decisionAfterMaskAlgTechTrigITag << std::endl;
00842         myCoutStream << "Decision (after trigger mask) for "
00843                 << m_nameAlgTechTrig << ":  " << decisionAlgTechTrigITag
00844                 << std::endl;
00845 
00846         myCoutStream << "Prescale factor for " << m_nameAlgTechTrig
00847                 << ":                " << prescaleFactorAlgTechTrigITag
00848                 << std::endl;
00849 
00850         myCoutStream << "Trigger mask for " << m_nameAlgTechTrig
00851                 << ":                   " << triggerMaskAlgTechTrigITag
00852                 << std::endl;
00853 
00854     } else if (iErrorCode == 1) {
00855         myCoutStream << "\n" << m_nameAlgTechTrig
00856                 << " does not exist in the L1 menu "
00857                 << m_l1GtUtils.l1TriggerMenu() << "\n" << std::endl;
00858 
00859     } else {
00860         myCoutStream << "\nError: "
00861                 << "\n  An error was encountered when retrieving decision, mask and prescale factor for "
00862                 << m_nameAlgTechTrig << "\n  L1 Menu: "
00863                 << m_l1GtUtils.l1TriggerMenu() << "\n  Error code: "
00864                 << iErrorCode << std::endl;
00865 
00866     }
00867 
00868 
00869     // index of the actual prescale factor set, and the actual prescale
00870     // factor set for algorithm triggers
00871 
00872 
00873 
00874     trigCategory = L1GtUtils::AlgorithmTrigger;
00875 
00876     myCoutStream << "\nMethods:"
00877             << "\n  prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
00878             << "\n  prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
00879             << std::endl;
00880 
00881     iErrorCode = -1;
00882     const int pfSetIndexAlgorithmTriggerITag = m_l1GtUtils.prescaleFactorSetIndex(
00883             iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag,
00884             trigCategory, iErrorCode);
00885 
00886     if (iErrorCode == 0) {
00887         myCoutStream
00888                 << "\nAlgorithm triggers: index for prescale factor set = "
00889                 << pfSetIndexAlgorithmTriggerITag << "\nfor run " << iEvent.run()
00890                 << ", luminosity block " << iEvent.luminosityBlock()
00891                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00892                 << std::endl;
00893 
00894 
00895     } else {
00896         myCoutStream
00897                 << "\nError encountered when retrieving the prescale factor set index"
00898                 << "\n  for algorithm triggers, for run " << iEvent.run()
00899                 << ", luminosity block " << iEvent.luminosityBlock()
00900                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00901                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00902     }
00903 
00904     iErrorCode = -1;
00905     const std::vector<int>& pfSetAlgorithmTriggerITag =
00906             m_l1GtUtils.prescaleFactorSet(iEvent, m_l1GtRecordInputTag,
00907                     m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode);
00908 
00909     if (iErrorCode == 0) {
00910         myCoutStream << "\nAlgorithm triggers: prescale factor set index = "
00911                 << pfSetIndexAlgorithmTriggerITag << "\nfor run " << iEvent.run()
00912                 << ", luminosity block " << iEvent.luminosityBlock()
00913                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00914                 << std::endl;
00915 
00916         int iBit = -1;
00917         for (std::vector<int>::const_iterator cItBit =
00918                 pfSetAlgorithmTriggerITag.begin(); cItBit
00919                 != pfSetAlgorithmTriggerITag.end(); ++cItBit) {
00920 
00921             iBit++;
00922             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
00923                     << ": prescale factor = " << (*cItBit) << std::endl;
00924 
00925         }
00926 
00927     } else {
00928         myCoutStream
00929                 << "\nError encountered when retrieving the prescale factor set "
00930                 << "\n  for algorithm triggers, for run " << iEvent.run()
00931                 << ", luminosity block " << iEvent.luminosityBlock()
00932                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00933                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00934     }
00935 
00936 
00937     // deprecated methods using std::string
00938 
00939     triggerAlgTechTrig = "PhysicsAlgorithms";
00940 
00941     myCoutStream << "\nDeprecated methods:"
00942             << "\n  prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, triggerAlgTechTrig, iErrorCode)"
00943             << "\n  prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, triggerAlgTechTrig, iErrorCode)"
00944             << std::endl;
00945 
00946     iErrorCode = -1;
00947     const int pfSetIndexPhysicsAlgorithmsITag = m_l1GtUtils.prescaleFactorSetIndex(
00948             iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag,
00949             triggerAlgTechTrig, iErrorCode);
00950 
00951     if (iErrorCode == 0) {
00952         myCoutStream << "\nAlgorithm triggers: index for prescale factor set = "
00953                 << pfSetIndexPhysicsAlgorithmsITag << "\nfor run " << iEvent.run()
00954                 << ", luminosity block " << iEvent.luminosityBlock()
00955                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu() << "\n"
00956                 << "Warning: deprecated method.\n" << std::endl;
00957 
00958     } else {
00959         myCoutStream
00960                 << "\nError encountered when retrieving the prescale factor set index"
00961                 << "\n  for algorithm triggers, for run " << iEvent.run()
00962                 << ", luminosity block " << iEvent.luminosityBlock()
00963                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00964                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
00965     }
00966 
00967 
00968     iErrorCode = -1;
00969     const std::vector<int>& pfSetPhysicsAlgorithmsITag =
00970             m_l1GtUtils.prescaleFactorSet(iEvent, m_l1GtRecordInputTag,
00971                     m_l1GtDaqReadoutRecordInputTag, triggerAlgTechTrig,
00972                     iErrorCode);
00973 
00974     if (iErrorCode == 0) {
00975         myCoutStream << "\nAlgorithm triggers: prescale factor set index = "
00976                 << pfSetIndexPhysicsAlgorithmsITag << "\nfor run " << iEvent.run()
00977                 << ", luminosity block " << iEvent.luminosityBlock()
00978                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00979                 << "\nWarning: deprecated method.\n" << std::endl;
00980 
00981         int iBit = -1;
00982         for (std::vector<int>::const_iterator cItBit =
00983                 pfSetPhysicsAlgorithmsITag.begin(); cItBit
00984                 != pfSetPhysicsAlgorithmsITag.end(); ++cItBit) {
00985 
00986             iBit++;
00987             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
00988                     << ": prescale factor = " << (*cItBit) << std::endl;
00989 
00990         }
00991 
00992     } else {
00993         myCoutStream
00994                 << "\nError encountered when retrieving the prescale factor set "
00995                 << "\n  for algorithm triggers, for run " << iEvent.run()
00996                 << ", luminosity block " << iEvent.luminosityBlock()
00997                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
00998                 << "\n  Error code: " << iErrorCode  << "\n" << std::endl;
00999     }
01000 
01001 
01002 
01003 
01004     // index of the actual prescale factor set, and the actual prescale
01005     // factor set for technical triggers
01006 
01007     trigCategory = L1GtUtils::TechnicalTrigger;
01008 
01009     myCoutStream << "\nMethods:"
01010             << "\n  prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
01011             << "\n  prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
01012             << std::endl;
01013 
01014     iErrorCode = -1;
01015     const int pfSetIndexTechnicalTriggerITag = m_l1GtUtils.prescaleFactorSetIndex(
01016             iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag,
01017             trigCategory, iErrorCode);
01018 
01019     if (iErrorCode == 0) {
01020         myCoutStream
01021                 << "\nTechnical triggers: index for prescale factor set = "
01022                 << pfSetIndexTechnicalTriggerITag << "\nfor run " << iEvent.run()
01023                 << ", luminosity block " << iEvent.luminosityBlock()
01024                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
01025                 << std::endl;
01026 
01027     } else {
01028         myCoutStream
01029                 << "\nError encountered when retrieving the prescale factor set index"
01030                 << "\n  for technical triggers, for run " << iEvent.run()
01031                 << ", luminosity block " << iEvent.luminosityBlock()
01032                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
01033                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
01034     }
01035 
01036     iErrorCode = -1;
01037     const std::vector<int>& pfSetTechnicalTriggerITag =
01038             m_l1GtUtils.prescaleFactorSet(iEvent, m_l1GtRecordInputTag,
01039                     m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode);
01040 
01041     if (iErrorCode == 0) {
01042         myCoutStream << "\nTechnical triggers: prescale factor set index = "
01043                 << pfSetIndexTechnicalTriggerITag << "\nfor run " << iEvent.run()
01044                 << ", luminosity block " << iEvent.luminosityBlock()
01045                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
01046                 << std::endl;
01047 
01048         int iBit = -1;
01049         for (std::vector<int>::const_iterator cItBit =
01050                 pfSetTechnicalTriggerITag.begin(); cItBit
01051                 != pfSetTechnicalTriggerITag.end(); ++cItBit) {
01052 
01053             iBit++;
01054             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
01055                     << ": prescale factor = " << (*cItBit) << std::endl;
01056 
01057         }
01058 
01059     } else {
01060         myCoutStream
01061                 << "\nError encountered when retrieving the prescale factor set "
01062                 << "\n  for technical triggers, for run " << iEvent.run()
01063                 << ", luminosity block " << iEvent.luminosityBlock()
01064                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
01065                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
01066     }
01067 
01068 
01069     // deprecated methods using std::string
01070 
01071     triggerAlgTechTrig = "TechnicalTriggers";
01072 
01073     myCoutStream << "\nDeprecated methods:"
01074             << "\n  prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, triggerAlgTechTrig, iErrorCode)"
01075             << "\n  prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, triggerAlgTechTrig, iErrorCode)"
01076             << std::endl;
01077 
01078     iErrorCode = -1;
01079     const int pfSetIndexTechnicalTriggersITag = m_l1GtUtils.prescaleFactorSetIndex(
01080             iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag,
01081             triggerAlgTechTrig, iErrorCode);
01082 
01083     if (iErrorCode == 0) {
01084         myCoutStream << "\nTechnical triggers: index for prescale factor set = "
01085                 << pfSetIndexTechnicalTriggersITag << "\nfor run " << iEvent.run()
01086                 << ", luminosity block " << iEvent.luminosityBlock()
01087                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu() << "\n"
01088                 << "Warning: deprecated method.\n" << std::endl;
01089 
01090     } else {
01091         myCoutStream
01092                 << "\nError encountered when retrieving the prescale factor set index"
01093                 << "\n  for technical triggers, for run " << iEvent.run()
01094                 << ", luminosity block " << iEvent.luminosityBlock()
01095                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
01096                 << "\n  Error code: " << iErrorCode << "\n" << std::endl;
01097     }
01098 
01099 
01100     iErrorCode = -1;
01101     const std::vector<int>& pfSetTechnicalTriggersITag =
01102             m_l1GtUtils.prescaleFactorSet(iEvent, m_l1GtRecordInputTag,
01103                     m_l1GtDaqReadoutRecordInputTag, triggerAlgTechTrig,
01104                     iErrorCode);
01105 
01106     if (iErrorCode == 0) {
01107         myCoutStream << "\nTechnical triggers: prescale factor set index = "
01108                 << pfSetIndexTechnicalTriggersITag << "\nfor run " << iEvent.run()
01109                 << ", luminosity block " << iEvent.luminosityBlock()
01110                 << ", with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
01111                 << "\nWarning: deprecated method.\n" << std::endl;
01112 
01113         int iBit = -1;
01114         for (std::vector<int>::const_iterator cItBit =
01115                 pfSetTechnicalTriggersITag.begin(); cItBit
01116                 != pfSetTechnicalTriggersITag.end(); ++cItBit) {
01117 
01118             iBit++;
01119             myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
01120                     << ": prescale factor = " << (*cItBit) << std::endl;
01121 
01122         }
01123 
01124     } else {
01125         myCoutStream
01126                 << "\nError encountered when retrieving the prescale factor set "
01127                 << "\n  for technical triggers, for run " << iEvent.run()
01128                 << ", luminosity block " << iEvent.luminosityBlock()
01129                 << " with L1 menu \n  " << m_l1GtUtils.l1TriggerMenu()
01130                 << "\n  Error code: " << iErrorCode  << "\n" << std::endl;
01131     }
01132 
01133     //
01134     // dump the stream in some Log tag (LogDebug here)
01135 
01136 
01137     LogDebug("L1GtAnalyzer") << myCoutStream.str() << std::endl;
01138 
01139     myCoutStream.str("");
01140     myCoutStream.clear();
01141 
01142 }
01143 
01144 void L1GtAnalyzer::analyzeL1GtUtilsMenuLite(const edm::Event& iEvent,
01145         const edm::EventSetup& evSetup) {
01146 
01147     LogDebug("L1GtAnalyzer")
01148             << "\n**** L1GtAnalyzer::analyzeL1GtUtilsMenuLite ****\n"
01149             << std::endl;
01150 
01151     // before accessing any result from L1GtUtils, one must retrieve and cache
01152     // the L1GtTriggerMenuLite product
01153     // add this call in the analyze / produce / filter method of your
01154     // analyzer / producer / filter
01155 
01156     if (m_l1GtTmLInputTagProv) {
01157 
01158         // input tag for L1GtTriggerMenuLite retrieved from provenance
01159         m_l1GtUtils.retrieveL1GtTriggerMenuLite(iEvent);
01160 
01161     } else {
01162 
01163         // input tag for L1GtTriggerMenuLite explicitly given
01164         m_l1GtUtils.retrieveL1GtTriggerMenuLite(iEvent, m_l1GtTmLInputTag);
01165 
01166     }
01167 
01168     analyzeL1GtUtilsCore(iEvent, evSetup);
01169 
01170 }
01171 
01172 void L1GtAnalyzer::analyzeL1GtUtilsEventSetup(const edm::Event& iEvent,
01173         const edm::EventSetup& evSetup) {
01174 
01175     LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeL1GtUtilsEventSetup ****\n"
01176             << std::endl;
01177 
01178     // before accessing any result from L1GtUtils, one must retrieve and cache
01179     // the L1 trigger event setup
01180     // add this call in the analyze / produce / filter method of your
01181     // analyzer / producer / filter
01182 
01183     m_l1GtUtils.retrieveL1EventSetup(evSetup);
01184 
01185     analyzeL1GtUtilsCore(iEvent, evSetup);
01186 
01187 }
01188 
01189 void L1GtAnalyzer::analyzeL1GtUtils(const edm::Event& iEvent,
01190         const edm::EventSetup& evSetup) {
01191 
01192     LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeL1GtUtils ****\n"
01193             << std::endl;
01194 
01195     // before accessing any result from L1GtUtils, one must retrieve and cache
01196     // the L1 trigger event setup and the L1GtTriggerMenuLite product
01197     // add this call in the analyze / produce / filter method of your
01198     // analyzer / producer / filter
01199 
01200     m_l1GtUtils.retrieveL1EventSetup(evSetup);
01201 
01202     if (m_l1GtTmLInputTagProv) {
01203 
01204         // input tag for L1GtTriggerMenuLite retrieved from provenance
01205         m_l1GtUtils.retrieveL1GtTriggerMenuLite(iEvent);
01206 
01207     } else {
01208 
01209         // input tag for L1GtTriggerMenuLite explicitly given
01210         m_l1GtUtils.retrieveL1GtTriggerMenuLite(iEvent, m_l1GtTmLInputTag);
01211 
01212     }
01213 
01214     analyzeL1GtUtilsCore(iEvent, evSetup);
01215 
01216 }
01217 
01218 // analyze: object map product
01219 void L1GtAnalyzer::analyzeObjectMap(const edm::Event& iEvent,
01220         const edm::EventSetup& evSetup) {
01221 
01222     LogDebug("L1GtAnalyzer")
01223             << "\n**** L1GtAnalyzer::analyzeObjectMap object map product ****\n"
01224             << std::endl;
01225 
01226     // define an output stream to print into
01227     // it can then be directed to whatever log level is desired
01228     std::ostringstream myCoutStream;
01229 
01230     // get a handle to the object map product
01231     // the product can come only from emulator - no hardware ObjectMapRecord
01232     edm::Handle<L1GlobalTriggerObjectMapRecord> gtObjectMapRecord;
01233     iEvent.getByLabel(m_l1GtObjectMapTag, gtObjectMapRecord);
01234 
01235     if (!gtObjectMapRecord.isValid()) {
01236         LogDebug("L1GtAnalyzer")
01237                 << "\nWarning: L1GlobalTriggerObjectMapRecord with input tag "
01238                 << m_l1GtObjectMapTag
01239                 << "\nrequested in configuration, but not found in the event."
01240                 << "\nExit the method.\n" << std::endl;
01241 
01242         return;
01243     }
01244 
01245     // get all object maps
01246     const std::vector<L1GlobalTriggerObjectMap>& objMapVec =
01247             gtObjectMapRecord->gtObjectMap();
01248 
01249     // print every object map via the implemented print
01250     for (std::vector<L1GlobalTriggerObjectMap>::const_iterator it =
01251             objMapVec.begin(); it != objMapVec.end(); ++it) {
01252 
01253         (*it).print(myCoutStream);
01254     }
01255 
01256     //
01257     const CombinationsInCond* comb = gtObjectMapRecord->getCombinationsInCond(
01258             m_nameAlgTechTrig, m_condName);
01259 
01260     // number of combinations
01261     if (comb != 0) {
01262         myCoutStream << "\n  Number of combinations passing ("
01263                 << m_nameAlgTechTrig << ", " << m_condName << "): "
01264                 << comb->size() << std::endl;
01265     } else {
01266         myCoutStream << "\n  No combination passes (" << m_nameAlgTechTrig
01267                 << ", " << m_condName << ") " << std::endl;
01268 
01269     }
01270 
01271     // condition result
01272     const bool result = gtObjectMapRecord->getConditionResult(
01273             m_nameAlgTechTrig, m_condName);
01274 
01275     myCoutStream << "\n  Result for condition " << m_condName
01276             << " in algorithm " << m_nameAlgTechTrig << ": " << result
01277             << std::endl;
01278 
01279     // print all the stuff if at LogDebug level
01280     LogDebug("L1GtAnalyzer")
01281             << "Test gtObjectMapRecord in L1GlobalTrigger \n\n"
01282             << myCoutStream.str() << "\n\n" << std::endl;
01283     myCoutStream.str("");
01284     myCoutStream.clear();
01285 
01286 }
01287 
01288 // analyze: usage of L1GtTriggerMenuLite
01289 void L1GtAnalyzer::analyzeL1GtTriggerMenuLite(const edm::Event& iEvent,
01290         const edm::EventSetup& evSetup) {
01291 
01292     LogDebug("L1GtAnalyzer")
01293     << "\n**** L1GtAnalyzer::analyzeL1GtTriggerMenuLite ****\n"
01294     << std::endl;
01295 
01296     // define an output stream to print into
01297     // it can then be directed to whatever log level is desired
01298     std::ostringstream myCoutStream;
01299 
01300     // get Run Data - the same code can be run in beginRun, with getByLabel from edm::Run
01301     const edm::Run& iRun = iEvent.getRun();
01302 
01303 
01304     // get L1GtTriggerMenuLite
01305     edm::Handle<L1GtTriggerMenuLite> triggerMenuLite;
01306     iRun.getByLabel(m_l1GtTmLInputTag, triggerMenuLite);
01307 
01308     if (!triggerMenuLite.isValid()) {
01309 
01310         LogDebug("L1GtAnalyzer") << "\nL1GtTriggerMenuLite with \n  "
01311                 << m_l1GtTmLInputTag
01312                 << "\nrequested in configuration, but not found in the event."
01313                 << "\nExit the method.\n" << std::endl;
01314 
01315         return;
01316     }
01317 
01318     // print via supplied "print" function
01319     myCoutStream << (*triggerMenuLite);
01320 
01321     // test the individual methods
01322 
01323     const std::string& triggerMenuInterface =
01324             triggerMenuLite->gtTriggerMenuInterface();
01325     const std::string& triggerMenuName = triggerMenuLite->gtTriggerMenuName();
01326     const std::string& triggerMenuImplementation =
01327             triggerMenuLite->gtTriggerMenuImplementation();
01328     const std::string& scaleDbKey = triggerMenuLite->gtScaleDbKey();
01329 
01330     const L1GtTriggerMenuLite::L1TriggerMap& algorithmMap = triggerMenuLite->gtAlgorithmMap();
01331     const L1GtTriggerMenuLite::L1TriggerMap& algorithmAliasMap =
01332             triggerMenuLite->gtAlgorithmAliasMap();
01333     const L1GtTriggerMenuLite::L1TriggerMap& technicalTriggerMap =
01334             triggerMenuLite->gtTechnicalTriggerMap();
01335 
01336     const std::vector<unsigned int>& triggerMaskAlgoTrig =
01337             triggerMenuLite->gtTriggerMaskAlgoTrig();
01338     const std::vector<unsigned int>& triggerMaskTechTrig =
01339             triggerMenuLite->gtTriggerMaskTechTrig();
01340 
01341     const std::vector<std::vector<int> >& prescaleFactorsAlgoTrig =
01342             triggerMenuLite->gtPrescaleFactorsAlgoTrig();
01343     const std::vector<std::vector<int> >& prescaleFactorsTechTrig =
01344             triggerMenuLite->gtPrescaleFactorsTechTrig();
01345 
01346     // print in the same format as in L1GtTriggerMenuLite definition
01347 
01348     size_t nrDefinedAlgo = algorithmMap.size();
01349     size_t nrDefinedTech = technicalTriggerMap.size();
01350 
01351     // header for printing algorithms
01352 
01353     myCoutStream << "\n   ********** L1 Trigger Menu - printing   ********** \n"
01354     << "\nL1 Trigger Menu Interface: " << triggerMenuInterface
01355     << "\nL1 Trigger Menu Name:      " << triggerMenuName
01356     << "\nL1 Trigger Menu Implementation: " << triggerMenuImplementation
01357     << "\nAssociated Scale DB Key: " << scaleDbKey << "\n\n"
01358     << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined." << "\n\n"
01359     << "Bit Number "
01360     << std::right << std::setw(35) << "Algorithm Name" << "  "
01361     << std::right << std::setw(35) << "Algorithm Alias" << "  "
01362     << std::right << std::setw(12) << "Trigger Mask";
01363     for (unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
01364         myCoutStream << std::right << std::setw(10) << "PF Set "
01365                << std::right << std::setw(2)  << iSet;
01366     }
01367 
01368     myCoutStream << std::endl;
01369 
01370 
01371     for (L1GtTriggerMenuLite::CItL1Trig itTrig = algorithmMap.begin(); itTrig
01372             != algorithmMap.end(); itTrig++) {
01373 
01374         const unsigned int bitNumber = itTrig->first;
01375         const std::string& aName = itTrig->second;
01376 
01377         std::string aAlias;
01378         L1GtTriggerMenuLite::CItL1Trig itAlias = algorithmAliasMap.find(bitNumber);
01379         if (itAlias != algorithmAliasMap.end()) {
01380             aAlias = itAlias->second;
01381         }
01382 
01383         myCoutStream << std::setw(6) << bitNumber << "     "
01384             << std::right << std::setw(35) << aName << "  "
01385             << std::right << std::setw(35) << aAlias << "  "
01386             << std::right << std::setw(12) << triggerMaskAlgoTrig[bitNumber];
01387         for (unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
01388             myCoutStream << std::right << std::setw(12) << prescaleFactorsAlgoTrig[iSet][bitNumber];
01389         }
01390 
01391         myCoutStream << std::endl;
01392     }
01393 
01394     myCoutStream << "\nL1 Technical Triggers: " << nrDefinedTech
01395             << " technical triggers defined." << "\n\n" << std::endl;
01396     if (nrDefinedTech) {
01397         myCoutStream
01398             << std::right << std::setw(6) << "Bit Number "
01399             << std::right << std::setw(45) << " Technical trigger name " << "  "
01400             << std::right << std::setw(12) << "Trigger Mask";
01401         for (unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
01402             myCoutStream << std::right << std::setw(10) << "PF Set "
01403                     << std::right << std::setw(2) << iSet;
01404         }
01405 
01406         myCoutStream << std::endl;
01407     }
01408 
01409     for (L1GtTriggerMenuLite::CItL1Trig itTrig = technicalTriggerMap.begin(); itTrig
01410             != technicalTriggerMap.end(); itTrig++) {
01411 
01412         unsigned int bitNumber = itTrig->first;
01413         std::string aName = itTrig->second;
01414 
01415         myCoutStream << std::setw(6) << bitNumber << "       "
01416         << std::right << std::setw(45) << aName
01417         << std::right << std::setw(12) << triggerMaskTechTrig[bitNumber];
01418         for (unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
01419             myCoutStream << std::right << std::setw(12) << prescaleFactorsTechTrig[iSet][bitNumber];
01420         }
01421 
01422         myCoutStream << std::endl;
01423 
01424     }
01425 
01426     // individual methods
01427 
01428     int errorCode = -1;
01429     const std::string* algorithmAlias = triggerMenuLite->gtAlgorithmAlias(
01430             m_bitNumber, errorCode);
01431     if (errorCode) {
01432         myCoutStream
01433                 << "\nError code retrieving alias for algorithm with bit number "
01434                 << m_bitNumber << ": " << errorCode << std::endl;
01435     } else {
01436         myCoutStream << "\nAlias for algorithm with bit number " << m_bitNumber
01437                 << ": " << (*algorithmAlias) << std::endl;
01438     }
01439 
01440     errorCode = -1;
01441     const std::string* algorithmName = triggerMenuLite->gtAlgorithmName(
01442             m_bitNumber, errorCode);
01443     if (errorCode) {
01444         myCoutStream
01445                 << "\nError code retrieving name for algorithm with bit number "
01446                 << m_bitNumber << ": " << errorCode << std::endl;
01447     } else {
01448         myCoutStream << "\nName for algorithm with bit number " << m_bitNumber
01449                 << ": " << (*algorithmName) << std::endl;
01450     }
01451 
01452     errorCode = -1;
01453     const std::string* techTrigName = triggerMenuLite->gtTechTrigName(
01454             m_bitNumber, errorCode);
01455     if (errorCode) {
01456         myCoutStream
01457                 << "\nError code retrieving name for technical trigger with bit number "
01458                 << m_bitNumber << ": " << errorCode << std::endl;
01459     } else {
01460         myCoutStream << "\nName for technical trigger with bit number "
01461                 << m_bitNumber << ": " << (*techTrigName) << std::endl;
01462     }
01463 
01464     errorCode = -1;
01465     const unsigned int bitNumber = triggerMenuLite->gtBitNumber(
01466             m_nameAlgTechTrig, errorCode);
01467     if (errorCode) {
01468         myCoutStream
01469                 << "\nError code retrieving bit number for algorithm/technical trigger "
01470                 << m_nameAlgTechTrig << ": " << errorCode << std::endl;
01471     } else {
01472         myCoutStream << "\nBit number for algorithm/technical trigger "
01473                 << m_nameAlgTechTrig << ": " << bitNumber << std::endl;
01474     }
01475 
01476     // not tested
01477     //errorCode = -1;
01478     //const bool triggerMenuLite->gtTriggerResult( m_nameAlgTechTrig,
01479     //        const std::vector<bool>& decWord,  errorCode);
01480 
01481 
01482     LogDebug("L1GtAnalyzer") << myCoutStream.str() << std::endl;
01483 
01484     myCoutStream.str("");
01485     myCoutStream.clear();
01486 
01487 }
01488 
01489 // analyze: usage of ConditionsInEdm
01490 void L1GtAnalyzer::analyzeConditionsInRunBlock(const edm::Run& iRun,
01491         const edm::EventSetup& evSetup) {
01492 
01493     LogDebug("L1GtAnalyzer")
01494             << "\n**** L1GtAnalyzer::analyzeConditionsInRunBlock ****\n"
01495             << std::endl;
01496 
01497     // define an output stream to print into
01498     // it can then be directed to whatever log level is desired
01499     std::ostringstream myCoutStream;
01500 
01501     // get ConditionsInRunBlock
01502     edm::Handle<edm::ConditionsInRunBlock> condInRunBlock;
01503     iRun.getByLabel(m_condInEdmInputTag, condInRunBlock);
01504 
01505     if (!condInRunBlock.isValid()) {
01506 
01507         LogDebug("L1GtAnalyzer") << "\nConditionsInRunBlock with \n  "
01508                 << m_condInEdmInputTag
01509                 << "\nrequested in configuration, but not found in the event."
01510                 << "\nExit the method.\n" << std::endl;
01511 
01512         return;
01513     }
01514 
01515     const boost::uint16_t beamModeVal = condInRunBlock->beamMode;
01516     const boost::uint16_t beamMomentumVal = condInRunBlock->beamMomentum;
01517     const boost::uint32_t lhcFillNumberVal = condInRunBlock->lhcFillNumber;
01518 
01519     // print via supplied "print" function
01520     myCoutStream << "\nLHC quantities in run " << iRun.run()
01521             << "\n  Beam Mode = " << beamModeVal
01522             << "\n  Beam Momentum = " << beamMomentumVal << " GeV"
01523             << "\n  LHC Fill Number = " << lhcFillNumberVal
01524             << std::endl;
01525 
01526     LogDebug("L1GtAnalyzer") << myCoutStream.str() << std::endl;
01527 
01528     myCoutStream.str("");
01529     myCoutStream.clear();
01530 
01531 }
01532 
01533 
01534 void L1GtAnalyzer::analyzeConditionsInLumiBlock(
01535         const edm::LuminosityBlock& iLumi, const edm::EventSetup& evSetup) {
01536     LogDebug("L1GtAnalyzer")
01537             << "\n**** L1GtAnalyzer::analyzeConditionsInLumiBlock ****\n"
01538             << std::endl;
01539 
01540     // define an output stream to print into
01541     // it can then be directed to whatever log level is desired
01542     std::ostringstream myCoutStream;
01543 
01544     // get ConditionsInLumiBlock
01545     edm::Handle<edm::ConditionsInLumiBlock> condInLumiBlock;
01546     iLumi.getByLabel(m_condInEdmInputTag, condInLumiBlock);
01547 
01548     if (!condInLumiBlock.isValid()) {
01549 
01550         LogDebug("L1GtAnalyzer") << "\nConditionsInLumiBlock with \n  "
01551                 << m_condInEdmInputTag
01552                 << "\nrequested in configuration, but not found in the event."
01553                 << "\nExit the method.\n" << std::endl;
01554 
01555         return;
01556     }
01557 
01558     const boost::uint32_t totalIntensityBeam1Val =
01559             condInLumiBlock->totalIntensityBeam1;
01560     const boost::uint32_t totalIntensityBeam2Val =
01561             condInLumiBlock->totalIntensityBeam2;
01562 
01563     myCoutStream << "\nLHC quantities in luminosity section "
01564 
01565             << iLumi.luminosityBlock() << " from run " << iLumi.run()
01566             << "\n  Total Intensity Beam 1 (Integer × 10E10 charges)  = "
01567             << totalIntensityBeam1Val
01568             << "\n  Total Intensity Beam 2 (Integer × 10E10 charges)  = "
01569             << totalIntensityBeam2Val << std::endl;
01570 
01571     LogDebug("L1GtAnalyzer") << myCoutStream.str() << std::endl;
01572 
01573     myCoutStream.str("");
01574     myCoutStream.clear();
01575 
01576 }
01577 
01578 void L1GtAnalyzer::analyzeConditionsInEventBlock(const edm::Event& iEvent,
01579         const edm::EventSetup& evSetup) {
01580     // define an output stream to print into
01581     // it can then be directed to whatever log level is desired
01582     std::ostringstream myCoutStream;
01583 
01584     // get ConditionsInEventBlock
01585     edm::Handle<edm::ConditionsInEventBlock> condInEventBlock;
01586     iEvent.getByLabel(m_condInEdmInputTag, condInEventBlock);
01587 
01588     if (!condInEventBlock.isValid()) {
01589 
01590         LogDebug("L1GtAnalyzer") << "\nConditionsInEventBlock with \n  "
01591                 << m_condInEdmInputTag
01592                 << "\nrequested in configuration, but not found in the event."
01593                 << "\nExit the method.\n" << std::endl;
01594 
01595         return;
01596     }
01597 
01598     const boost::uint16_t bstMasterStatusVal =
01599             condInEventBlock->bstMasterStatus;
01600     const boost::uint32_t turnCountNumberVal =
01601             condInEventBlock->turnCountNumber;
01602 
01603     myCoutStream << "\nLHC quantities in event " << iEvent.id().event()
01604             << " from luminosity section " << iEvent.luminosityBlock()
01605             << " from run " << iEvent.run() << "\n  BST Master Status = "
01606             << bstMasterStatusVal << "\n  Turn count number = "
01607             << turnCountNumberVal << std::endl;
01608 
01609     LogDebug("L1GtAnalyzer") << myCoutStream.str() << std::endl;
01610 
01611     myCoutStream.str("");
01612     myCoutStream.clear();
01613 
01614 }
01615 
01616 // analyze each event: event loop
01617 void L1GtAnalyzer::analyze(const edm::Event& iEvent,
01618         const edm::EventSetup& evSetup) {
01619 
01620     // analyze: usage of ConditionsInEdm
01621     analyzeConditionsInEventBlock(iEvent, evSetup);
01622 
01623     // analyze: decision and decision word
01624     //   bunch cross in event BxInEvent = 0 - L1Accept event
01625     analyzeDecisionReadoutRecord(iEvent, evSetup);
01626 
01627     // analyze: decision for a given algorithm via trigger menu
01628     analyzeDecisionLiteRecord(iEvent, evSetup);
01629 
01630     // analyze: decision for a given algorithm using L1GtUtils functions
01631     //   for tests, use only one of the following methods
01632 
01633     switch (m_l1GtUtilsConfiguration) {
01634         case 0: {
01635             analyzeL1GtUtilsMenuLite(iEvent, evSetup);
01636 
01637         }
01638             break;
01639         case 100000: {
01640             analyzeL1GtUtils(iEvent, evSetup);
01641 
01642         }
01643             break;
01644         case 200000: {
01645             analyzeL1GtUtilsEventSetup(iEvent, evSetup);
01646 
01647         }
01648             break;
01649         default: {
01650             // do nothing
01651         }
01652             break;
01653     }
01654 
01655 
01656     // analyze: object map product
01657     analyzeObjectMap(iEvent, evSetup);
01658 
01659     // analyze: L1GtTriggerMenuLite
01660     analyzeL1GtTriggerMenuLite(iEvent, evSetup);
01661 
01662 }
01663 
01664 // end section
01665 void L1GtAnalyzer::endLuminosityBlock(const edm::LuminosityBlock& iLumi,
01666         const edm::EventSetup& evSetup) {
01667 
01668     // empty
01669 
01670 }
01671 void L1GtAnalyzer::endRun(const edm::Run& iRun, const edm::EventSetup& evSetup) {
01672 
01673     // empty
01674 
01675 }
01676 
01677 // method called once each job just after ending the event loop
01678 void L1GtAnalyzer::endJob() {
01679 
01680     // empty
01681 
01682 }
01683