test
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 //
12 //
13 //--------------------------------------------------
14 #ifndef L1MUDT_TRACK_H
15 #define L1MUDT_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 // ---------------------
46 // -- Class Interface --
47 // ---------------------
48 
49 class L1MuDTTrack : public L1MuRegionalCand {
50 
51  public:
52 
54  L1MuDTTrack();
55 
58 
60  L1MuDTTrack(const L1MuDTTrack&);
61 
63  virtual ~L1MuDTTrack();
64 
66  void reset();
67 
69  inline std::string name() const { return m_name; }
70 
72  inline unsigned int pt() const { return pt_packed(); }
73 
75  inline unsigned int phi() const { return phi_packed(); }
76 
78  inline unsigned int eta() const { return eta_packed(); }
79 
81  inline bool fineEtaBit() const { return isFineHalo(); }
82 
84  inline int charge() const { return chargeValue(); }
85 
87  inline TrackClass tc() const { return m_tc; }
88 
90  inline bool empty() const { return m_empty; }
91 
93  inline const L1MuDTSecProcId& spid() const { return m_spid; }
94 
96  inline L1MuDTAddressArray address() const { return m_addArray; }
97 
99  inline int address(int stat) const { return m_addArray.station(stat); }
100 
102  inline int numberOfTSphi() const { return m_tsphiList.size(); }
103 
105  inline int numberOfTSeta() const { return m_tsetaList.size(); }
106 
108  const std::vector<L1MuDTTrackSegPhi>& getTSphi() const { return m_tsphiList; }
109 
111  const L1MuDTTrackSegPhi& getStartTSphi() const;
112 
114  const L1MuDTTrackSegPhi& getEndTSphi() const;
115 
117  const std::vector<L1MuDTTrackSegEta>& getTSeta() const { return m_tsetaList; }
118 
120  const L1MuDTTrackSegEta& getStartTSeta() const;
121 
123  const L1MuDTTrackSegEta& getEndTSeta() const;
124 
126  inline void enable() { m_empty = false; setType(0); }
127 
129  inline void disable() { m_empty = true; }
130 
132  inline void setName(std::string name) { m_name = name; }
133 
135  inline void setTC(TrackClass tc) { m_tc = tc; }
136 
138  inline void setPhi(int phi) { setPhiPacked(phi); }
139 
141  void setEta(int eta);
142 
144  inline void setFineEtaBit() { setFineHalo(true); }
145 
147  inline void setPt(int pt) { setPtPacked(pt); }
148 
150  inline void setCharge(int charge) { setChargeValue(charge); setChargeValid(true); }
151 
153  inline void setQuality(unsigned int quality) { setQualityPacked(quality); }
154 
156  inline void setAddresses(const L1MuDTAddressArray& addr) { m_addArray = addr; }
157 
159  void setTSphi(const std::vector<const L1MuDTTrackSegPhi*>& tsList);
160 
162  void setTSeta(const std::vector<const L1MuDTTrackSegEta*>& tsList);
163 
165  unsigned int triggerScale(float value, const edm::EventSetup& c) const;
166 
169 
171  bool operator==(const L1MuDTTrack&) const;
172 
174  bool operator!=(const L1MuDTTrack&) const;
175 
177  void print() const;
178 
180  friend std::ostream& operator<<(std::ostream&, const L1MuDTTrack&);
181 
183  class Rank : std::binary_function< const L1MuDTTrack*, const L1MuDTTrack*, bool> {
184  public :
185  bool operator()( const L1MuDTTrack* first, const L1MuDTTrack* second ) const {
186  unsigned short int rank_f = 0; // rank of first
187  unsigned short int rank_s = 0; // rank of second
188  if ( first ) rank_f = 10 * first->pt() + first->quality();
189  if ( second ) rank_s = 10 * second->pt() + second->quality();
190  return rank_f > rank_s;
191  }
192  };
193 
194 
195  private:
196 
197  L1MuDTSecProcId m_spid; // which SP found the track
199  bool m_empty;
201 
203  std::vector<L1MuDTTrackSegPhi> m_tsphiList;
204  std::vector<L1MuDTTrackSegEta> m_tsetaList;
205 
206 };
207 
208 #endif
void setFineEtaBit()
set fine eta bit
Definition: L1MuDTTrack.h:144
std::vector< L1MuDTTrackSegEta > m_tsetaList
Definition: L1MuDTTrack.h:204
L1MuDTAddressArray m_addArray
Definition: L1MuDTTrack.h:202
int charge() const
get charge (1 bit)
Definition: L1MuDTTrack.h:84
const L1MuDTTrackSegPhi & getEndTSphi() const
return end phi track segment of muon candidate
Definition: L1MuDTTrack.cc:138
bool operator!=(const L1MuDTTrack &) const
unequal operator
Definition: L1MuDTTrack.cc:255
void setPt(int pt)
set pt-code of muon candidate
Definition: L1MuDTTrack.h:147
int numberOfTSphi() const
return number of phi track segments used to form the muon candidate
Definition: L1MuDTTrack.h:102
L1MuDTAddressArray address() const
get address-array for this muon candidate
Definition: L1MuDTTrack.h:96
TrackClass tc() const
get track-class
Definition: L1MuDTTrack.h:87
const std::vector< L1MuDTTrackSegEta > & getTSeta() const
return all eta track segments of the muon candidate
Definition: L1MuDTTrack.h:117
void setTSphi(const std::vector< const L1MuDTTrackSegPhi * > &tsList)
set phi track segments used to form the muon candidate
Definition: L1MuDTTrack.cc:168
void setTC(TrackClass tc)
set track-class of muon candidate
Definition: L1MuDTTrack.h:135
friend std::ostream & operator<<(std::ostream &, const L1MuDTTrack &)
output stream operator
unsigned int eta() const
get eta-code (6 bits)
Definition: L1MuDTTrack.h:78
const L1MuDTTrackSegEta & getStartTSeta() const
return start eta track segment of muon candidate
Definition: L1MuDTTrack.cc:148
void setChargeValue(int charge)
Set Charge Value: -1, 1.
std::string name() const
get name of object
Definition: L1MuDTTrack.h:69
void setAddresses(const L1MuDTAddressArray &addr)
set relative addresses of muon candidate
Definition: L1MuDTTrack.h:156
unsigned int phi() const
get phi-code (8 bits)
Definition: L1MuDTTrack.h:75
void enable()
enable muon candidate
Definition: L1MuDTTrack.h:126
bool isFineHalo() const
is it fine (DT) / halo (CSC) ?
std::string m_name
Definition: L1MuDTTrack.h:198
L1MuDTTrack & operator=(const L1MuDTTrack &)
assignment operator
Definition: L1MuDTTrack.cc:213
void setEta(int eta)
set eta-code of muon candidate
Definition: L1MuDTTrack.cc:114
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:105
void setTSeta(const std::vector< const L1MuDTTrackSegEta * > &tsList)
set eta track segments used to form the muon candidate
Definition: L1MuDTTrack.cc:183
const L1MuDTTrackSegPhi & getStartTSphi() const
return start phi track segment of muon candidate
Definition: L1MuDTTrack.cc:128
void print() const
print parameters of muon candidate
Definition: L1MuDTTrack.cc:276
unsigned eta_packed() const
return eta packed as in hardware
void setQuality(unsigned int quality)
set quality of muon candidate
Definition: L1MuDTTrack.h:153
const L1MuDTSecProcId & spid() const
return Sector Processor in which the muon candidate was found
Definition: L1MuDTTrack.h:93
bool operator()(const L1MuDTTrack *first, const L1MuDTTrack *second) const
Definition: L1MuDTTrack.h:185
bool empty() const
is it an empty muon candidate?
Definition: L1MuDTTrack.h:90
void setType(unsigned type)
Set Type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC.
std::vector< L1MuDTTrackSegPhi > m_tsphiList
Definition: L1MuDTTrack.h:203
int address(int stat) const
get relative address of a given station
Definition: L1MuDTTrack.h:99
virtual ~L1MuDTTrack()
destructor
Definition: L1MuDTTrack.cc:89
void disable()
disable muon candidate
Definition: L1MuDTTrack.h:129
void reset()
reset muon candidate
Definition: L1MuDTTrack.cc:99
unsigned int pt() const
get pt-code (5 bits)
Definition: L1MuDTTrack.h:72
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:198
L1MuDTTrack()
default constructor
Definition: L1MuDTTrack.cc:48
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:183
bool operator==(const L1MuDTTrack &) const
equal operator
Definition: L1MuDTTrack.cc:234
const L1MuDTTrackSegEta & getEndTSeta() const
return end eta track segment of muon candidate
Definition: L1MuDTTrack.cc:158
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:108
void setFineHalo(bool fh)
Set Fine / Halo.
TrackClass m_tc
Definition: L1MuDTTrack.h:200
unsigned pt_packed() const
return pt packed as in hardware
bool fineEtaBit() const
get fine eta bit
Definition: L1MuDTTrack.h:81
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:138
void setName(std::string name)
set name of object
Definition: L1MuDTTrack.h:132
void setCharge(int charge)
set charge of muon candidate
Definition: L1MuDTTrack.h:150
unsigned phi_packed() const
return phi packed as in hardware
L1MuDTSecProcId m_spid
Definition: L1MuDTTrack.h:197