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 // $Date: 2008/10/13 07:44:43 $
9 // $Revision: 1.3 $
10 //
11 // Author :
12 // N. Neumeister CERN EP
13 //
14 //--------------------------------------------------
15 
16 //-----------------------
17 // This Class's Header --
18 //-----------------------
19 
21 
22 //---------------
23 // C++ Headers --
24 //---------------
25 
26 #include <iostream>
27 #include <iomanip>
28 #include <cstdlib>
29 #include <cassert>
30 
31 //-------------------------------
32 // Collaborating Class Headers --
33 //-------------------------------
34 
35 using namespace std;
36 
37 // --------------------------------
38 // class L1MuDTTrackSegLoc
39 //---------------------------------
40 
41 //----------------
42 // Constructors --
43 //----------------
44 
46  m_wheel(0), m_sector(0), m_station(0) {}
47 
49  int sector_id,
50  int station_id) :
51  m_wheel(wheel_id), m_sector(sector_id), m_station(station_id) {
52 
53  // assert(wheel_id >= -3 && wheel_id <= 3);
54  // assert(sector_id >= 0 && sector_id < 12);
55 
56  if ( abs(wheel_id) == 3 ) {
57  // assert(station_id >= 3 && station_id <= 4);
58  }
59  else {
60  // assert(station_id >= 1 && station_id <= 4);
61  }
62 
63 }
64 
65 
67  m_wheel(id.m_wheel), m_sector(id.m_sector), m_station(id.m_station) {}
68 
69 
70 //--------------
71 // Destructor --
72 //--------------
73 
75 
76 
77 //--------------
78 // Operations --
79 //--------------
80 
81 //
82 // Assignment operator
83 //
85 
86  if ( this != &id ) {
87  m_wheel = id.m_wheel;
88  m_sector = id.m_sector;
89  m_station = id.m_station;
90  }
91  return *this;
92 
93 }
94 
95 
96 //
97 // Equal operator
98 //
100 
101  if ( m_wheel != id.wheel() ) return false;
102  if ( m_sector != id.sector() ) return false;
103  if ( m_station != id.station() ) return false;
104  return true;
105 
106 }
107 
108 
109 //
110 // Unequal operator
111 //
113 
114  if ( m_wheel != id.wheel() ) return true;
115  if ( m_sector != id.sector() ) return true;
116  if ( m_station != id.station() ) return true;
117  return false;
118 
119 }
120 
121 
122 //
123 // Less operator
124 //
126 
127  if ( wheel() < id.wheel() ) return true;
128  if ( wheel() > id.wheel() ) return false;
129  if ( sector() < id.sector() ) return true;
130  if ( sector() > id.sector() ) return false;
131  if ( station() < id.station() ) return true;
132  if ( station() > id.station() ) return false;
133  return false;
134 
135 }
136 
137 
138 //
139 // output stream operator
140 //
141 ostream& operator<<(ostream& s, const L1MuDTTrackSegLoc& id) {
142 
143  s.setf(ios::right,ios::adjustfield);
144  s << "wheel = " << setw(2) << id.wheel() << " "
145  << "sector = " << setw(2) << id.sector() << " "
146  << "station = " << setw(1) << id.station();
147 
148  return s;
149 
150 }
int sector() const
return sector (30 deg)
#define abs(x)
Definition: mlp_lapack.h:159
int station() const
return station
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
L1MuDTTrackSegLoc()
default constructor
bool operator==(const L1MuDTTrackSegLoc &) const
equal operator
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