test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuDTTrackSegLoc.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuDTTrackSegLoc
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 L1MuDTTrackSegLoc
37 //---------------------------------
38 
39 //----------------
40 // Constructors --
41 //----------------
42 
44  m_wheel(0), m_sector(0), m_station(0) {}
45 
47  int sector_id,
48  int station_id) :
49  m_wheel(wheel_id), m_sector(sector_id), m_station(station_id) {
50 
51  // assert(wheel_id >= -3 && wheel_id <= 3);
52  // assert(sector_id >= 0 && sector_id < 12);
53 
54  if ( abs(wheel_id) == 3 ) {
55  // assert(station_id >= 3 && station_id <= 4);
56  }
57  else {
58  // assert(station_id >= 1 && station_id <= 4);
59  }
60 
61 }
62 
63 
65  m_wheel(id.m_wheel), m_sector(id.m_sector), m_station(id.m_station) {}
66 
67 
68 //--------------
69 // Destructor --
70 //--------------
71 
73 
74 
75 //--------------
76 // Operations --
77 //--------------
78 
79 //
80 // Assignment operator
81 //
83 
84  if ( this != &id ) {
85  m_wheel = id.m_wheel;
86  m_sector = id.m_sector;
87  m_station = id.m_station;
88  }
89  return *this;
90 
91 }
92 
93 
94 //
95 // Equal operator
96 //
98 
99  if ( m_wheel != id.wheel() ) return false;
100  if ( m_sector != id.sector() ) return false;
101  if ( m_station != id.station() ) return false;
102  return true;
103 
104 }
105 
106 
107 //
108 // Unequal operator
109 //
111 
112  if ( m_wheel != id.wheel() ) return true;
113  if ( m_sector != id.sector() ) return true;
114  if ( m_station != id.station() ) return true;
115  return false;
116 
117 }
118 
119 
120 //
121 // Less operator
122 //
124 
125  if ( wheel() < id.wheel() ) return true;
126  if ( wheel() > id.wheel() ) return false;
127  if ( sector() < id.sector() ) return true;
128  if ( sector() > id.sector() ) return false;
129  if ( station() < id.station() ) return true;
130  if ( station() > id.station() ) return false;
131  return false;
132 
133 }
134 
135 
136 //
137 // output stream operator
138 //
139 ostream& operator<<(ostream& s, const L1MuDTTrackSegLoc& id) {
140 
141  s.setf(ios::right,ios::adjustfield);
142  s << "wheel = " << setw(2) << id.wheel() << " "
143  << "sector = " << setw(2) << id.sector() << " "
144  << "station = " << setw(1) << id.station();
145 
146  return s;
147 
148 }
int sector() const
return sector (30 deg)
int station() const
return station
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
L1MuDTTrackSegLoc()
default constructor
bool operator==(const L1MuDTTrackSegLoc &) const
equal operator
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool operator<(const L1MuDTTrackSegLoc &) const
less operator
virtual ~L1MuDTTrackSegLoc()
destructor
bool operator!=(const L1MuDTTrackSegLoc &) const
unequal operator
int wheel() const
return wheel
L1MuDTTrackSegLoc & operator=(const L1MuDTTrackSegLoc &)
assignment operator