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 
58  : m_wheel(id.m_wheel), m_sector(id.m_sector), m_station(id.m_station) {}
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 }
L1MuBMTrackSegLoc::station
int station() const
return station
Definition: L1MuBMTrackSegLoc.h:62
L1MuBMTrackSegLoc::operator!=
bool operator!=(const L1MuBMTrackSegLoc &) const
unequal operator
Definition: L1MuBMTrackSegLoc.cc:98
L1MuBMTrackSegLoc::L1MuBMTrackSegLoc
L1MuBMTrackSegLoc()
default constructor
Definition: L1MuBMTrackSegLoc.cc:43
L1MuBMTrackSegLoc::operator==
bool operator==(const L1MuBMTrackSegLoc &) const
equal operator
Definition: L1MuBMTrackSegLoc.cc:85
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1MuBMTrackSegLoc.h
L1MuBMTrackSegLoc::wheel
int wheel() const
return wheel
Definition: L1MuBMTrackSegLoc.h:56
L1MuBMTrackSegLoc
Definition: L1MuBMTrackSegLoc.h:41
L1MuBMTrackSegLoc::operator<
bool operator<(const L1MuBMTrackSegLoc &) const
less operator
Definition: L1MuBMTrackSegLoc.cc:111
L1MuBMTrackSegLoc::m_station
int m_station
Definition: L1MuBMTrackSegLoc.h:82
L1MuBMTrackSegLoc::sector
int sector() const
return sector (30 deg)
Definition: L1MuBMTrackSegLoc.h:59
L1MuBMTrackSegLoc::m_sector
int m_sector
Definition: L1MuBMTrackSegLoc.h:81
std
Definition: JetResolutionObject.h:76
L1MuBMTrackSegLoc::operator=
L1MuBMTrackSegLoc & operator=(const L1MuBMTrackSegLoc &)
assignment operator
Definition: L1MuBMTrackSegLoc.cc:73
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
operator<<
ostream & operator<<(ostream &s, const L1MuBMTrackSegLoc &id)
Definition: L1MuBMTrackSegLoc.cc:130
L1MuBMTrackSegLoc::~L1MuBMTrackSegLoc
virtual ~L1MuBMTrackSegLoc()
destructor
Definition: L1MuBMTrackSegLoc.cc:64
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L1MuBMTrackSegLoc::m_wheel
int m_wheel
Definition: L1MuBMTrackSegLoc.h:80