Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-16 06:15:48

0001 //---------------------------------------------
0002 //
0003 //   \class L1MuGlobalMuonTrigger
0004 //
0005 //   Description: L1 Global Muon Trigger
0006 //
0007 //
0008 //
0009 //   Author :
0010 //   Ivan Mikulec                    HEPHY Vienna
0011 //
0012 //--------------------------------------------------
0013 #ifndef L1TriggerGlobalMuonTrigger_L1MuGlobalMuonTrigger_h
0014 #define L1TriggerGlobalMuonTrigger_L1MuGlobalMuonTrigger_h
0015 
0016 //---------------
0017 // C++ Headers --
0018 //---------------
0019 
0020 #include <memory>
0021 
0022 //----------------------
0023 // Base Class Headers --
0024 //----------------------
0025 #include "FWCore/Framework/interface/one/EDProducer.h"
0026 
0027 //------------------------------------
0028 // Collaborating Class Declarations --
0029 //------------------------------------
0030 #include "FWCore/Framework/interface/Event.h"
0031 #include "DataFormats/Common/interface/Handle.h"
0032 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0033 #include "FWCore/Utilities/interface/ESGetToken.h"
0034 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
0035 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutRecord.h"
0036 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"
0037 
0038 #include "CondFormats/L1TObjects/interface/L1MuGMTScales.h"
0039 #include "CondFormats/DataRecord/interface/L1MuGMTScalesRcd.h"
0040 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
0041 #include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h"
0042 #include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h"
0043 #include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h"
0044 #include "CondFormats/L1TObjects/interface/L1MuGMTParameters.h"
0045 #include "CondFormats/DataRecord/interface/L1MuGMTParametersRcd.h"
0046 #include "CondFormats/L1TObjects/interface/L1MuGMTChannelMask.h"
0047 #include "CondFormats/DataRecord/interface/L1MuGMTChannelMaskRcd.h"
0048 #include "CondFormats/L1TObjects/interface/L1CaloGeometry.h"
0049 #include "CondFormats/DataRecord/interface/L1CaloGeometryRecord.h"
0050 
0051 class L1MuGMTConfig;
0052 class L1MuGMTPSB;
0053 class L1MuGMTMatcher;
0054 class L1MuGMTCancelOutUnit;
0055 class L1MuGMTMipIsoAU;
0056 class L1MuGMTMerger;
0057 class L1MuGMTSorter;
0058 
0059 class L1MuGMTExtendedCand;
0060 
0061 class L1MuGMTDebugBlock;
0062 
0063 //---------------------
0064 //-- Class Interface --
0065 //---------------------
0066 class L1MuGlobalMuonTrigger : public edm::one::EDProducer<edm::one::SharedResources> {
0067 public:
0068   explicit L1MuGlobalMuonTrigger(const edm::ParameterSet&);
0069   ~L1MuGlobalMuonTrigger() override;
0070   void beginJob() override;
0071 
0072   void produce(edm::Event&, const edm::EventSetup&) override;
0073 
0074   void reset();
0075 
0076   /// return pointer to PSB
0077   inline const L1MuGMTPSB* Data() const { return m_PSB; }
0078 
0079   /// return pointer to Matcher
0080   inline const L1MuGMTMatcher* Matcher(int id) const { return m_Matcher[id]; }
0081 
0082   /// return pointer to Cancel Out Unit
0083   inline const L1MuGMTCancelOutUnit* CancelOutUnit(int id) const { return m_CancelOutUnit[id]; }
0084 
0085   /// return pointer to MIP & ISO bit assignment unit
0086   inline const L1MuGMTMipIsoAU* MipIsoAU(int id) const { return m_MipIsoAU[id]; }
0087 
0088   /// return pointer to Merger
0089   inline const L1MuGMTMerger* Merger(int id) const { return m_Merger[id]; }
0090 
0091   /// return pointer to Sorter
0092   inline const L1MuGMTSorter* Sorter() const { return m_Sorter; }
0093 
0094   /// get the GMT readout data for the triggered bx
0095   /// readout data contains input and output muons as well as MIP and Quiet bits
0096   /// for 3 or 5 bx around the triggered bx
0097   std::unique_ptr<L1MuGMTReadoutCollection> getReadoutCollection();
0098 
0099   /// return a reference to the current record in the ring buffer
0100   L1MuGMTReadoutRecord* currentReadoutRecord() const { return m_ReadoutRingbuffer.back(); };
0101 
0102   /// for debug: return the debug block (in order to fill it)
0103   L1MuGMTDebugBlock* DebugBlockForFill() const { return m_db.get(); };
0104 
0105 private:
0106   L1MuGMTPSB* m_PSB;
0107   L1MuGMTMatcher* m_Matcher[2];
0108   L1MuGMTCancelOutUnit* m_CancelOutUnit[4];
0109   L1MuGMTMipIsoAU* m_MipIsoAU[2];
0110   L1MuGMTMerger* m_Merger[2];
0111   L1MuGMTSorter* m_Sorter;
0112 
0113   std::vector<L1MuGMTExtendedCand> m_ExtendedCands;
0114   std::vector<L1MuGMTReadoutRecord*> m_ReadoutRingbuffer;
0115 
0116   bool m_writeLUTsAndRegs;
0117   bool m_sendMipIso;
0118 
0119   static std::shared_ptr<L1MuGMTConfig> m_config;
0120 
0121   static std::shared_ptr<L1MuGMTDebugBlock> m_db;
0122 
0123   unsigned long long m_L1MuGMTScalesCacheID;
0124   unsigned long long m_L1MuTriggerScalesCacheID;
0125   unsigned long long m_L1MuTriggerPtScaleCacheID;
0126   unsigned long long m_L1MuGMTParametersCacheID;
0127   unsigned long long m_L1MuGMTChannelMaskCacheID;
0128   unsigned long long m_L1CaloGeometryCacheID;
0129 
0130   edm::ESGetToken<L1MuGMTScales, L1MuGMTScalesRcd> m_gmtScalesToken;
0131   edm::ESGetToken<L1MuTriggerScales, L1MuTriggerScalesRcd> m_trigScalesToken;
0132   edm::ESGetToken<L1MuTriggerPtScale, L1MuTriggerPtScaleRcd> m_trigPtScaleToken;
0133   edm::ESGetToken<L1MuGMTParameters, L1MuGMTParametersRcd> m_gmtParamsToken;
0134   edm::ESGetToken<L1MuGMTChannelMask, L1MuGMTChannelMaskRcd> m_gmtChanMaskToken;
0135   edm::ESGetToken<L1CaloGeometry, L1CaloGeometryRecord> m_caloGeomToken;
0136 };
0137 
0138 #endif  // L1TriggerGlobalMuonTrigger_L1MuGlobalMuonTrigger_h