CMS 3D CMS Logo

L1MuDTTrackSegEta.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuDTTrackSegEta
4 //
5 // Description: ETA 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 <algorithm>
27 #include <bitset>
28 
29 //-------------------------------
30 // Collaborating Class Headers --
31 //-------------------------------
32 
34 
35 using namespace std;
36 
37 // --------------------------------
38 // class L1MuDTTrackSegEta
39 //---------------------------------
40 
41 //----------------
42 // Constructors --
43 //----------------
44 
45 L1MuDTTrackSegEta::L1MuDTTrackSegEta() : m_location(), m_position(0), m_quality(0), m_bx(0) {}
46 
47 L1MuDTTrackSegEta::L1MuDTTrackSegEta(int wheel_id, int sector_id, int station_id, int pos, int quality, int bx)
48  : m_location(wheel_id, sector_id, station_id), m_position(pos), m_quality(quality), m_bx(bx) {}
49 
51  : m_location(id), m_position(pos), m_quality(quality), m_bx(bx) {}
52 
55 
56 //--------------
57 // Destructor --
58 //--------------
60 
61 //--------------
62 // Operations --
63 //--------------
64 
65 //
66 // reset ETA Track Segment
67 //
69  m_position = 0;
70  m_quality = 0;
71  m_bx = 0;
72 }
73 
74 //
75 // Assignment operator
76 //
78  if (this != &id) {
79  m_location = id.m_location;
80  m_position = id.m_position;
81  m_quality = id.m_quality;
82  m_bx = id.m_bx;
83  }
84  return *this;
85 }
86 
87 //
88 // Equal operator
89 //
91  if (m_location != id.m_location)
92  return false;
93  if (m_position != id.m_position)
94  return false;
95  if (m_quality != id.m_quality)
96  return false;
97  if (m_bx != id.m_bx)
98  return false;
99  return true;
100 }
101 
102 //
103 // Unequal operator
104 //
106  if (m_location != id.m_location)
107  return true;
108  if (m_position != id.m_position)
109  return true;
110  if (m_quality != id.m_quality)
111  return true;
112  if (m_bx != id.m_bx)
113  return true;
114  return false;
115 }
116 
117 //
118 // output stream operator
119 //
120 ostream& operator<<(ostream& s, const L1MuDTTrackSegEta& id) {
121  s.setf(ios::right, ios::adjustfield);
122  s << (id.m_location) << "\t"
123  << "position : " << bitset<7>(id.position()) << " "
124  << "quality : " << bitset<7>(id.quality());
125 
126  return s;
127 }
unsigned int position() const
return position
void reset()
reset eta track segment
friend std::ostream & operator<<(std::ostream &, const L1MuDTTrackSegEta &)
output stream operator
unsigned int quality() const
return quality code
bool operator!=(const L1MuDTTrackSegEta &) const
unequal operator
unsigned int m_position
L1MuDTTrackSegEta()
default constructor
int bx() const
return bunch crossing
unsigned int m_quality
L1MuDTTrackSegLoc m_location
bool operator==(const L1MuDTTrackSegEta &) const
equal operator
L1MuDTTrackSegEta & operator=(const L1MuDTTrackSegEta &)
assignment operator
virtual ~L1MuDTTrackSegEta()
destructor