Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:27

0001 //-------------------------------------------------
0002 //
0003 /** \class L1MuGMTReadoutRecord
0004  *
0005  *  L1 Global Muon Trigger Readout Buffer
0006  *
0007  *  Contains the data that the GMT sends to readout
0008  *  for one bunch crossing.
0009  *
0010  *  Only simple data members are used so that it is easier
0011  *  to make the data persistent or use it in an other context.
0012 */
0013 //
0014 //
0015 //   Author :
0016 //   H. Sakulin                  HEPHY Vienna
0017 //
0018 //   Migrated to CMSSW:
0019 //   I. Mikulec
0020 //
0021 //--------------------------------------------------
0022 #ifndef DataFormatsL1GlobalMuonTrigger_L1MuGMTReadoutRecord_h
0023 #define DataFormatsL1GlobalMuonTrigger_L1MuGMTReadoutRecord_h
0024 
0025 //---------------
0026 // C++ Headers --
0027 //---------------
0028 #include <vector>
0029 
0030 //----------------------
0031 // Base Class Headers --
0032 //----------------------
0033 
0034 //------------------------------------
0035 // Collaborating Class Declarations --
0036 //------------------------------------
0037 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTExtendedCand.h"
0038 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
0039 
0040 //              ---------------------
0041 //              -- Class Interface --
0042 //              ---------------------
0043 
0044 class L1MuGMTReadoutRecord {
0045 public:
0046   /// constructors
0047   L1MuGMTReadoutRecord();
0048   L1MuGMTReadoutRecord(int bxie);
0049 
0050   /// destructor
0051   virtual ~L1MuGMTReadoutRecord();
0052 
0053   /// reset the record
0054   void reset();
0055 
0056   //
0057   // Getters
0058   //
0059 
0060   /// get counters
0061   int getBxNr() const { return (int)m_BxNr; };
0062   int getBxCounter() const { return (int)m_BxInEvent; };  // for backward compatibility, do not use
0063   int getBxInEvent() const { return (int)m_BxInEvent; };
0064   int getEvNr() const { return (int)m_EvNr; };
0065   int getBCERR() const { return (int)m_BCERR; };
0066 
0067   /// get GMT candidates vector
0068   std::vector<L1MuGMTExtendedCand> getGMTCands() const;
0069 
0070   /// get GMT candidates vector as stored in data (no rank info)
0071   std::vector<L1MuGMTExtendedCand>& getGMTCandsData();
0072 
0073   /// get GMT barrel candidates vector
0074   std::vector<L1MuGMTExtendedCand> getGMTBrlCands() const;
0075   std::vector<L1MuGMTExtendedCand>& getGMTBrlCandsData() { return m_BarrelCands; };
0076 
0077   /// get GMT forward candidates vector
0078   std::vector<L1MuGMTExtendedCand> getGMTFwdCands() const;
0079 
0080   /// get DT candidates vector
0081   std::vector<L1MuRegionalCand> getDTBXCands() const;
0082 
0083   /// get CSC candidates vector
0084   std::vector<L1MuRegionalCand> getCSCCands() const;
0085 
0086   /// get barrel RPC candidates vector
0087   std::vector<L1MuRegionalCand> getBrlRPCCands() const;
0088 
0089   /// get forward RPC candidates vector
0090   std::vector<L1MuRegionalCand> getFwdRPCCands() const;
0091 
0092   /// get MIP bit
0093   unsigned getMIPbit(int eta, int phi) const;
0094 
0095   /// get Quiet bit
0096   unsigned getQuietbit(int eta, int phi) const;
0097 
0098   //
0099   // Setters
0100   //
0101 
0102   /// set counters
0103   void setBxNr(int bxnr) { m_BxNr = (unsigned)bxnr; };
0104   void setBxCounter(int bxie) { m_BxInEvent = (unsigned)bxie; };  // for backward compatibility, do not use
0105   void setBxInEvent(int bxie) { m_BxInEvent = (unsigned)bxie; };
0106   void setEvNr(int evnr) { m_EvNr = (unsigned)evnr; };
0107   void setBCERR(int bcerr) { m_BCERR = (unsigned)bcerr; };
0108 
0109   /// set GMT barrel candidate
0110   void setGMTBrlCand(int nr, L1MuGMTExtendedCand const& cand);
0111 
0112   /// set GMT barrel candidate
0113   void setGMTBrlCand(int nr, unsigned data, unsigned rank);
0114 
0115   /// set GMT forward candidate
0116   void setGMTFwdCand(int nr, L1MuGMTExtendedCand const& cand);
0117 
0118   /// set GMT forward candidate
0119   void setGMTFwdCand(int nr, unsigned data, unsigned rank);
0120 
0121   /// set GMT candidate (does not store rank)
0122   void setGMTCand(int nr, L1MuGMTExtendedCand const& cand);
0123 
0124   /// set GMT candidate (does not store rank)
0125   void setGMTCand(int nr, unsigned data);
0126 
0127   /// set Input muon
0128   void setInputCand(int nr, unsigned data);
0129 
0130   /// set Input muon
0131   void setInputCand(int nr, L1MuRegionalCand const& cand);
0132 
0133   /// set MIP bit
0134   void setMIPbit(int eta, int phi);
0135 
0136   /// set Quiet bit
0137   void setQuietbit(int eta, int phi);
0138 
0139 private:
0140   unsigned getBrlRank(int i) const;
0141   unsigned getFwdRank(int i) const;
0142 
0143   void setBrlRank(int i, unsigned value);
0144   void setFwdRank(int i, unsigned value);
0145 
0146 private:
0147   unsigned m_BxNr;
0148   unsigned m_BxInEvent;
0149   unsigned m_EvNr;
0150 
0151   unsigned m_BCERR;
0152 
0153   std::vector<L1MuRegionalCand> m_InputCands;
0154 
0155   std::vector<L1MuGMTExtendedCand> m_BarrelCands;
0156   std::vector<L1MuGMTExtendedCand> m_ForwardCands;
0157   std::vector<L1MuGMTExtendedCand> m_GMTCands;
0158 
0159   // mip/iso bits (252 EACH)
0160   unsigned m_MIPbits[8];
0161   unsigned m_Quietbits[8];
0162 };
0163 
0164 #endif