CMS 3D CMS Logo

L1MuBMTrackSegLoc.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuBMTrackSegLoc
4 //
5 // Description: Logical location of a 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 <cstdlib>
27 #include <cassert>
28 
29 //-------------------------------
30 // Collaborating Class Headers --
31 //-------------------------------
32 
33 using namespace std;
34 
35 // --------------------------------
36 // class L1MuBMTrackSegLoc
37 //---------------------------------
38 
39 //----------------
40 // Constructors --
41 //----------------
42 
43 L1MuBMTrackSegLoc::L1MuBMTrackSegLoc() : m_wheel(0), m_sector(0), m_station(0) {}
44 
45 L1MuBMTrackSegLoc::L1MuBMTrackSegLoc(int wheel_id, int sector_id, int station_id)
46  : m_wheel(wheel_id), m_sector(sector_id), m_station(station_id) {
47  // assert(wheel_id >= -3 && wheel_id <= 3);
48  // assert(sector_id >= 0 && sector_id < 12);
49 
50  if (abs(wheel_id) == 3) {
51  // assert(station_id >= 3 && station_id <= 4);
52  } else {
53  // assert(station_id >= 1 && station_id <= 4);
54  }
55 }
56 
59 
60 //--------------
61 // Destructor --
62 //--------------
63 
65 
66 //--------------
67 // Operations --
68 //--------------
69 
70 //
71 // Assignment operator
72 //
74  if (this != &id) {
75  m_wheel = id.m_wheel;
76  m_sector = id.m_sector;
77  m_station = id.m_station;
78  }
79  return *this;
80 }
81 
82 //
83 // Equal operator
84 //
86  if (m_wheel != id.wheel())
87  return false;
88  if (m_sector != id.sector())
89  return false;
90  if (m_station != id.station())
91  return false;
92  return true;
93 }
94 
95 //
96 // Unequal operator
97 //
99  if (m_wheel != id.wheel())
100  return true;
101  if (m_sector != id.sector())
102  return true;
103  if (m_station != id.station())
104  return true;
105  return false;
106 }
107 
108 //
109 // Less operator
110 //
112  if (wheel() < id.wheel())
113  return true;
114  if (wheel() > id.wheel())
115  return false;
116  if (sector() < id.sector())
117  return true;
118  if (sector() > id.sector())
119  return false;
120  if (station() < id.station())
121  return true;
122  if (station() > id.station())
123  return false;
124  return false;
125 }
126 
127 //
128 // output stream operator
129 //
130 ostream& operator<<(ostream& s, const L1MuBMTrackSegLoc& id) {
131  s.setf(ios::right, ios::adjustfield);
132  s << "wheel = " << setw(2) << id.wheel() << " "
133  << "sector = " << setw(2) << id.sector() << " "
134  << "station = " << setw(1) << id.station();
135 
136  return s;
137 }
bool operator!=(const L1MuBMTrackSegLoc &) const
unequal operator
L1MuBMTrackSegLoc()
default constructor
int wheel() const
return wheel
bool operator<(const L1MuBMTrackSegLoc &) const
less operator
int sector() const
return sector (30 deg)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool operator==(const L1MuBMTrackSegLoc &) const
equal operator
friend std::ostream & operator<<(std::ostream &, const L1MuBMTrackSegLoc &)
output stream operator
virtual ~L1MuBMTrackSegLoc()
destructor
L1MuBMTrackSegLoc & operator=(const L1MuBMTrackSegLoc &)
assignment operator
int station() const
return station