CMS 3D CMS Logo

L1MuBMTrackSegPhi.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuBMTrackSegPhi
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 L1MuBMTrackSegPhi
38 //---------------------------------
39 
40 //----------------
41 // Constructors --
42 //----------------
43 
44 L1MuBMTrackSegPhi::L1MuBMTrackSegPhi() : m_location(), m_phi(0), m_phib(0), m_quality(Null), m_bx(0) {}
45 
47  int wheel_id, int sector_id, int station_id, int phi, int phib, TSQuality quality, bool tag, int bx, bool etaFlag)
48  : m_location(wheel_id, sector_id, station_id),
49  m_phi(phi),
50  m_phib(phib),
51  m_quality(quality),
52  m_bx(bx),
53  m_etaFlag(etaFlag) {
54  /*
55  if ( phi < -2048 || phi > 2047 ) {
56  cerr << "TrackSegPhi : phi out of range: " << phi << endl;
57  }
58  if ( phib < -512 || phib > 511 ) {
59  cerr << "TrackSegPhi : phib out of range: " << phib << endl;
60  }
61  if ( quality > 7 ) {
62  cerr << "TrackSegPhi : quality out of range: " << quality << endl;
63  }*/
64 }
65 
67  const L1MuBMTrackSegLoc& id, int phi, int phib, TSQuality quality, bool tag, int bx, bool etaFlag)
68  : m_location(id), m_phi(phi), m_phib(phib), m_quality(quality), m_tag(tag), m_bx(bx), m_etaFlag(etaFlag) {
69  /*
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 }
81 
83  : m_location(id.m_location),
84  m_phi(id.m_phi),
85  m_phib(id.m_phib),
86  m_quality(id.m_quality),
87  m_tag(id.m_tag),
88  m_bx(id.m_bx),
89  m_etaFlag(id.m_etaFlag) {}
90 
91 //--------------
92 // Destructor --
93 //--------------
95 
96 //--------------
97 // Operations --
98 //--------------
99 
100 //
101 // reset PHI Track Segment
102 //
104  m_phi = 0;
105  m_phib = 0;
106  m_quality = Null;
107  m_tag = false;
108  m_bx = 0;
109  m_etaFlag = false;
110 }
111 
112 //
113 // return phi in global coordinates [0,2pi]
114 //
116  double tmp = static_cast<double>(m_location.sector()) * M_PI / 6;
117  tmp += static_cast<double>(m_phi) / 4096;
118  return (tmp > 0) ? tmp : (2 * M_PI + tmp);
119 }
120 
121 //
122 // return phib in radians
123 //
124 double L1MuBMTrackSegPhi::phibValue() const { return static_cast<double>(m_phib) / 512; }
125 
126 //
127 // Assignment operator
128 //
130  if (this != &id) {
131  m_location = id.m_location;
132  m_phi = id.m_phi;
133  m_phib = id.m_phib;
134  m_quality = id.m_quality;
135  m_tag = id.m_tag;
136  m_bx = id.m_bx;
137  m_etaFlag = id.m_etaFlag;
138  }
139  return *this;
140 }
141 
142 //
143 // Equal operator
144 //
146  if (m_location != id.m_location)
147  return false;
148  if (m_phi != id.m_phi)
149  return false;
150  if (m_phib != id.m_phib)
151  return false;
152  if (m_quality != id.m_quality)
153  return false;
154  if (m_bx != id.m_bx)
155  return false;
156  return true;
157 }
158 
159 //
160 // Unequal operator
161 //
163  if (m_location != id.m_location)
164  return true;
165  if (m_phi != id.m_phi)
166  return true;
167  if (m_phib != id.m_phib)
168  return true;
169  if (m_quality != id.m_quality)
170  return true;
171  if (m_bx != id.m_bx)
172  return true;
173  return false;
174 }
175 
176 //
177 // output stream operator phi track segment quality
178 //
179 ostream& operator<<(ostream& s, const L1MuBMTrackSegPhi::TSQuality& quality) {
180  switch (quality) {
182  return s << "Li ";
184  return s << "Lo ";
186  return s << "Hi ";
188  return s << "Ho ";
190  return s << "LL ";
192  return s << "HL ";
194  return s << "HH ";
196  return s << "Null ";
197  default:
198  return s << "unknown TS phi Quality ";
199  }
200 }
201 
202 //
203 // output stream operator for phi track segments
204 //
205 ostream& operator<<(ostream& s, const L1MuBMTrackSegPhi& id) {
206  s.setf(ios::right, ios::adjustfield);
207  s << (id.m_location) << "\t"
208  << "phi : " << setw(5) << id.m_phi << " "
209  << "phib : " << setw(4) << id.m_phib << " "
210  << "quality : " << setw(4) << id.m_quality;
211 
212  return s;
213 }
L1MuBMTrackSegPhi::~L1MuBMTrackSegPhi
virtual ~L1MuBMTrackSegPhi()
destructor
Definition: L1MuBMTrackSegPhi.cc:94
L1MuBMTrackSegPhi::HL
Definition: L1MuBMTrackSegPhi.h:44
L1MuBMTrackSegPhi::operator!=
bool operator!=(const L1MuBMTrackSegPhi &) const
unequal operator
Definition: L1MuBMTrackSegPhi.cc:162
L1MuBMTrackSegPhi
Definition: L1MuBMTrackSegPhi.h:41
L1MuBMTrackSegPhi::m_location
L1MuBMTrackSegLoc m_location
Definition: L1MuBMTrackSegPhi.h:136
L1MuBMTrackSegPhi::m_phi
int m_phi
Definition: L1MuBMTrackSegPhi.h:137
L1MuBMTrackSegPhi::Li
Definition: L1MuBMTrackSegPhi.h:44
L1MuBMTrackSegPhi::Ho
Definition: L1MuBMTrackSegPhi.h:44
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1MuBMTrackSegPhi.h
L1MuBMTrackSegPhi::phiValue
double phiValue() const
return phi-value in global coordinates [0,2pi]
Definition: L1MuBMTrackSegPhi.cc:115
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
L1MuBMTrackSegPhi::Null
Definition: L1MuBMTrackSegPhi.h:44
L1MuBMTrackSegPhi::m_etaFlag
bool m_etaFlag
Definition: L1MuBMTrackSegPhi.h:142
L1MuBMTrackSegPhi::LL
Definition: L1MuBMTrackSegPhi.h:44
reco::Null
Definition: TrackInfoEnum.h:16
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1MuBMTrackSegLoc.h
L1MuBMTrackSegLoc
Definition: L1MuBMTrackSegLoc.h:41
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
L1MuBMTrackSegPhi::HH
Definition: L1MuBMTrackSegPhi.h:44
L1MuBMTrackSegPhi::operator=
L1MuBMTrackSegPhi & operator=(const L1MuBMTrackSegPhi &)
assignment operator
Definition: L1MuBMTrackSegPhi.cc:129
L1MuBMTrackSegPhi::TSQuality
TSQuality
quality code of BBMX phi track segments
Definition: L1MuBMTrackSegPhi.h:44
operator<<
ostream & operator<<(ostream &s, const L1MuBMTrackSegPhi::TSQuality &quality)
Definition: L1MuBMTrackSegPhi.cc:179
L1MuBMTrackSegPhi::m_tag
bool m_tag
Definition: L1MuBMTrackSegPhi.h:140
PVValHelper::phi
Definition: PVValidationHelpers.h:68
L1MuBMTrackSegPhi::reset
void reset()
reset phi track segment
Definition: L1MuBMTrackSegPhi.cc:103
L1MuBMTrackSegPhi::m_bx
int m_bx
Definition: L1MuBMTrackSegPhi.h:141
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
L1MuBMTrackSegPhi::L1MuBMTrackSegPhi
L1MuBMTrackSegPhi()
default constructor
Definition: L1MuBMTrackSegPhi.cc:44
L1MuBMTrackSegPhi::Lo
Definition: L1MuBMTrackSegPhi.h:44
L1MuBMTrackSegPhi::m_quality
TSQuality m_quality
Definition: L1MuBMTrackSegPhi.h:139
L1MuBMTrackSegPhi::phibValue
double phibValue() const
return phib-value in global coordinates [0,2pi]
Definition: L1MuBMTrackSegPhi.cc:124
L1MuBMTrackSegLoc::sector
int sector() const
return sector (30 deg)
Definition: L1MuBMTrackSegLoc.h:59
L1MuBMTrackSegPhi::operator==
bool operator==(const L1MuBMTrackSegPhi &) const
equal operator
Definition: L1MuBMTrackSegPhi.cc:145
std
Definition: JetResolutionObject.h:76
L1MuBMTrackSegPhi::Hi
Definition: L1MuBMTrackSegPhi.h:44
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
L1MuBMTrackSegPhi::m_phib
int m_phib
Definition: L1MuBMTrackSegPhi.h:138