Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //-------------------------------------------------
0002 //
0003 /**  \class L1MuBMTrackSegPhi
0004  *
0005  *   PHI Track Segment
0006  *
0007  *
0008  *
0009  *   N. Neumeister            CERN EP
0010  */
0011 //
0012 //--------------------------------------------------
0013 #ifndef L1MUBM_TRACK_SEG_PHI_H
0014 #define L1MUBM_TRACK_SEG_PHI_H
0015 
0016 //---------------
0017 // C++ Headers --
0018 //---------------
0019 
0020 #include <iosfwd>
0021 #include <vector>
0022 
0023 //----------------------
0024 // Base Class Headers --
0025 //----------------------
0026 
0027 //------------------------------------
0028 // Collaborating Class Declarations --
0029 //------------------------------------
0030 
0031 #include "DataFormats/L1TMuon/interface/BMTF/L1MuBMTrackSegLoc.h"
0032 
0033 //              ---------------------
0034 //              -- Class Interface --
0035 //              ---------------------
0036 
0037 class L1MuBMTrackSegPhi;
0038 
0039 typedef std::vector<L1MuBMTrackSegPhi> L1MuBMTrackSegPhiCollection;
0040 
0041 class L1MuBMTrackSegPhi {
0042 public:
0043   /// quality code of BBMX phi track segments
0044   enum TSQuality { Li, Lo, Hi, Ho, LL, HL, HH, Null };
0045 
0046   /// default constructor
0047   L1MuBMTrackSegPhi();
0048 
0049   /// constructor
0050   L1MuBMTrackSegPhi(int wheel_id,
0051                     int sector_id,
0052                     int station_id,
0053                     int phi = 0,
0054                     int phib = 0,
0055                     TSQuality quality = Null,
0056                     bool tag = false,
0057                     int bx = 17,
0058                     bool etaFlag = false);
0059 
0060   /// constructor
0061   L1MuBMTrackSegPhi(const L1MuBMTrackSegLoc&,
0062                     int phi = 0,
0063                     int phib = 0,
0064                     TSQuality quality = Null,
0065                     bool tag = false,
0066                     int bx = 17,
0067                     bool etaFlag = false);
0068 
0069   /// copy constructor
0070   L1MuBMTrackSegPhi(const L1MuBMTrackSegPhi&) = default;
0071 
0072   /// move constructor
0073   L1MuBMTrackSegPhi(L1MuBMTrackSegPhi&&) = default;
0074 
0075   /// destructor
0076   virtual ~L1MuBMTrackSegPhi();
0077 
0078   /// reset phi track segment
0079   void reset();
0080 
0081   /// return phi-value in global coordinates [0,2pi]
0082   double phiValue() const;
0083 
0084   /// return phib-value in global coordinates [0,2pi]
0085   double phibValue() const;
0086 
0087   /// return wheel
0088   inline int wheel() const { return m_location.wheel(); }
0089 
0090   /// return sector
0091   inline int sector() const { return m_location.sector(); }
0092 
0093   /// return station
0094   inline int station() const { return m_location.station(); }
0095 
0096   /// return location of phi track segment
0097   inline const L1MuBMTrackSegLoc& where() const { return m_location; }
0098 
0099   /// return phi
0100   inline int phi() const { return m_phi; }
0101 
0102   /// return phib
0103   inline int phib() const { return m_phib; }
0104 
0105   /// return quality code
0106   inline int quality() const { return m_quality; }
0107 
0108   /// return tag (second TS tag)
0109   inline int tag() const { return m_tag; }
0110 
0111   /// return bunch crossing
0112   inline int bx() const { return m_bx; }
0113 
0114   /// return eta flag
0115   inline bool etaFlag() const { return m_etaFlag; }
0116 
0117   /// is it an empty phi track segment?
0118   inline bool empty() const { return m_quality == Null; }
0119 
0120   /// set eta flag
0121   inline void setEtaFlag(bool flag) { m_etaFlag = flag; }
0122 
0123   /// assignment operator
0124   L1MuBMTrackSegPhi& operator=(const L1MuBMTrackSegPhi&) = default;
0125 
0126   /// move assignment operator
0127   L1MuBMTrackSegPhi& operator=(L1MuBMTrackSegPhi&&) = default;
0128 
0129   /// equal operator
0130   bool operator==(const L1MuBMTrackSegPhi&) const;
0131 
0132   /// unequal operator
0133   bool operator!=(const L1MuBMTrackSegPhi&) const;
0134 
0135   /// overload output stream operator for phi track segment quality
0136   friend std::ostream& operator<<(std::ostream&, const TSQuality&);
0137 
0138   /// overload output stream operator for phi track segments
0139   friend std::ostream& operator<<(std::ostream&, const L1MuBMTrackSegPhi&);
0140 
0141 private:
0142   L1MuBMTrackSegLoc m_location;  // logical location of TS
0143   int m_phi;                     // 12 bits
0144   int m_phib;                    // 10 bits
0145   TSQuality m_quality;           // 3 bits
0146   bool m_tag;                    // tag for second TS (of chamber)
0147   int m_bx;                      // bunch crossing identifier
0148   bool m_etaFlag;                // eta flag (for overlap region)
0149 };
0150 
0151 #endif