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 #include <functional>
25 
26 //----------------------
27 // Base Class Headers --
28 //----------------------
29 
31 
32 //------------------------------------
33 // Collaborating Class Declarations --
34 //------------------------------------
35 
43 
44 // ---------------------
45 // -- Class Interface --
46 // ---------------------
47 
49 
50 typedef std::vector<L1MuBMTrack> L1MuBMTrackCollection;
51 
53 
54  public:
55 
57  L1MuBMTrack();
58 
61 
63  L1MuBMTrack(const L1MuBMTrack&);
64 
66  ~L1MuBMTrack() override;
67 
69  void reset();
70 
72  inline std::string name() const { return m_name; }
73 
75  inline unsigned int pt() const { return hwPt(); }
76 
78  inline unsigned int phi() const { return hwPhi(); }
79 
81  inline int eta() const { return hwEta(); }
82 
84  inline bool fineEtaBit() const { return hwHF();}
85 
87  inline int charge() const { return hwSign(); }
88 
90  inline unsigned int quality() const { return hwQual(); }
91 
93  inline TrackClass tc() const { return m_tc; }
94 
96  inline bool empty() const { return m_empty; }
97 
99  inline const L1MuBMSecProcId& spid() const { return m_spid; }
100 
102  inline L1MuBMAddressArray address() const { return m_addArray; }
103 
105  inline int address(int stat) const { return m_addArray.station(stat); }
106 
108  inline int bx() const { return m_bx; }
109 
111  inline int numberOfTSphi() const { return m_tsphiList.size(); }
112 
114  inline int numberOfTSeta() const { return m_tsetaList.size(); }
115 
117  const std::vector<L1MuBMTrackSegPhi>& getTSphi() const { return m_tsphiList; }
118 
120  const L1MuBMTrackSegPhi& getStartTSphi() const;
121 
123  const L1MuBMTrackSegPhi& getEndTSphi() const;
124 
126  const std::vector<L1MuBMTrackSegEta>& getTSeta() const { return m_tsetaList; }
127 
129  const L1MuBMTrackSegEta& getStartTSeta() const;
130 
132  const L1MuBMTrackSegEta& getEndTSeta() const;
133 
135  inline void enable() { m_empty = false; setTFIdentifiers(this->spid().sector(),l1t::tftype::bmtf); };
136 
138  inline void disable() { m_empty = true; }
139 
141  inline void setName(std::string name) { m_name = name; }
142 
144  inline void setTC(TrackClass tc) { m_tc = tc; }
145 
147  inline void setPhi(int phi) { setHwPhi(phi); }
148 
150  void setEta(int eta);
151 
153  inline void setFineEtaBit() { setHwHF(true); }
154 
156  inline void setPt(int pt) { setHwPt(pt); }
157 
159  inline void setCharge(int charge) { setHwSign(charge);}
160 
162  inline void setBx(int bx) { m_bx = bx; }
163 
165  inline void setQuality(unsigned int quality) { setHwQual(quality); }
166 
168  inline void setAddresses(const L1MuBMAddressArray& addr) { m_addArray = addr; }
169 
171  void setTSphi(const std::vector<const L1MuBMTrackSegPhi*>& tsList);
172 
174  void setTSeta(const std::vector<const L1MuBMTrackSegEta*>& tsList);
175 
177  unsigned int triggerScale(float value, const edm::EventSetup& c) const;
178 
181 
183  bool operator==(const L1MuBMTrack&) const;
184 
186  bool operator!=(const L1MuBMTrack&) const;
187 
189  void print() const;
190 
192  friend std::ostream& operator<<(std::ostream&, const L1MuBMTrack&);
193 
195  class Rank : std::binary_function< const L1MuBMTrack*, const L1MuBMTrack*, bool> {
196  public :
197  bool operator()( const L1MuBMTrack* first, const L1MuBMTrack* second ) const {
198  unsigned short int rank_f = 0; // rank of first
199  unsigned short int rank_s = 0; // rank of second
200  if ( first ) rank_f = first->pt() + 512 * first->quality();
201  if ( second ) rank_s = second->pt() + 512 * second->quality();
202  return rank_f > rank_s;
203  }
204  };
205 
206 
207  private:
208 
209  L1MuBMSecProcId m_spid; // which SP found the track
211  bool m_empty;
213  int m_bx;
214 
216  std::vector<L1MuBMTrackSegPhi> m_tsphiList;
217  std::vector<L1MuBMTrackSegEta> m_tsetaList;
218 
219 };
220 
221 #endif
const std::vector< L1MuBMTrackSegEta > & getTSeta() const
return all eta track segments of the muon candidate
Definition: L1MuBMTrack.h:126
unsigned int pt() const
get pt-code (5 bits)
Definition: L1MuBMTrack.h:75
void setTC(TrackClass tc)
set track-class of muon candidate
Definition: L1MuBMTrack.h:144
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:156
define a rank for muon candidates
Definition: L1MuBMTrack.h:195
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:102
void setQuality(unsigned int quality)
set quality of muon candidate
Definition: L1MuBMTrack.h:165
void setPhi(int phi)
set phi-code of muon candidate
Definition: L1MuBMTrack.h:147
std::vector< L1MuBMTrack > L1MuBMTrackCollection
Definition: L1MuBMTrack.h:48
void setAddresses(const L1MuBMAddressArray &addr)
set relative addresses of muon candidate
Definition: L1MuBMTrack.h:168
void setName(std::string name)
set name of object
Definition: L1MuBMTrack.h:141
const L1MuBMSecProcId & spid() const
return Sector Processor in which the muon candidate was found
Definition: L1MuBMTrack.h:99
void setCharge(int charge)
set charge of muon candidate
Definition: L1MuBMTrack.h:159
void disable()
disable muon candidate
Definition: L1MuBMTrack.h:138
std::vector< L1MuBMTrackSegEta > m_tsetaList
Definition: L1MuBMTrack.h:217
L1MuBMSecProcId m_spid
Definition: L1MuBMTrack.h:209
unsigned short station(int stat) const
get address of a given station [1-4]
int charge() const
get charge (1 bit)
Definition: L1MuBMTrack.h:87
void enable()
enable muon candidate
Definition: L1MuBMTrack.h:135
U second(std::pair< T, U > const &p)
const int hwQual() const
Get quality code.
TrackClass tc() const
get track-class
Definition: L1MuBMTrack.h:93
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:78
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:162
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:114
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:108
std::string name() const
get name of object
Definition: L1MuBMTrack.h:72
TrackClass m_tc
Definition: L1MuBMTrack.h:212
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:111
void setFineEtaBit()
set fine eta bit
Definition: L1MuBMTrack.h:153
unsigned int quality() const
get quality
Definition: L1MuBMTrack.h:90
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:105
void reset()
reset muon candidate
Definition: L1MuBMTrack.cc:103
bool operator()(const L1MuBMTrack *first, const L1MuBMTrack *second) const
Definition: L1MuBMTrack.h:197
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:81
std::vector< L1MuBMTrackSegPhi > m_tsphiList
Definition: L1MuBMTrack.h:216
void print() const
print parameters of muon candidate
Definition: L1MuBMTrack.cc:280
bool fineEtaBit() const
get fine eta bit
Definition: L1MuBMTrack.h:84
std::string m_name
Definition: L1MuBMTrack.h:210
~L1MuBMTrack() override
destructor
Definition: L1MuBMTrack.cc:93
bool empty() const
is it an empty muon candidate?
Definition: L1MuBMTrack.h:96
const std::vector< L1MuBMTrackSegPhi > & getTSphi() const
return all phi track segments of the muon candidate
Definition: L1MuBMTrack.h:117
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:215
L1MuBMTrack()
default constructor
Definition: L1MuBMTrack.cc:48