CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
44 
45 //#include "DataFormats/L1TMuon/interface/MuonInternalTrack.h"
46 
47 //using namespace L1TMuon;
48 
49 // ---------------------
50 // -- Class Interface --
51 // ---------------------
52 
54 
55  public:
56 
58  L1MuBMTrack();
59 
62 
64  L1MuBMTrack(const L1MuBMTrack&);
65 
67  virtual ~L1MuBMTrack();
68 
70  void reset();
71 
73  inline std::string name() const { return m_name; }
74 
76  inline unsigned int pt() const { return hwPt(); }
77 
79  inline unsigned int phi() const { return hwPhi(); }
80 
82  inline int eta() const { return hwEta(); }
83 
85  inline bool fineEtaBit() const { return hwHF();}
86 
88  inline int charge() const { return hwSign(); }
89 
91  inline unsigned int quality() const { return hwQual(); }
92 
94  inline TrackClass tc() const { return m_tc; }
95 
97  inline bool empty() const { return m_empty; }
98 
100  inline const L1MuBMSecProcId& spid() const { return m_spid; }
101 
103  inline L1MuBMAddressArray address() const { return m_addArray; }
104 
106  inline int address(int stat) const { return m_addArray.station(stat); }
107 
109  inline int bx() const { return m_bx; }
110 
112  inline int numberOfTSphi() const { return m_tsphiList.size(); }
113 
115  inline int numberOfTSeta() const { return m_tsetaList.size(); }
116 
118  const std::vector<L1MuBMTrackSegPhi>& getTSphi() const { return m_tsphiList; }
119 
121  const L1MuBMTrackSegPhi& getStartTSphi() const;
122 
124  const L1MuBMTrackSegPhi& getEndTSphi() const;
125 
127  const std::vector<L1MuBMTrackSegEta>& getTSeta() const { return m_tsetaList; }
128 
130  const L1MuBMTrackSegEta& getStartTSeta() const;
131 
133  const L1MuBMTrackSegEta& getEndTSeta() const;
134 
136  inline void enable() { m_empty = false; setTFIdentifiers(this->spid().sector(),l1t::tftype::bmtf); };
137 
139  inline void disable() { m_empty = true; }
140 
142  inline void setName(std::string name) { m_name = name; }
143 
145  inline void setTC(TrackClass tc) { m_tc = tc; }
146 
148  inline void setPhi(int phi) { setHwPhi(phi); }
149 
151  void setEta(int eta);
152 
154  inline void setFineEtaBit() { setHwHF(1); }
155 
157  inline void setPt(int pt) { setHwPt(pt); }
158 
160  inline void setCharge(int charge) { setHwSign(charge);}
161 
163  inline void setBx(int bx) { m_bx = bx; }
164 
166  inline void setQuality(unsigned int quality) { setHwQual(quality); }
167 
169  inline void setAddresses(const L1MuBMAddressArray& addr) { m_addArray = addr; }
170 
172  void setTSphi(const std::vector<const L1MuBMTrackSegPhi*>& tsList);
173 
175  void setTSeta(const std::vector<const L1MuBMTrackSegEta*>& tsList);
176 
178  unsigned int triggerScale(float value, const edm::EventSetup& c) const;
179 
182 
184  bool operator==(const L1MuBMTrack&) const;
185 
187  bool operator!=(const L1MuBMTrack&) const;
188 
190  void print() const;
191 
193  friend std::ostream& operator<<(std::ostream&, const L1MuBMTrack&);
194 
196  class Rank : std::binary_function< const L1MuBMTrack*, const L1MuBMTrack*, bool> {
197  public :
198  bool operator()( const L1MuBMTrack* first, const L1MuBMTrack* second ) const {
199  unsigned short int rank_f = 0; // rank of first
200  unsigned short int rank_s = 0; // rank of second
201  if ( first ) rank_f = first->pt() + 512 * first->quality();
202  if ( second ) rank_s = second->pt() + 512 * second->quality();
203  return rank_f > rank_s;
204  }
205  };
206 
207 
208  private:
209 
210  L1MuBMSecProcId m_spid; // which SP found the track
212  bool m_empty;
214  int m_bx;
215 
217  std::vector<L1MuBMTrackSegPhi> m_tsphiList;
218  std::vector<L1MuBMTrackSegEta> m_tsetaList;
219 
220 };
221 
222 #endif
const std::vector< L1MuBMTrackSegEta > & getTSeta() const
return all eta track segments of the muon candidate
Definition: L1MuBMTrack.h:127
unsigned int pt() const
get pt-code (5 bits)
Definition: L1MuBMTrack.h:76
void setTC(TrackClass tc)
set track-class of muon candidate
Definition: L1MuBMTrack.h:145
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:157
define a rank for muon candidates
Definition: L1MuBMTrack.h:196
bool operator!=(const L1MuBMTrack &) const
unequal operator
Definition: L1MuBMTrack.cc:258
L1MuBMTrack & operator=(const L1MuBMTrack &)
assignment operator
Definition: L1MuBMTrack.cc:216
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:103
void setQuality(unsigned int quality)
set quality of muon candidate
Definition: L1MuBMTrack.h:166
void setPhi(int phi)
set phi-code of muon candidate
Definition: L1MuBMTrack.h:148
void setAddresses(const L1MuBMAddressArray &addr)
set relative addresses of muon candidate
Definition: L1MuBMTrack.h:169
void setName(std::string name)
set name of object
Definition: L1MuBMTrack.h:142
const L1MuBMSecProcId & spid() const
return Sector Processor in which the muon candidate was found
Definition: L1MuBMTrack.h:100
void setCharge(int charge)
set charge of muon candidate
Definition: L1MuBMTrack.h:160
void disable()
disable muon candidate
Definition: L1MuBMTrack.h:139
std::vector< L1MuBMTrackSegEta > m_tsetaList
Definition: L1MuBMTrack.h:218
L1MuBMSecProcId m_spid
Definition: L1MuBMTrack.h:210
unsigned short station(int stat) const
get address of a given station [1-4]
int charge() const
get charge (1 bit)
Definition: L1MuBMTrack.h:88
void enable()
enable muon candidate
Definition: L1MuBMTrack.h:136
U second(std::pair< T, U > const &p)
const int hwQual() const
Get quality code.
TrackClass tc() const
get track-class
Definition: L1MuBMTrack.h:94
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.
virtual ~L1MuBMTrack()
destructor
Definition: L1MuBMTrack.cc:93
unsigned int phi() const
get phi-code (8 bits)
Definition: L1MuBMTrack.h:79
const int hwHF() const
Get HF (halo / fine eta) bit (EMTF: halo -&gt; 1; BMTF: fine eta -&gt; 1)
void setHwHF(bool bit)
Set HF (halo / fine eta) bit (EMTF: halo -&gt; 1; BMTF: fine eta -&gt; 1)
void setBx(int bx)
set charge of muon candidate
Definition: L1MuBMTrack.h:163
const int hwEta() const
Get compressed eta (returned int * 0.010875 = eta)
int numberOfTSeta() const
return number of eta track segments used to form the muon candidate
Definition: L1MuBMTrack.h:115
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:109
std::string name() const
get name of object
Definition: L1MuBMTrack.h:73
TrackClass m_tc
Definition: L1MuBMTrack.h:213
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:112
void setFineEtaBit()
set fine eta bit
Definition: L1MuBMTrack.h:154
unsigned int quality() const
get quality
Definition: L1MuBMTrack.h:91
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:106
void reset()
reset muon candidate
Definition: L1MuBMTrack.cc:103
bool operator()(const L1MuBMTrack *first, const L1MuBMTrack *second) const
Definition: L1MuBMTrack.h:198
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:237
int eta() const
get eta-code (6 bits)
Definition: L1MuBMTrack.h:82
std::vector< L1MuBMTrackSegPhi > m_tsphiList
Definition: L1MuBMTrack.h:217
void print() const
print parameters of muon candidate
Definition: L1MuBMTrack.cc:279
bool fineEtaBit() const
get fine eta bit
Definition: L1MuBMTrack.h:85
std::string m_name
Definition: L1MuBMTrack.h:211
bool empty() const
is it an empty muon candidate?
Definition: L1MuBMTrack.h:97
const std::vector< L1MuBMTrackSegPhi > & getTSphi() const
return all phi track segments of the muon candidate
Definition: L1MuBMTrack.h:118
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:216
L1MuBMTrack()
default constructor
Definition: L1MuBMTrack.cc:48