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 
42 
43 // ---------------------
44 // -- Class Interface --
45 // ---------------------
46 
48 
49 typedef std::vector<L1MuBMTrack> L1MuBMTrackCollection;
50 
52 
53  public:
54 
56  L1MuBMTrack();
57 
60 
62  L1MuBMTrack(const L1MuBMTrack&);
63 
65  ~L1MuBMTrack() override;
66 
68  void reset();
69 
71  inline std::string name() const { return m_name; }
72 
74  inline unsigned int pt() const { return hwPt(); }
75 
77  inline unsigned int phi() const { return hwPhi(); }
78 
80  inline int eta() const { return hwEta(); }
81 
83  inline bool fineEtaBit() const { return hwHF();}
84 
86  inline int charge() const { return hwSign(); }
87 
89  inline unsigned int quality() const { return hwQual(); }
90 
92  inline TrackClass tc() const { return m_tc; }
93 
95  inline bool empty() const { return m_empty; }
96 
98  inline const L1MuBMSecProcId& spid() const { return m_spid; }
99 
101  inline L1MuBMAddressArray address() const { return m_addArray; }
102 
104  inline int address(int stat) const { return m_addArray.station(stat); }
105 
107  inline int bx() const { return m_bx; }
108 
110  inline int numberOfTSphi() const { return m_tsphiList.size(); }
111 
113  inline int numberOfTSeta() const { return m_tsetaList.size(); }
114 
116  const std::vector<L1MuBMTrackSegPhi>& getTSphi() const { return m_tsphiList; }
117 
119  const L1MuBMTrackSegPhi& getStartTSphi() const;
120 
122  const L1MuBMTrackSegPhi& getEndTSphi() const;
123 
125  const std::vector<L1MuBMTrackSegEta>& getTSeta() const { return m_tsetaList; }
126 
128  const L1MuBMTrackSegEta& getStartTSeta() const;
129 
131  const L1MuBMTrackSegEta& getEndTSeta() const;
132 
134  inline void enable() { m_empty = false; setTFIdentifiers(this->spid().sector(),l1t::tftype::bmtf); };
135 
137  inline void disable() { m_empty = true; }
138 
140  inline void setName(std::string name) { m_name = name; }
141 
143  inline void setTC(TrackClass tc) { m_tc = tc; }
144 
146  inline void setPhi(int phi) { setHwPhi(phi); }
147 
149  void setEta(int eta);
150 
152  inline void setFineEtaBit() { setHwHF(true); }
153 
155  inline void setPt(int pt) { setHwPt(pt); }
156 
158  inline void setCharge(int charge) { setHwSign(charge);}
159 
161  inline void setBx(int bx) { m_bx = bx; }
162 
164  inline void setQuality(unsigned int quality) { setHwQual(quality); }
165 
167  inline void setAddresses(const L1MuBMAddressArray& addr) { m_addArray = addr; }
168 
170  void setTSphi(const std::vector<const L1MuBMTrackSegPhi*>& tsList);
171 
173  void setTSeta(const std::vector<const L1MuBMTrackSegEta*>& tsList);
174 
176  unsigned int triggerScale(float value, const edm::EventSetup& c) const;
177 
180 
182  bool operator==(const L1MuBMTrack&) const;
183 
185  bool operator!=(const L1MuBMTrack&) const;
186 
188  void print() const;
189 
191  friend std::ostream& operator<<(std::ostream&, const L1MuBMTrack&);
192 
194  static bool rank( const L1MuBMTrack* first, const L1MuBMTrack* second ) {
195  unsigned short int rank_f = 0; // rank of first
196  unsigned short int rank_s = 0; // rank of second
197  if ( first ) rank_f = first->pt() + 512 * first->quality();
198  if ( second ) rank_s = second->pt() + 512 * second->quality();
199  return rank_f > rank_s;
200  }
201 
202 
203  private:
204 
205  L1MuBMSecProcId m_spid; // which SP found the track
207  bool m_empty;
209  int m_bx;
210 
212  std::vector<L1MuBMTrackSegPhi> m_tsphiList;
213  std::vector<L1MuBMTrackSegEta> m_tsetaList;
214 
215 };
216 
217 #endif
const std::vector< L1MuBMTrackSegEta > & getTSeta() const
return all eta track segments of the muon candidate
Definition: L1MuBMTrack.h:125
unsigned int pt() const
get pt-code (5 bits)
Definition: L1MuBMTrack.h:74
void setTC(TrackClass tc)
set track-class of muon candidate
Definition: L1MuBMTrack.h:143
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:155
bool operator!=(const L1MuBMTrack &) const
unequal operator
Definition: L1MuBMTrack.cc:259
L1MuBMTrack & operator=(const L1MuBMTrack &)
assignment operator
Definition: L1MuBMTrack.cc:217
const L1MuBMTrackSegPhi & getStartTSphi() const
return start phi track segment of muon candidate
Definition: L1MuBMTrack.cc:131
const L1MuBMTrackSegEta & getEndTSeta() const
return end eta track segment of muon candidate
Definition: L1MuBMTrack.cc:161
L1MuBMAddressArray address() const
get address-array for this muon candidate
Definition: L1MuBMTrack.h:101
void setQuality(unsigned int quality)
set quality of muon candidate
Definition: L1MuBMTrack.h:164
void setPhi(int phi)
set phi-code of muon candidate
Definition: L1MuBMTrack.h:146
std::vector< L1MuBMTrack > L1MuBMTrackCollection
Definition: L1MuBMTrack.h:47
void setAddresses(const L1MuBMAddressArray &addr)
set relative addresses of muon candidate
Definition: L1MuBMTrack.h:167
void setName(std::string name)
set name of object
Definition: L1MuBMTrack.h:140
const L1MuBMSecProcId & spid() const
return Sector Processor in which the muon candidate was found
Definition: L1MuBMTrack.h:98
void setCharge(int charge)
set charge of muon candidate
Definition: L1MuBMTrack.h:158
void disable()
disable muon candidate
Definition: L1MuBMTrack.h:137
std::vector< L1MuBMTrackSegEta > m_tsetaList
Definition: L1MuBMTrack.h:213
L1MuBMSecProcId m_spid
Definition: L1MuBMTrack.h:205
unsigned short station(int stat) const
get address of a given station [1-4]
int charge() const
get charge (1 bit)
Definition: L1MuBMTrack.h:86
void enable()
enable muon candidate
Definition: L1MuBMTrack.h:134
U second(std::pair< T, U > const &p)
const int hwQual() const
Get quality code.
TrackClass tc() const
get track-class
Definition: L1MuBMTrack.h:92
unsigned int triggerScale(float value, const edm::EventSetup &c) const
convert pt value in GeV to pt code
Definition: L1MuBMTrack.cc:201
void setTSeta(const std::vector< const L1MuBMTrackSegEta * > &tsList)
set eta track segments used to form the muon candidate
Definition: L1MuBMTrack.cc:186
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
unsigned int phi() const
get phi-code (8 bits)
Definition: L1MuBMTrack.h:77
const int hwHF() const
Get HF (halo / fine eta) bit (EMTF: halo -> 1; BMTF: fine eta -> 1)
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:161
const int hwEta() const
Get compressed eta (returned int * 0.010875 = eta)
Definition: value.py:1
int numberOfTSeta() const
return number of eta track segments used to form the muon candidate
Definition: L1MuBMTrack.h:113
const int hwPhi() const
Get compressed local phi (returned int * 2*pi/576 = local phi in rad)
int bx() const
get the bunch crossing for this muon candidate
Definition: L1MuBMTrack.h:107
std::string name() const
get name of object
Definition: L1MuBMTrack.h:71
TrackClass m_tc
Definition: L1MuBMTrack.h:208
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)
int numberOfTSphi() const
return number of phi track segments used to form the muon candidate
Definition: L1MuBMTrack.h:110
void setFineEtaBit()
set fine eta bit
Definition: L1MuBMTrack.h:152
unsigned int quality() const
get quality
Definition: L1MuBMTrack.h:89
static bool rank(const L1MuBMTrack *first, const L1MuBMTrack *second)
define a rank for muon candidates
Definition: L1MuBMTrack.h:194
void setTSphi(const std::vector< const L1MuBMTrackSegPhi * > &tsList)
set phi track segments used to form the muon candidate
Definition: L1MuBMTrack.cc:171
int address(int stat) const
get relative address of a given station
Definition: L1MuBMTrack.h:104
void reset()
reset muon candidate
Definition: L1MuBMTrack.cc:103
void setEta(int eta)
set eta-code of muon candidate
Definition: L1MuBMTrack.cc:118
const L1MuBMTrackSegPhi & getEndTSphi() const
return end phi track segment of muon candidate
Definition: L1MuBMTrack.cc:141
const int hwPt() const
Get compressed pT (returned int * 0.5 = pT (GeV))
const int hwSign() const
Get charge sign bit (charge = (-1)^(sign))
bool operator==(const L1MuBMTrack &) const
equal operator
Definition: L1MuBMTrack.cc:238
int eta() const
get eta-code (6 bits)
Definition: L1MuBMTrack.h:80
std::vector< L1MuBMTrackSegPhi > m_tsphiList
Definition: L1MuBMTrack.h:212
void print() const
print parameters of muon candidate
Definition: L1MuBMTrack.cc:280
bool fineEtaBit() const
get fine eta bit
Definition: L1MuBMTrack.h:83
std::string m_name
Definition: L1MuBMTrack.h:206
~L1MuBMTrack() override
destructor
Definition: L1MuBMTrack.cc:93
bool empty() const
is it an empty muon candidate?
Definition: L1MuBMTrack.h:95
const std::vector< L1MuBMTrackSegPhi > & getTSphi() const
return all phi track segments of the muon candidate
Definition: L1MuBMTrack.h:116
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))
const L1MuBMTrackSegEta & getStartTSeta() const
return start eta track segment of muon candidate
Definition: L1MuBMTrack.cc:151
L1MuBMAddressArray m_addArray
Definition: L1MuBMTrack.h:211
L1MuBMTrack()
default constructor
Definition: L1MuBMTrack.cc:48