Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-29 01:21:35

0001 #ifndef GlobalTriggerAnalyzer_L1GtTrigReport_h
0002 #define GlobalTriggerAnalyzer_L1GtTrigReport_h
0003 
0004 /**
0005  * \class L1GtTrigReport
0006  *
0007  *
0008  * Description: L1 Trigger report.
0009  *
0010  * Implementation:
0011  *    <TODO: enter implementation details>
0012  *
0013  * \author: Vasile Mihai Ghete - HEPHY Vienna
0014  *
0015  *
0016  */
0017 
0018 // system include files
0019 #include <memory>
0020 #include <string>
0021 #include <vector>
0022 #include <list>
0023 
0024 // user include files
0025 #include "FWCore/Framework/interface/Frameworkfwd.h"
0026 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0027 
0028 #include "FWCore/Framework/interface/Event.h"
0029 
0030 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0031 
0032 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtTrigReportEntry.h"
0033 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
0034 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerRecord.h"
0035 
0036 // forward declarations
0037 class L1GtStableParameters;
0038 class L1GtStableParametersRcd;
0039 class L1GtPrescaleFactors;
0040 class L1GtPrescaleFactorsAlgoTrigRcd;
0041 class L1GtPrescaleFactorsTechTrigRcd;
0042 class L1GtTriggerMask;
0043 class L1GtTriggerMaskAlgoTrigRcd;
0044 class L1GtTriggerMaskTechTrigRcd;
0045 class L1GtTriggerMaskVetoAlgoTrigRcd;
0046 class L1GtTriggerMaskVetoTechTrigRcd;
0047 class L1GtTriggerMenu;
0048 class L1GtTriggerMenuRcd;
0049 
0050 // class declaration
0051 
0052 class L1GtTrigReport : public edm::one::EDAnalyzer<> {
0053 public:
0054   /// constructor
0055   explicit L1GtTrigReport(const edm::ParameterSet&);
0056 
0057   /// destructor
0058   ~L1GtTrigReport() override;
0059 
0060 private:
0061   void beginJob() override;
0062 
0063   /// analyze each event
0064   void analyze(const edm::Event&, const edm::EventSetup&) override;
0065 
0066   /// end of job
0067   void endJob() override;
0068 
0069 private:
0070   /// cached stuff
0071 
0072   /// stable parameters
0073   const L1GtStableParameters* m_l1GtStablePar;
0074   unsigned long long m_l1GtStableParCacheID;
0075 
0076   /// number of physics triggers
0077   unsigned int m_numberPhysTriggers;
0078 
0079   /// number of technical triggers
0080   unsigned int m_numberTechnicalTriggers;
0081 
0082   /// number of DAQ partitions
0083   unsigned int m_numberDaqPartitions;
0084   unsigned int m_numberDaqPartitionsMax;
0085 
0086   /// prescale factors
0087   const L1GtPrescaleFactors* m_l1GtPfAlgo;
0088   unsigned long long m_l1GtPfAlgoCacheID;
0089 
0090   const L1GtPrescaleFactors* m_l1GtPfTech;
0091   unsigned long long m_l1GtPfTechCacheID;
0092 
0093   const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig;
0094   const std::vector<std::vector<int> >* m_prescaleFactorsTechTrig;
0095 
0096   /// trigger masks & veto masks
0097   const L1GtTriggerMask* m_l1GtTmAlgo;
0098   unsigned long long m_l1GtTmAlgoCacheID;
0099 
0100   const L1GtTriggerMask* m_l1GtTmTech;
0101   unsigned long long m_l1GtTmTechCacheID;
0102 
0103   const L1GtTriggerMask* m_l1GtTmVetoAlgo;
0104   unsigned long long m_l1GtTmVetoAlgoCacheID;
0105 
0106   const L1GtTriggerMask* m_l1GtTmVetoTech;
0107   unsigned long long m_l1GtTmVetoTechCacheID;
0108 
0109   std::vector<unsigned int> m_triggerMaskAlgoTrig;
0110   std::vector<unsigned int> m_triggerMaskTechTrig;
0111 
0112   std::vector<unsigned int> m_triggerMaskVetoAlgoTrig;
0113   std::vector<unsigned int> m_triggerMaskVetoTechTrig;
0114 
0115   // trigger menu
0116   const L1GtTriggerMenu* m_l1GtMenu;
0117   unsigned long long m_l1GtMenuCacheID;
0118 
0119 private:
0120   /// boolean flag to select the input record
0121   const bool m_useL1GlobalTriggerRecord;
0122 
0123   /// input tag for GT record (L1 GT DAQ record or L1 GT "lite" record):
0124   const edm::InputTag m_l1GtRecordInputTag;
0125 
0126   const edm::EDGetTokenT<L1GlobalTriggerRecord> m_l1GtRecordInputToken1;
0127   const edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> m_l1GtRecordInputToken2;
0128 
0129   const edm::ESGetToken<L1GtStableParameters, L1GtStableParametersRcd> m_stableParToken;
0130   const edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd> m_pfAlgoToken;
0131   const edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsTechTrigRcd> m_pfTechToken;
0132   const edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd> m_tmAlgoToken;
0133   const edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd> m_tmTechToken;
0134   const edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskVetoAlgoTrigRcd> m_tmVetoAlgoToken;
0135   const edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskVetoTechTrigRcd> m_tmVetoTechToken;
0136   const edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> m_menuToken;
0137 
0138   /// print verbosity
0139   const int m_printVerbosity;
0140 
0141   /// print output
0142   const int m_printOutput;
0143 
0144   /// counters
0145 
0146   /// global number of events processed
0147   int m_totalEvents;
0148 
0149   /// global number of events with error (EDProduct[s] not found)
0150   std::vector<int> m_globalNrErrors;
0151 
0152   /// global number of events accepted by any of the L1 algorithm in any menu
0153   std::vector<int> m_globalNrAccepts;
0154 
0155   /// list of individual entries in the report for physics algorithms
0156   std::list<L1GtTrigReportEntry*> m_entryList;
0157 
0158   /// list of individual entries in the report for technical triggers
0159   std::list<L1GtTrigReportEntry*> m_entryListTechTrig;
0160 
0161   typedef std::list<L1GtTrigReportEntry*>::const_iterator CItEntry;
0162   typedef std::list<L1GtTrigReportEntry*>::iterator ItEntry;
0163 
0164   /// index of physics DAQ partition
0165   const unsigned int m_physicsDaqPartition;
0166 };
0167 
0168 #endif /*GlobalTriggerAnalyzer_L1GtTrigReport_h*/