Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-13 01:32:14

0001 #ifndef L1GtConfigProducers_L1GtTriggerMenuTester_h
0002 #define L1GtConfigProducers_L1GtTriggerMenuTester_h
0003 
0004 /**
0005  * \class L1GtTriggerMenuTester
0006  * 
0007  * 
0008  * Description: test analyzer for L1 GT trigger menu.  
0009  *
0010  * Implementation:
0011  *    <TODO: enter implementation details>
0012  *   
0013  * \author: Vasile Mihai Ghete - HEPHY Vienna
0014  * 
0015  *
0016  */
0017 
0018 // this class header
0019 #include "L1TriggerConfig/L1GtConfigProducers/interface/L1GtTriggerMenuTester.h"
0020 
0021 // system include files
0022 #include <string>
0023 #include <map>
0024 
0025 // user include files
0026 //   base class
0027 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0028 
0029 #include "FWCore/Framework/interface/Event.h"
0030 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0031 
0032 #include "CondFormats/L1TObjects/interface/L1GtAlgorithm.h"
0033 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenuFwd.h"
0034 
0035 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
0036 
0037 // forward declarations
0038 class L1GtStableParameters;
0039 class L1GtPrescaleFactors;
0040 class L1GtTriggerMask;
0041 class L1GtTriggerMenu;
0042 
0043 class L1GtStableParametersRcd;
0044 class L1GtPrescaleFactorsAlgoTrigRcd;
0045 class L1GtPrescaleFactorsTechTrigRcd;
0046 class L1GtTriggerMaskAlgoTrigRcd;
0047 class L1GtTriggerMaskTechTrigRcd;
0048 class L1GtTriggerMaskVetoAlgoTrigRcd;
0049 class L1GtTriggerMaskVetoTechTrigRcd;
0050 class L1GtTriggerMenuRcd;
0051 
0052 // class declaration
0053 class L1GtTriggerMenuTester : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0054 public:
0055   // constructor
0056   explicit L1GtTriggerMenuTester(const edm::ParameterSet&);
0057 
0058 private:
0059   /// begin run
0060   void beginRun(const edm::Run&, const edm::EventSetup&) override;
0061 
0062   /// analyze
0063   void analyze(const edm::Event&, const edm::EventSetup&) override;
0064 
0065   /// end run
0066   void endRun(const edm::Run&, const edm::EventSetup&) override;
0067 
0068 private:
0069   /// retrieve all the relevant L1 trigger event setup records
0070   void retrieveL1EventSetup(const edm::EventSetup&);
0071 
0072   /// L1 seed - HLT path association
0073   void associateL1SeedsHltPath(const edm::Run&, const edm::EventSetup&);
0074 
0075   /// printing template for a trigger group
0076   void printTriggerGroup(const std::string& trigGroupName,
0077                          const std::map<std::string, const L1GtAlgorithm*>& trigGroup,
0078                          const bool compactPrint,
0079                          const bool printPfsRates);
0080 
0081   /// printing in Wiki format
0082   void printWiki();
0083 
0084 private:
0085   /// constant iterator
0086   typedef std::map<std::string, const L1GtAlgorithm*>::const_iterator CItAlgoP;
0087 
0088 private:
0089   /// input parameters
0090 
0091   /// overwrite name of the HTML file containing the detailed L1 menu
0092   /// with the name given in m_htmlFile
0093   bool m_overwriteHtmlFile;
0094 
0095   /// name of HTML file attached to the wiki page
0096   std::string m_htmlFile;
0097 
0098   /// use a HLT menu for L1 seed - HLT path association
0099   bool m_useHltMenu;
0100 
0101   /// process name of HLT process for which to get HLT configuration
0102   std::string m_hltProcessName;
0103 
0104   /// do not throw an exceptions if a L1 trigger requested as seed is not available in the L1 menu,
0105   /// just report this
0106   bool m_noThrowIncompatibleMenu;
0107 
0108   /// print prescale factors and rates
0109   bool m_printPfsRates;
0110 
0111   /// index of prescale factor set to be printed
0112   int m_indexPfSet;
0113 
0114 private:
0115   /// event setup cached stuff
0116 
0117   edm::ESGetToken<L1GtStableParameters, L1GtStableParametersRcd> m_l1GtStableParToken;
0118   edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd> m_l1GtPfAlgoToken;
0119   edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsTechTrigRcd> m_l1GtPfTechToken;
0120   edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd> m_l1GtTmAlgoToken;
0121   edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd> m_l1GtTmTechToken;
0122   edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskVetoAlgoTrigRcd> m_l1GtTmVetoAlgoToken;
0123   edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskVetoTechTrigRcd> m_l1GtTmVetoTechToken;
0124   edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> m_l1GtMenuToken;
0125 
0126   /// stable parameters
0127   const L1GtStableParameters* m_l1GtStablePar;
0128 
0129   /// number of algorithm triggers
0130   unsigned int m_numberAlgorithmTriggers;
0131 
0132   /// number of technical triggers
0133   unsigned int m_numberTechnicalTriggers;
0134 
0135   /// prescale factors
0136   const L1GtPrescaleFactors* m_l1GtPfAlgo;
0137 
0138   const L1GtPrescaleFactors* m_l1GtPfTech;
0139 
0140   const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig;
0141   const std::vector<std::vector<int> >* m_prescaleFactorsTechTrig;
0142 
0143   /// trigger masks & veto masks
0144   const L1GtTriggerMask* m_l1GtTmAlgo;
0145   const L1GtTriggerMask* m_l1GtTmTech;
0146 
0147   const L1GtTriggerMask* m_l1GtTmVetoAlgo;
0148   const L1GtTriggerMask* m_l1GtTmVetoTech;
0149 
0150   const std::vector<unsigned int>* m_triggerMaskAlgoTrig;
0151   const std::vector<unsigned int>* m_triggerMaskTechTrig;
0152 
0153   const std::vector<unsigned int>* m_triggerMaskVetoAlgoTrig;
0154   const std::vector<unsigned int>* m_triggerMaskVetoTechTrig;
0155 
0156   // trigger menu
0157   const L1GtTriggerMenu* m_l1GtMenu;
0158 
0159   const AlgorithmMap* m_algorithmMap;
0160   const AlgorithmMap* m_algorithmAliasMap;
0161   const AlgorithmMap* m_technicalTriggerMap;
0162 
0163 private:
0164   /// The instance of the HLTConfigProvider as a data member
0165   HLTConfigProvider m_hltConfig;
0166 
0167   /// HLT menu was used to associate the HLT path to the L1 algorithm triggers
0168   std::string m_hltTableName;
0169 
0170   /// vector of HLT paths seeded by a L1 algorithm trigger - vector index corresponds to the bit number
0171   std::vector<std::vector<std::string> > m_hltPathsForL1AlgorithmTrigger;
0172 
0173   /// vector of HLT paths seeded by a L1 technical trigger - vector index corresponds to the bit number
0174   std::vector<std::vector<std::string> > m_hltPathsForL1TechnicalTrigger;
0175 
0176   /// vector of algorithm or technical triggers not in the L1 menu
0177   std::vector<std::string> m_algoTriggerSeedNotInL1Menu;
0178   std::vector<std::string> m_techTriggerSeedNotInL1Menu;
0179 };
0180 
0181 #endif /*L1GtConfigProducers_L1GtTriggerMenuTester_h*/