Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:59

0001 #ifndef GlobalTrigger_L1GlobalTriggerGTL_h
0002 #define GlobalTrigger_L1GlobalTriggerGTL_h
0003 
0004 /**
0005  * \class L1GlobalTriggerGTL
0006  *
0007  *
0008  * Description: Global Trigger Logic board.
0009  *
0010  * Implementation:
0011  *    <TODO: enter implementation details>
0012  *
0013  * \author: M. Fierro            - HEPHY Vienna - ORCA version
0014  * \author: Vasile Mihai Ghete   - HEPHY Vienna - CMSSW version
0015  *
0016  *
0017  */
0018 
0019 // system include files
0020 #include <bitset>
0021 #include <vector>
0022 
0023 // user include files
0024 #include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
0025 #include "CondFormats/DataRecord/interface/L1CaloGeometryRecord.h"
0026 #include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h"
0027 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h"
0028 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
0029 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0030 #include "L1Trigger/GlobalTrigger/interface/L1GtAlgorithmEvaluation.h"
0031 
0032 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTCand.h"
0033 
0034 #include "FWCore/Framework/interface/Event.h"
0035 #include "FWCore/Utilities/interface/InputTag.h"
0036 
0037 #include "FWCore/Framework/interface/ConsumesCollector.h"
0038 #include "FWCore/Framework/interface/EventSetup.h"
0039 
0040 // forward declarations
0041 class L1GlobalTriggerPSB;
0042 class L1GtTriggerMenu;
0043 class L1CaloGeometry;
0044 class L1MuTriggerScales;
0045 class L1GtEtaPhiConversions;
0046 
0047 // class declaration
0048 class L1GlobalTriggerGTL {
0049 public:
0050   // constructors
0051   L1GlobalTriggerGTL(const edm::InputTag &mutag, edm::ConsumesCollector &&iC);
0052 
0053   // destructor
0054   virtual ~L1GlobalTriggerGTL();
0055 
0056 public:
0057   /// receive data from Global Muon Trigger
0058   void receiveGmtObjectData(
0059       edm::Event &, const edm::InputTag &, const int iBxInEvent, const bool receiveMu, const int nrL1Mu);
0060 
0061   /// initialize the class (mainly reserve)
0062   void init(const int nrL1Mu, const int numberPhysTriggers);
0063 
0064   /// run the GTL
0065   void run(edm::Event &iEvent,
0066            const edm::EventSetup &evSetup,
0067            const L1GlobalTriggerPSB *ptrGtPSB,
0068            const bool produceL1GtObjectMapRecord,
0069            const int iBxInEvent,
0070            L1GlobalTriggerObjectMapRecord *gtObjectMapRecord,
0071            const unsigned int numberPhysTriggers,
0072            const int nrL1Mu,
0073            const int nrL1NoIsoEG,
0074            const int nrL1IsoEG,
0075            const int nrL1CenJet,
0076            const int nrL1ForJet,
0077            const int nrL1TauJet,
0078            const int nrL1JetCounts,
0079            const int ifMuEtaNumberBits,
0080            const int ifCaloEtaNumberBits);
0081 
0082   /// clear GTL
0083   void reset();
0084 
0085   /// print received Muon dataWord
0086   void printGmtData(const int iBxInEvent) const;
0087 
0088   /// return decision
0089   inline const std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers> &getDecisionWord() const {
0090     return m_gtlDecisionWord;
0091   }
0092 
0093   /// return algorithm OR decision
0094   inline const std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers> &getAlgorithmOR() const {
0095     return m_gtlAlgorithmOR;
0096   }
0097 
0098   /// return global muon trigger candidate
0099   inline const std::vector<const L1MuGMTCand *> *getCandL1Mu() const { return m_candL1Mu; }
0100 
0101 public:
0102   inline void setVerbosity(const int verbosity) { m_verbosity = verbosity; }
0103 
0104 private:
0105   // cached stuff
0106 
0107   // trigger menu
0108   const edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> m_l1GtMenuToken;
0109 
0110   // L1 scales (phi, eta) for Mu, Calo and EnergySum objects
0111   const edm::ESGetToken<L1CaloGeometry, L1CaloGeometryRecord> m_l1CaloGeometryToken;
0112   const L1CaloGeometry *m_l1CaloGeometry;
0113   unsigned long long m_l1CaloGeometryCacheID;
0114 
0115   const edm::ESGetToken<L1MuTriggerScales, L1MuTriggerScalesRcd> m_l1MuTriggerScalesToken;
0116   const L1MuTriggerScales *m_l1MuTriggerScales;
0117   unsigned long long m_l1MuTriggerScalesCacheID;
0118 
0119   // conversions for eta and phi
0120   L1GtEtaPhiConversions *m_gtEtaPhiConversions;
0121 
0122 private:
0123   std::vector<const L1MuGMTCand *> *m_candL1Mu;
0124 
0125   std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers> m_gtlAlgorithmOR;
0126   std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers> m_gtlDecisionWord;
0127 
0128   // cache of maps
0129   std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap> m_conditionResultMaps;
0130 
0131 private:
0132   /// verbosity level
0133   int m_verbosity;
0134   bool m_isDebugEnabled;
0135 };
0136 
0137 #endif