Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //-------------------------------------------------
0002 //
0003 /**  \class L1MuDTTrack
0004  *
0005  *   L1 Muon Track Candidate
0006  *
0007  *
0008  *
0009  *   N. Neumeister            CERN EP
0010  *   J. Troconiz              UAM Madrid
0011  */
0012 //
0013 //--------------------------------------------------
0014 #ifndef L1MUDT_TRACK_H
0015 #define L1MUDT_TRACK_H
0016 
0017 //---------------
0018 // C++ Headers --
0019 //---------------
0020 
0021 #include <iosfwd>
0022 #include <string>
0023 #include <vector>
0024 
0025 //----------------------
0026 // Base Class Headers --
0027 //----------------------
0028 
0029 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
0030 
0031 //------------------------------------
0032 // Collaborating Class Declarations --
0033 //------------------------------------
0034 
0035 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackAssParam.h"
0036 #include "L1Trigger/DTTrackFinder/interface/L1MuDTAddressArray.h"
0037 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackSegPhi.h"
0038 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackSegEta.h"
0039 #include "L1Trigger/DTTrackFinder/interface/L1MuDTSecProcId.h"
0040 
0041 //              ---------------------
0042 //              -- Class Interface --
0043 //              ---------------------
0044 
0045 class L1MuDTTrack : public L1MuRegionalCand {
0046 public:
0047   /// default constructor
0048   L1MuDTTrack();
0049 
0050   /// constructor
0051   L1MuDTTrack(const L1MuDTSecProcId&);
0052 
0053   /// copy constructor
0054   L1MuDTTrack(const L1MuDTTrack&);
0055 
0056   /// destructor
0057   ~L1MuDTTrack() override;
0058 
0059   /// reset muon candidate
0060   void reset() override;
0061 
0062   /// get name of object
0063   inline std::string name() const { return m_name; }
0064 
0065   /// get pt-code (5 bits)
0066   inline unsigned int pt() const { return pt_packed(); }
0067 
0068   /// get phi-code (8 bits)
0069   inline unsigned int phi() const { return phi_packed(); }
0070 
0071   /// get eta-code (6 bits)
0072   inline unsigned int eta() const { return eta_packed(); }
0073 
0074   /// get fine eta bit
0075   inline bool fineEtaBit() const { return isFineHalo(); }
0076 
0077   /// get charge (1 bit)
0078   inline int charge() const { return chargeValue(); }
0079 
0080   /// get track-class
0081   inline TrackClass tc() const { return m_tc; }
0082 
0083   /// is it an empty  muon candidate?
0084   inline bool empty() const override { return m_empty; }
0085 
0086   /// return Sector Processor in which the muon candidate was found
0087   inline const L1MuDTSecProcId& spid() const { return m_spid; }
0088 
0089   /// get address-array for this muon candidate
0090   inline L1MuDTAddressArray address() const { return m_addArray; }
0091 
0092   /// get relative address of a given station
0093   inline int address(int stat) const { return m_addArray.station(stat); }
0094 
0095   /// return number of phi track segments used to form the muon candidate
0096   inline int numberOfTSphi() const { return m_tsphiList.size(); }
0097 
0098   /// return number of eta track segments used to form the muon candidate
0099   inline int numberOfTSeta() const { return m_tsetaList.size(); }
0100 
0101   /// return all phi track segments of the muon candidate
0102   const std::vector<L1MuDTTrackSegPhi>& getTSphi() const { return m_tsphiList; }
0103 
0104   /// return start phi track segment of muon candidate
0105   const L1MuDTTrackSegPhi& getStartTSphi() const;
0106 
0107   /// return end phi track segment of muon candidate
0108   const L1MuDTTrackSegPhi& getEndTSphi() const;
0109 
0110   /// return all eta track segments of the muon candidate
0111   const std::vector<L1MuDTTrackSegEta>& getTSeta() const { return m_tsetaList; }
0112 
0113   /// return start eta track segment of muon candidate
0114   const L1MuDTTrackSegEta& getStartTSeta() const;
0115 
0116   /// return end eta track segment of muon candidate
0117   const L1MuDTTrackSegEta& getEndTSeta() const;
0118 
0119   /// enable muon candidate
0120   inline void enable() {
0121     m_empty = false;
0122     setType(0);
0123   }
0124 
0125   /// disable muon candidate
0126   inline void disable() { m_empty = true; }
0127 
0128   /// set name of object
0129   inline void setName(std::string name) { m_name = name; }
0130 
0131   /// set track-class of muon candidate
0132   inline void setTC(TrackClass tc) { m_tc = tc; }
0133 
0134   /// set phi-code of muon candidate
0135   inline void setPhi(int phi) { setPhiPacked(phi); }
0136 
0137   /// set eta-code of muon candidate
0138   void setEta(int eta);
0139 
0140   /// set fine eta bit
0141   inline void setFineEtaBit() { setFineHalo(true); }
0142 
0143   /// set pt-code of muon candidate
0144   inline void setPt(int pt) { setPtPacked(pt); }
0145 
0146   /// set charge of muon candidate
0147   inline void setCharge(int charge) {
0148     setChargeValue(charge);
0149     setChargeValid(true);
0150   }
0151 
0152   /// set quality of muon candidate
0153   inline void setQuality(unsigned int quality) { setQualityPacked(quality); }
0154 
0155   /// set relative addresses of muon candidate
0156   inline void setAddresses(const L1MuDTAddressArray& addr) { m_addArray = addr; }
0157 
0158   /// set phi track segments used to form the muon candidate
0159   void setTSphi(const std::vector<const L1MuDTTrackSegPhi*>& tsList);
0160 
0161   /// set eta track segments used to form the muon candidate
0162   void setTSeta(const std::vector<const L1MuDTTrackSegEta*>& tsList);
0163 
0164   /// assignment operator
0165   L1MuDTTrack& operator=(const L1MuDTTrack&);
0166 
0167   /// equal operator
0168   bool operator==(const L1MuDTTrack&) const;
0169 
0170   /// unequal operator
0171   bool operator!=(const L1MuDTTrack&) const;
0172 
0173   /// print parameters of muon candidate
0174   void print() const override;
0175 
0176   /// output stream operator
0177   friend std::ostream& operator<<(std::ostream&, const L1MuDTTrack&);
0178 
0179   /// define a rank for muon candidates
0180   static bool rank(const L1MuDTTrack* first, const L1MuDTTrack* second) {
0181     unsigned short int rank_f = 0;  // rank of first
0182     unsigned short int rank_s = 0;  // rank of second
0183     if (first)
0184       rank_f = 10 * first->pt() + first->quality();
0185     if (second)
0186       rank_s = 10 * second->pt() + second->quality();
0187     return rank_f > rank_s;
0188   }
0189 
0190 private:
0191   L1MuDTSecProcId m_spid;  // which SP found the track
0192   std::string m_name;
0193   bool m_empty;
0194   TrackClass m_tc;
0195 
0196   L1MuDTAddressArray m_addArray;
0197   std::vector<L1MuDTTrackSegPhi> m_tsphiList;
0198   std::vector<L1MuDTTrackSegEta> m_tsetaList;
0199 };
0200 
0201 #endif