CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuDTTrack.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
14 //
15 //--------------------------------------------------
16 #ifndef L1MUDT_TRACK_H
17 #define L1MUDT_TRACK_H
18 
19 //---------------
20 // C++ Headers --
21 //---------------
22 
23 #include <iosfwd>
24 #include <string>
25 #include <vector>
26 #include <functional>
27 
28 //----------------------
29 // Base Class Headers --
30 //----------------------
31 
33 
34 //------------------------------------
35 // Collaborating Class Declarations --
36 //------------------------------------
37 
45 
46 
47 // ---------------------
48 // -- Class Interface --
49 // ---------------------
50 
51 class L1MuDTTrack : public L1MuRegionalCand {
52 
53  public:
54 
56  L1MuDTTrack();
57 
60 
62  L1MuDTTrack(const L1MuDTTrack&);
63 
65  virtual ~L1MuDTTrack();
66 
68  void reset();
69 
71  inline std::string name() const { return m_name; }
72 
74  inline unsigned int pt() const { return pt_packed(); }
75 
77  inline unsigned int phi() const { return phi_packed(); }
78 
80  inline unsigned int eta() const { return eta_packed(); }
81 
83  inline bool fineEtaBit() const { return isFineHalo(); }
84 
86  inline int charge() const { return chargeValue(); }
87 
89  inline TrackClass tc() const { return m_tc; }
90 
92  inline bool empty() const { return m_empty; }
93 
95  inline const L1MuDTSecProcId& spid() const { return m_spid; }
96 
98  inline L1MuDTAddressArray address() const { return m_addArray; }
99 
101  inline int address(int stat) const { return m_addArray.station(stat); }
102 
104  inline int numberOfTSphi() const { return m_tsphiList.size(); }
105 
107  inline int numberOfTSeta() const { return m_tsetaList.size(); }
108 
110  const std::vector<L1MuDTTrackSegPhi>& getTSphi() const { return m_tsphiList; }
111 
113  const L1MuDTTrackSegPhi& getStartTSphi() const;
114 
116  const L1MuDTTrackSegPhi& getEndTSphi() const;
117 
119  const std::vector<L1MuDTTrackSegEta>& getTSeta() const { return m_tsetaList; }
120 
122  const L1MuDTTrackSegEta& getStartTSeta() const;
123 
125  const L1MuDTTrackSegEta& getEndTSeta() const;
126 
128  inline void enable() { m_empty = false; setType(0); }
129 
131  inline void disable() { m_empty = true; }
132 
134  inline void setName(std::string name) { m_name = name; }
135 
137  inline void setTC(TrackClass tc) { m_tc = tc; }
138 
140  inline void setPhi(int phi) { setPhiPacked(phi); }
141 
143  void setEta(int eta);
144 
146  inline void setFineEtaBit() { setFineHalo(true); }
147 
149  inline void setPt(int pt) { setPtPacked(pt); }
150 
152  inline void setCharge(int charge) { setChargeValue(charge); setChargeValid(true); }
153 
155  inline void setQuality(unsigned int quality) { setQualityPacked(quality); }
156 
158  inline void setAddresses(const L1MuDTAddressArray& addr) { m_addArray = addr; }
159 
161  void setTSphi(const std::vector<const L1MuDTTrackSegPhi*>& tsList);
162 
164  void setTSeta(const std::vector<const L1MuDTTrackSegEta*>& tsList);
165 
167  unsigned int triggerScale(float value, const edm::EventSetup& c) const;
168 
171 
173  bool operator==(const L1MuDTTrack&) const;
174 
176  bool operator!=(const L1MuDTTrack&) const;
177 
179  void print() const;
180 
182  friend std::ostream& operator<<(std::ostream&, const L1MuDTTrack&);
183 
185  class Rank : std::binary_function< const L1MuDTTrack*, const L1MuDTTrack*, bool> {
186  public :
187  bool operator()( const L1MuDTTrack* first, const L1MuDTTrack* second ) const {
188  unsigned short int rank_f = 0; // rank of first
189  unsigned short int rank_s = 0; // rank of second
190  if ( first ) rank_f = 10 * first->pt() + first->quality();
191  if ( second ) rank_s = 10 * second->pt() + second->quality();
192  return rank_f > rank_s;
193  }
194  };
195 
196 
197  private:
198 
199  L1MuDTSecProcId m_spid; // which SP found the track
200  std::string m_name;
201  bool m_empty;
203 
205  std::vector<L1MuDTTrackSegPhi> m_tsphiList;
206  std::vector<L1MuDTTrackSegEta> m_tsetaList;
207 
208 };
209 
210 #endif
void setFineEtaBit()
set fine eta bit
Definition: L1MuDTTrack.h:146
std::vector< L1MuDTTrackSegEta > m_tsetaList
Definition: L1MuDTTrack.h:206
L1MuDTAddressArray m_addArray
Definition: L1MuDTTrack.h:204
int charge() const
get charge (1 bit)
Definition: L1MuDTTrack.h:86
const L1MuDTTrackSegPhi & getEndTSphi() const
return end phi track segment of muon candidate
Definition: L1MuDTTrack.cc:140
bool operator!=(const L1MuDTTrack &) const
unequal operator
Definition: L1MuDTTrack.cc:257
void setPt(int pt)
set pt-code of muon candidate
Definition: L1MuDTTrack.h:149
int numberOfTSphi() const
return number of phi track segments used to form the muon candidate
Definition: L1MuDTTrack.h:104
L1MuDTAddressArray address() const
get address-array for this muon candidate
Definition: L1MuDTTrack.h:98
TrackClass tc() const
get track-class
Definition: L1MuDTTrack.h:89
const std::vector< L1MuDTTrackSegEta > & getTSeta() const
return all eta track segments of the muon candidate
Definition: L1MuDTTrack.h:119
void setTSphi(const std::vector< const L1MuDTTrackSegPhi * > &tsList)
set phi track segments used to form the muon candidate
Definition: L1MuDTTrack.cc:170
void setTC(TrackClass tc)
set track-class of muon candidate
Definition: L1MuDTTrack.h:137
friend std::ostream & operator<<(std::ostream &, const L1MuDTTrack &)
output stream operator
unsigned int eta() const
get eta-code (6 bits)
Definition: L1MuDTTrack.h:80
const L1MuDTTrackSegEta & getStartTSeta() const
return start eta track segment of muon candidate
Definition: L1MuDTTrack.cc:150
void setChargeValue(int charge)
Set Charge Value: -1, 1.
std::string name() const
get name of object
Definition: L1MuDTTrack.h:71
void setAddresses(const L1MuDTAddressArray &addr)
set relative addresses of muon candidate
Definition: L1MuDTTrack.h:158
unsigned int phi() const
get phi-code (8 bits)
Definition: L1MuDTTrack.h:77
void enable()
enable muon candidate
Definition: L1MuDTTrack.h:128
bool isFineHalo() const
is it fine (DT) / halo (CSC) ?
std::string m_name
Definition: L1MuDTTrack.h:200
L1MuDTTrack & operator=(const L1MuDTTrack &)
assignment operator
Definition: L1MuDTTrack.cc:215
void setEta(int eta)
set eta-code of muon candidate
Definition: L1MuDTTrack.cc:116
U second(std::pair< T, U > const &p)
int numberOfTSeta() const
return number of eta track segments used to form the muon candidate
Definition: L1MuDTTrack.h:107
void setTSeta(const std::vector< const L1MuDTTrackSegEta * > &tsList)
set eta track segments used to form the muon candidate
Definition: L1MuDTTrack.cc:185
const L1MuDTTrackSegPhi & getStartTSphi() const
return start phi track segment of muon candidate
Definition: L1MuDTTrack.cc:130
void print() const
print parameters of muon candidate
Definition: L1MuDTTrack.cc:278
unsigned eta_packed() const
return eta packed as in hardware
void setQuality(unsigned int quality)
set quality of muon candidate
Definition: L1MuDTTrack.h:155
const L1MuDTSecProcId & spid() const
return Sector Processor in which the muon candidate was found
Definition: L1MuDTTrack.h:95
bool operator()(const L1MuDTTrack *first, const L1MuDTTrack *second) const
Definition: L1MuDTTrack.h:187
bool empty() const
is it an empty muon candidate?
Definition: L1MuDTTrack.h:92
void setType(unsigned type)
Set Type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC.
bool first
Definition: L1TdeRCT.cc:94
std::vector< L1MuDTTrackSegPhi > m_tsphiList
Definition: L1MuDTTrack.h:205
int address(int stat) const
get relative address of a given station
Definition: L1MuDTTrack.h:101
virtual ~L1MuDTTrack()
destructor
Definition: L1MuDTTrack.cc:91
void disable()
disable muon candidate
Definition: L1MuDTTrack.h:131
void reset()
reset muon candidate
Definition: L1MuDTTrack.cc:101
unsigned int pt() const
get pt-code (5 bits)
Definition: L1MuDTTrack.h:74
void setPtPacked(unsigned pt)
Set Pt: 0..31.
unsigned int triggerScale(float value, const edm::EventSetup &c) const
convert pt value in GeV to pt code
Definition: L1MuDTTrack.cc:200
L1MuDTTrack()
default constructor
Definition: L1MuDTTrack.cc:50
unsigned int quality() const
return quality
void setPhiPacked(unsigned phi)
Set Phi: 0..143.
void setQualityPacked(unsigned qual)
Set Quality: 0..7.
define a rank for muon candidates
Definition: L1MuDTTrack.h:185
bool operator==(const L1MuDTTrack &) const
equal operator
Definition: L1MuDTTrack.cc:236
const L1MuDTTrackSegEta & getEndTSeta() const
return end eta track segment of muon candidate
Definition: L1MuDTTrack.cc:160
void setChargeValid(bool valid)
Set Charge Valid.
const std::vector< L1MuDTTrackSegPhi > & getTSphi() const
return all phi track segments of the muon candidate
Definition: L1MuDTTrack.h:110
void setFineHalo(bool fh)
Set Fine / Halo.
TrackClass m_tc
Definition: L1MuDTTrack.h:202
unsigned pt_packed() const
return pt packed as in hardware
bool fineEtaBit() const
get fine eta bit
Definition: L1MuDTTrack.h:83
unsigned short station(int stat) const
get address of a given station [1-4]
int chargeValue() const
get charge
void setPhi(int phi)
set phi-code of muon candidate
Definition: L1MuDTTrack.h:140
void setName(std::string name)
set name of object
Definition: L1MuDTTrack.h:134
void setCharge(int charge)
set charge of muon candidate
Definition: L1MuDTTrack.h:152
unsigned phi_packed() const
return phi packed as in hardware
L1MuDTSecProcId m_spid
Definition: L1MuDTTrack.h:199