CMS 3D CMS Logo

L1MuDTTrackSegPhi.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuDTTrackSegPhi
4 //
5 // Description: PHI Track Segment
6 //
7 //
8 //
9 // Author :
10 // N. Neumeister CERN EP
11 //
12 //--------------------------------------------------
13 
14 //-----------------------
15 // This Class's Header --
16 //-----------------------
17 
19 
20 //---------------
21 // C++ Headers --
22 //---------------
23 
24 #include <iostream>
25 #include <iomanip>
26 #include <cmath>
27 
28 //-------------------------------
29 // Collaborating Class Headers --
30 //-------------------------------
31 
33 
34 using namespace std;
35 
36 // --------------------------------
37 // class L1MuDTTrackSegPhi
38 //---------------------------------
39 
40 //----------------
41 // Constructors --
42 //----------------
43 
45  : m_location(), m_phi(0), m_phib(0), m_quality(Null), m_tag(false), m_bx(0), m_etaFlag(false) {}
46 
48  int wheel_id, int sector_id, int station_id, int phi, int phib, TSQuality quality, bool tag, int bx, bool etaFlag)
49  : m_location(wheel_id, sector_id, station_id),
50  m_phi(phi),
51  m_phib(phib),
52  m_quality(quality),
53  m_tag(false),
54  m_bx(bx),
55  m_etaFlag(etaFlag) {
56  if (phi < -2048 || phi > 2047) {
57  // cerr << "TrackSegPhi : phi out of range: " << phi << endl;
58  }
59  if (phib < -512 || phib > 511) {
60  // cerr << "TrackSegPhi : phib out of range: " << phib << endl;
61  }
62  if (quality > 7) {
63  // cerr << "TrackSegPhi : quality out of range: " << quality << endl;
64  }
65 }
66 
68  const L1MuDTTrackSegLoc& id, int phi, int phib, TSQuality quality, bool tag, int bx, bool etaFlag)
69  : m_location(id), m_phi(phi), m_phib(phib), m_quality(quality), m_tag(tag), m_bx(bx), m_etaFlag(etaFlag) {
70  if (phi < -2048 || phi > 2047) {
71  // cerr << "TrackSegPhi : phi out of range: " << phi << endl;
72  }
73  if (phib < -512 || phib > 511) {
74  // cerr << "TrackSegPhi : phib out of range: " << phib << endl;
75  }
76  if (quality > 7) {
77  // cerr << "TrackSegPhi : quality out of range: " << quality << endl;
78  }
79 }
80 
82  : m_location(id.m_location),
83  m_phi(id.m_phi),
84  m_phib(id.m_phib),
85  m_quality(id.m_quality),
86  m_tag(id.m_tag),
87  m_bx(id.m_bx),
88  m_etaFlag(id.m_etaFlag) {}
89 
90 //--------------
91 // Destructor --
92 //--------------
94 
95 //--------------
96 // Operations --
97 //--------------
98 
99 //
100 // reset PHI Track Segment
101 //
103  m_phi = 0;
104  m_phib = 0;
105  m_quality = Null;
106  m_tag = false;
107  m_bx = 0;
108  m_etaFlag = false;
109 }
110 
111 //
112 // return phi in global coordinates [0,2pi]
113 //
115  double tmp = static_cast<double>(m_location.sector()) * M_PI / 6;
116  tmp += static_cast<double>(m_phi) / 4096;
117  return (tmp > 0) ? tmp : (2 * M_PI + tmp);
118 }
119 
120 //
121 // return phib in radians
122 //
123 double L1MuDTTrackSegPhi::phibValue() const { return static_cast<double>(m_phib) / 512; }
124 
125 //
126 // Assignment operator
127 //
129  if (this != &id) {
130  m_location = id.m_location;
131  m_phi = id.m_phi;
132  m_phib = id.m_phib;
133  m_quality = id.m_quality;
134  m_tag = id.m_tag;
135  m_bx = id.m_bx;
136  m_etaFlag = id.m_etaFlag;
137  }
138  return *this;
139 }
140 
141 //
142 // Equal operator
143 //
145  if (m_location != id.m_location)
146  return false;
147  if (m_phi != id.m_phi)
148  return false;
149  if (m_phib != id.m_phib)
150  return false;
151  if (m_quality != id.m_quality)
152  return false;
153  if (m_bx != id.m_bx)
154  return false;
155  return true;
156 }
157 
158 //
159 // Unequal operator
160 //
162  if (m_location != id.m_location)
163  return true;
164  if (m_phi != id.m_phi)
165  return true;
166  if (m_phib != id.m_phib)
167  return true;
168  if (m_quality != id.m_quality)
169  return true;
170  if (m_bx != id.m_bx)
171  return true;
172  return false;
173 }
174 
175 //
176 // output stream operator phi track segment quality
177 //
178 ostream& operator<<(ostream& s, const L1MuDTTrackSegPhi::TSQuality& quality) {
179  switch (quality) {
181  return s << "Li ";
183  return s << "Lo ";
185  return s << "Hi ";
187  return s << "Ho ";
189  return s << "LL ";
191  return s << "HL ";
193  return s << "HH ";
195  return s << "Null ";
196  default:
197  return s << "unknown TS phi Quality ";
198  }
199 }
200 
201 //
202 // output stream operator for phi track segments
203 //
204 ostream& operator<<(ostream& s, const L1MuDTTrackSegPhi& id) {
205  s.setf(ios::right, ios::adjustfield);
206  s << (id.m_location) << "\t"
207  << "phi : " << setw(5) << id.m_phi << " "
208  << "phib : " << setw(4) << id.m_phib << " "
209  << "quality : " << setw(4) << id.m_quality;
210 
211  return s;
212 }
L1MuDTTrackSegLoc
Definition: L1MuDTTrackSegLoc.h:41
L1MuDTTrackSegPhi::m_location
L1MuDTTrackSegLoc m_location
Definition: L1MuDTTrackSegPhi.h:131
funct::false
false
Definition: Factorize.h:29
L1MuDTTrackSegPhi::~L1MuDTTrackSegPhi
virtual ~L1MuDTTrackSegPhi()
destructor
Definition: L1MuDTTrackSegPhi.cc:93
L1MuDTTrackSegPhi::m_tag
bool m_tag
Definition: L1MuDTTrackSegPhi.h:135
L1MuDTTrackSegPhi::Null
Definition: L1MuDTTrackSegPhi.h:39
L1MuDTTrackSegPhi::m_phib
int m_phib
Definition: L1MuDTTrackSegPhi.h:133
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
L1MuDTTrackSegPhi::Lo
Definition: L1MuDTTrackSegPhi.h:39
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:122
L1MuDTTrackSegPhi.h
reco::Null
Definition: TrackInfoEnum.h:16
L1MuDTTrackSegPhi::reset
void reset()
reset phi track segment
Definition: L1MuDTTrackSegPhi.cc:102
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1MuDTTrackSegPhi::m_etaFlag
bool m_etaFlag
Definition: L1MuDTTrackSegPhi.h:137
L1MuDTTrackSegLoc.h
L1MuDTTrackSegPhi::operator==
bool operator==(const L1MuDTTrackSegPhi &) const
equal operator
Definition: L1MuDTTrackSegPhi.cc:144
L1MuDTTrackSegPhi::m_quality
TSQuality m_quality
Definition: L1MuDTTrackSegPhi.h:134
L1MuDTTrackSegPhi::LL
Definition: L1MuDTTrackSegPhi.h:39
PVValHelper::phi
Definition: PVValidationHelpers.h:69
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
L1MuDTTrackSegPhi::TSQuality
TSQuality
quality code of DTBX phi track segments
Definition: L1MuDTTrackSegPhi.h:39
L1MuDTTrackSegPhi::HL
Definition: L1MuDTTrackSegPhi.h:39
L1MuDTTrackSegPhi::phibValue
double phibValue() const
return phib-value in global coordinates [0,2pi]
Definition: L1MuDTTrackSegPhi.cc:123
L1MuDTTrackSegPhi::L1MuDTTrackSegPhi
L1MuDTTrackSegPhi()
default constructor
Definition: L1MuDTTrackSegPhi.cc:44
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
operator<<
ostream & operator<<(ostream &s, const L1MuDTTrackSegPhi::TSQuality &quality)
Definition: L1MuDTTrackSegPhi.cc:178
L1MuDTTrackSegPhi::m_phi
int m_phi
Definition: L1MuDTTrackSegPhi.h:132
L1MuDTTrackSegPhi::Ho
Definition: L1MuDTTrackSegPhi.h:39
std
Definition: JetResolutionObject.h:76
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
L1MuDTTrackSegLoc::sector
int sector() const
return sector (30 deg)
Definition: L1MuDTTrackSegLoc.h:59
L1MuDTTrackSegPhi::operator!=
bool operator!=(const L1MuDTTrackSegPhi &) const
unequal operator
Definition: L1MuDTTrackSegPhi.cc:161
L1MuDTTrackSegPhi::Li
Definition: L1MuDTTrackSegPhi.h:39
L1MuDTTrackSegPhi::Hi
Definition: L1MuDTTrackSegPhi.h:39
L1MuDTTrackSegPhi::HH
Definition: L1MuDTTrackSegPhi.h:39
L1MuDTTrackSegPhi
Definition: L1MuDTTrackSegPhi.h:36
L1MuDTTrackSegPhi::quality
int quality() const
return quality code
Definition: L1MuDTTrackSegPhi.h:98
L1MuDTTrackSegPhi::phiValue
double phiValue() const
return phi-value in global coordinates [0,2pi]
Definition: L1MuDTTrackSegPhi.cc:114
L1MuDTTrackSegPhi::m_bx
int m_bx
Definition: L1MuDTTrackSegPhi.h:136
L1MuDTTrackSegPhi::operator=
L1MuDTTrackSegPhi & operator=(const L1MuDTTrackSegPhi &)
assignment operator
Definition: L1MuDTTrackSegPhi.cc:128