CMS 3D CMS Logo

L1MuBMTrack.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
12 //
13 //--------------------------------------------------
14 #ifndef L1MUBM_TRACK_H
15 #define L1MUBM_TRACK_H
16 
17 //---------------
18 // C++ Headers --
19 //---------------
20 
21 #include <iosfwd>
22 #include <string>
23 #include <vector>
24 
25 //----------------------
26 // Base Class Headers --
27 //----------------------
28 
30 
31 //------------------------------------
32 // Collaborating Class Declarations --
33 //------------------------------------
34 
40 
41 // ---------------------
42 // -- Class Interface --
43 // ---------------------
44 
46 
47 typedef std::vector<L1MuBMTrack> L1MuBMTrackCollection;
48 
50 public:
52  L1MuBMTrack();
53 
56 
58  L1MuBMTrack(const L1MuBMTrack&);
59 
61  ~L1MuBMTrack() override;
62 
64  void reset();
65 
67  inline std::string name() const { return m_name; }
68 
70  inline unsigned int pt() const { return hwPt(); }
71 
73  inline unsigned int phi() const { return hwPhi(); }
74 
76  inline int eta() const { return hwEta(); }
77 
79  inline bool fineEtaBit() const { return hwHF(); }
80 
82  inline int charge() const { return hwSign(); }
83 
85  inline unsigned int quality() const { return hwQual(); }
86 
88  inline TrackClass tc() const { return m_tc; }
89 
91  inline bool empty() const { return m_empty; }
92 
94  inline const L1MuBMSecProcId& spid() const { return m_spid; }
95 
97  inline L1MuBMAddressArray address() const { return m_addArray; }
98 
100  inline int address(int stat) const { return m_addArray.station(stat); }
101 
103  inline int bx() const { return m_bx; }
104 
106  inline int numberOfTSphi() const { return m_tsphiList.size(); }
107 
109  inline int numberOfTSeta() const { return m_tsetaList.size(); }
110 
112  const std::vector<L1MuBMTrackSegPhi>& getTSphi() const { return m_tsphiList; }
113 
115  const L1MuBMTrackSegPhi& getStartTSphi() const;
116 
118  const L1MuBMTrackSegPhi& getEndTSphi() const;
119 
121  const std::vector<L1MuBMTrackSegEta>& getTSeta() const { return m_tsetaList; }
122 
124  const L1MuBMTrackSegEta& getStartTSeta() const;
125 
127  const L1MuBMTrackSegEta& getEndTSeta() const;
128 
130  inline void enable() {
131  m_empty = false;
133  };
134 
136  inline void disable() { m_empty = true; }
137 
139  inline void setName(std::string name) { m_name = name; }
140 
142  inline void setTC(TrackClass tc) { m_tc = tc; }
143 
145  inline void setPhi(int phi) { setHwPhi(phi); }
146 
148  void setEta(int eta);
149 
151  inline void setFineEtaBit() { setHwHF(true); }
152 
154  inline void setPt(int pt) { setHwPt(pt); }
155 
157  inline void setCharge(int charge) { setHwSign(charge); }
158 
160  inline void setBx(int bx) { m_bx = bx; }
161 
163  inline void setQuality(unsigned int quality) { setHwQual(quality); }
164 
167 
169  void setTSphi(const std::vector<const L1MuBMTrackSegPhi*>& tsList);
170 
172  void setTSeta(const std::vector<const L1MuBMTrackSegEta*>& tsList);
173 
176 
178  bool operator==(const L1MuBMTrack&) const;
179 
181  bool operator!=(const L1MuBMTrack&) const;
182 
184  void print() const;
185 
187  friend std::ostream& operator<<(std::ostream&, const L1MuBMTrack&);
188 
190  static bool rank(const L1MuBMTrack* first, const L1MuBMTrack* second) {
191  unsigned short int rank_f = 0; // rank of first
192  unsigned short int rank_s = 0; // rank of second
193  if (first)
194  rank_f = first->pt() + 512 * first->quality();
195  if (second)
196  rank_s = second->pt() + 512 * second->quality();
197  return rank_f > rank_s;
198  }
199 
200 private:
201  L1MuBMSecProcId m_spid; // which SP found the track
203  bool m_empty;
205  int m_bx;
206 
208  std::vector<L1MuBMTrackSegPhi> m_tsphiList;
209  std::vector<L1MuBMTrackSegEta> m_tsetaList;
210 };
211 
212 #endif
const int hwPhi() const
Get compressed local phi (returned int * 2*pi/576 = local phi in rad)
void setTC(TrackClass tc)
set track-class of muon candidate
Definition: L1MuBMTrack.h:142
void setHwPhi(int bits)
Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits)
void setPt(int pt)
set pt-code of muon candidate
Definition: L1MuBMTrack.h:154
unsigned int pt() const
get pt-code (5 bits)
Definition: L1MuBMTrack.h:70
int numberOfTSphi() const
return number of phi track segments used to form the muon candidate
Definition: L1MuBMTrack.h:106
L1MuBMTrack & operator=(const L1MuBMTrack &)
assignment operator
Definition: L1MuBMTrack.cc:173
TrackClass tc() const
get track-class
Definition: L1MuBMTrack.h:88
const L1MuBMTrackSegEta & getEndTSeta() const
return end eta track segment of muon candidate
Definition: L1MuBMTrack.cc:142
void setQuality(unsigned int quality)
set quality of muon candidate
Definition: L1MuBMTrack.h:163
void setPhi(int phi)
set phi-code of muon candidate
Definition: L1MuBMTrack.h:145
std::vector< L1MuBMTrack > L1MuBMTrackCollection
Definition: L1MuBMTrack.h:45
void setAddresses(const L1MuBMAddressArray &addr)
set relative addresses of muon candidate
Definition: L1MuBMTrack.h:166
const std::vector< L1MuBMTrackSegPhi > & getTSphi() const
return all phi track segments of the muon candidate
Definition: L1MuBMTrack.h:112
void setName(std::string name)
set name of object
Definition: L1MuBMTrack.h:139
const L1MuBMTrackSegPhi & getStartTSphi() const
return start phi track segment of muon candidate
Definition: L1MuBMTrack.cc:127
void setCharge(int charge)
set charge of muon candidate
Definition: L1MuBMTrack.h:157
bool operator==(const L1MuBMTrack &) const
equal operator
Definition: L1MuBMTrack.cc:191
void disable()
disable muon candidate
Definition: L1MuBMTrack.h:136
std::vector< L1MuBMTrackSegEta > m_tsetaList
Definition: L1MuBMTrack.h:209
const int hwPt() const
Get compressed pT (returned int * 0.5 = pT (GeV))
L1MuBMSecProcId m_spid
Definition: L1MuBMTrack.h:201
const int hwHF() const
Get HF (halo / fine eta) bit (EMTF: halo -> 1; BMTF: fine eta -> 1)
bool fineEtaBit() const
get fine eta bit
Definition: L1MuBMTrack.h:79
void enable()
enable muon candidate
Definition: L1MuBMTrack.h:130
const int hwQual() const
Get quality code.
const int hwEta() const
Get compressed eta (returned int * 0.010875 = eta)
const L1MuBMTrackSegEta & getStartTSeta() const
return start eta track segment of muon candidate
Definition: L1MuBMTrack.cc:137
unsigned int quality() const
get quality
Definition: L1MuBMTrack.h:85
U second(std::pair< T, U > const &p)
int numberOfTSeta() const
return number of eta track segments used to form the muon candidate
Definition: L1MuBMTrack.h:109
std::string name() const
get name of object
Definition: L1MuBMTrack.h:67
int bx() const
get the bunch crossing for this muon candidate
Definition: L1MuBMTrack.h:103
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
int charge() const
get charge (1 bit)
Definition: L1MuBMTrack.h:82
void print() const
print parameters of muon candidate
Definition: L1MuBMTrack.cc:249
const std::vector< L1MuBMTrackSegEta > & getTSeta() const
return all eta track segments of the muon candidate
Definition: L1MuBMTrack.h:121
void setTSphi(const std::vector< const L1MuBMTrackSegPhi *> &tsList)
set phi track segments used to form the muon candidate
Definition: L1MuBMTrack.cc:147
void setHwHF(bool bit)
Set HF (halo / fine eta) bit (EMTF: halo -> 1; BMTF: fine eta -> 1)
void setBx(int bx)
set charge of muon candidate
Definition: L1MuBMTrack.h:160
const L1MuBMSecProcId & spid() const
return Sector Processor in which the muon candidate was found
Definition: L1MuBMTrack.h:94
void setTSeta(const std::vector< const L1MuBMTrackSegEta *> &tsList)
set eta track segments used to form the muon candidate
Definition: L1MuBMTrack.cc:160
unsigned short station(int stat) const
get address of a given station [1-4]
const int hwSign() const
Get charge sign bit (charge = (-1)^(sign))
TrackClass m_tc
Definition: L1MuBMTrack.h:204
friend std::ostream & operator<<(std::ostream &, const L1MuBMTrack &)
output stream operator
void setHwQual(int bits)
Set compressed quality code as transmitted by hardware (4 bits)
void setHwPt(int bits)
Set compressed pT as transmitted by hardware LSB = 0.5 (9 bits)
void setFineEtaBit()
set fine eta bit
Definition: L1MuBMTrack.h:151
static bool rank(const L1MuBMTrack *first, const L1MuBMTrack *second)
define a rank for muon candidates
Definition: L1MuBMTrack.h:190
L1MuBMAddressArray address() const
get address-array for this muon candidate
Definition: L1MuBMTrack.h:97
const L1MuBMTrackSegPhi & getEndTSphi() const
return end phi track segment of muon candidate
Definition: L1MuBMTrack.cc:132
int address(int stat) const
get relative address of a given station
Definition: L1MuBMTrack.h:100
void reset()
reset muon candidate
Definition: L1MuBMTrack.cc:106
void setEta(int eta)
set eta-code of muon candidate
Definition: L1MuBMTrack.cc:118
std::vector< L1MuBMTrackSegPhi > m_tsphiList
Definition: L1MuBMTrack.h:208
unsigned int phi() const
get phi-code (8 bits)
Definition: L1MuBMTrack.h:73
std::string m_name
Definition: L1MuBMTrack.h:202
~L1MuBMTrack() override
destructor
Definition: L1MuBMTrack.cc:97
bool empty() const
is it an empty muon candidate?
Definition: L1MuBMTrack.h:91
bool operator!=(const L1MuBMTrack &) const
unequal operator
Definition: L1MuBMTrack.cc:220
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))
int eta() const
get eta-code (6 bits)
Definition: L1MuBMTrack.h:76
L1MuBMAddressArray m_addArray
Definition: L1MuBMTrack.h:207
L1MuBMTrack()
default constructor
Definition: L1MuBMTrack.cc:48