Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //-------------------------------------------------
0002 //
0003 //   \class L1MuGMTInputEvent
0004 //
0005 //   Description:   Test file for the GMT standalone program. Contains
0006 //          all the input data the GMT receives (CSC, RPC, DT, GCT)
0007 //
0008 //
0009 //
0010 //   Author :
0011 //   Tobias Noebauer                 HEPHY Vienna
0012 //
0013 //   Migrated to CMSSW:
0014 //   I. Mikulec
0015 //
0016 //--------------------------------------------------
0017 #ifndef L1TriggerGlobalMuonTrigger_L1MuGMTInputEvent_h
0018 #define L1TriggerGlobalMuonTrigger_L1MuGMTInputEvent_h
0019 
0020 //---------------
0021 // C++ Headers --
0022 //---------------
0023 #include <string>
0024 #include <vector>
0025 #include <map>
0026 
0027 //----------------------
0028 // Base Class Headers --
0029 //----------------------
0030 
0031 //------------------------------------
0032 // Collaborating Class Declarations --
0033 //------------------------------------
0034 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMatrix.h"
0035 class L1MuRegionalCand;
0036 
0037 //---------------------
0038 //-- Class Interface --
0039 //---------------------
0040 
0041 class L1MuGMTInputEvent {
0042 public:
0043   /// constructor, initializes everything to 0/false, apart from
0044   /// the ISO bits, which are initialized to true;
0045   L1MuGMTInputEvent();
0046 
0047   // destructor
0048   virtual ~L1MuGMTInputEvent();
0049 
0050   /// resets everything to 0/false, apart from
0051   /// the ISO bits, which are all set to true;
0052   void reset();
0053 
0054   void setRunNumber(unsigned long runnr) { m_runnr = runnr; };
0055 
0056   void setEventNumber(unsigned long eventnr) { m_evtnr = eventnr; };
0057 
0058   void addInputMuon(std::string chipid, const L1MuRegionalCand& inMu);
0059 
0060   //eta = [0,13], phi = [0,17]
0061   void setMipBit(unsigned etaIndex, unsigned phiIndex, bool val) { m_mip_bits(etaIndex, phiIndex) = val; };
0062 
0063   //eta = [0,13], phi = [0,17]
0064   void setIsoBit(unsigned etaIndex, unsigned phiIndex, bool val) { m_iso_bits(etaIndex, phiIndex) = val; };
0065 
0066   /// get the Run number
0067   unsigned long getRunNumber() const { return m_runnr; };
0068 
0069   /// get the Event number
0070   unsigned long getEventNumber() const { return m_evtnr; };
0071 
0072   /// is the event empty?
0073   bool isEmpty() const { return (m_runnr == 0L) && (m_evtnr == 0L); };
0074 
0075   /// get [index]th input muon in chip [chipid]
0076   /// @param chipid is the input chip ID (IND, INC, INB, INF)
0077   /// @param index  is the index of the muon in the input chip (starting with 0)
0078   /// @return the L1MuRegionalCand specified or 0 if index is out of range
0079   const L1MuRegionalCand* getInputMuon(std::string chipid, unsigned index) const;
0080 
0081   /// get the MIP / ISO bits
0082   const L1MuGMTMatrix<bool>& getMipBits() const { return m_mip_bits; };
0083 
0084   const L1MuGMTMatrix<bool>& getIsoBits() const { return m_iso_bits; };
0085 
0086   const bool& getMipBit(unsigned etaIndex, unsigned phiIndex) { return m_mip_bits(etaIndex, phiIndex); };
0087   const bool& getIsoBit(unsigned etaIndex, unsigned phiIndex) { return m_iso_bits(etaIndex, phiIndex); };
0088 
0089 private:
0090   unsigned long m_runnr;
0091   unsigned long m_evtnr;
0092 
0093   std::map<std::string, std::vector<L1MuRegionalCand> > m_inputmuons;
0094 
0095   L1MuGMTMatrix<bool> m_mip_bits;
0096   L1MuGMTMatrix<bool> m_iso_bits;
0097 };
0098 
0099 #endif