CMS 3D CMS Logo

DTTracoId.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
8 //
9 //--------------------------------------------------
10 #ifndef DT_TRACO_ID_H_
11 #define DT_TRACO_ID_H_
12 
13 //------------------------------------
14 // Collaborating Class Declarations --
15 //------------------------------------
16 
17 //----------------------
18 // Base Class Headers --
19 //----------------------
21 
22 //---------------
23 // C++ Headers --
24 //---------------
25 
26 //---------------------------------------------------
27 // DTTracoChip
28 //---------------------------------------------------
29 
30 // ---------------------
31 // -- Class Interface --
32 // ---------------------
33 
34 class DTTracoId {
35 public:
37  DTTracoId() : _traco(0) {}
38 
40  DTTracoId(const DTChamberId& mu_stat_id, const int traco_id) : _statId(mu_stat_id), _traco(traco_id) {}
41 
43  DTTracoId(const int wheel_id, const int station_id, const int sector_id, const int traco_id)
44  : _statId(wheel_id, station_id, sector_id), _traco(traco_id) {}
45 
47  DTTracoId(const DTTracoId& tracoId) : _statId(tracoId._statId), _traco(tracoId._traco) {}
48 
49  // Assignment Operator
50  DTTracoId& operator=(const DTTracoId& tracoId) = default;
51 
53  virtual ~DTTracoId() {}
54 
56  inline int wheel() const { return _statId.wheel(); }
58  inline int station() const { return _statId.station(); }
60  inline int sector() const { return _statId.sector(); }
62  inline int traco() const { return _traco; }
64  inline DTChamberId ChamberId() const { return _statId; }
65 
66  bool operator==(const DTTracoId& id) const {
67  if (wheel() != id.wheel())
68  return false;
69  if (sector() != id.sector())
70  return false;
71  if (station() != id.station())
72  return false;
73  if (_traco != id.traco())
74  return false;
75  return true;
76  }
77 
78  bool operator<(const DTTracoId& id) const {
79  if (wheel() < id.wheel())
80  return true;
81  if (wheel() > id.wheel())
82  return false;
83 
84  if (station() < id.station())
85  return true;
86  if (station() > id.station())
87  return false;
88 
89  if (sector() < id.sector())
90  return true;
91  if (sector() > id.sector())
92  return false;
93 
94  if (traco() < id.traco())
95  return true;
96  if (traco() > id.traco())
97  return false;
98 
99  return false;
100  }
101 
102 private:
103  DTChamberId _statId; // this is 3 bytes
104  int _traco;
105 };
106 
107 #endif
int station() const
Return the station number.
Definition: DTChamberId.h:45
bool operator==(const DTTracoId &id) const
Definition: DTTracoId.h:66
int _traco
Definition: DTTracoId.h:104
DTTracoId(const int wheel_id, const int station_id, const int sector_id, const int traco_id)
Constructor.
Definition: DTTracoId.h:43
int wheel() const
Returns wheel number.
Definition: DTTracoId.h:56
DTChamberId ChamberId() const
Returns the chamber id.
Definition: DTTracoId.h:64
int station() const
Returns station number.
Definition: DTTracoId.h:58
bool operator<(const DTTracoId &id) const
Definition: DTTracoId.h:78
int sector() const
Returns sector number.
Definition: DTTracoId.h:60
DTTracoId()
Constructor.
Definition: DTTracoId.h:37
int traco() const
Returns the traco.
Definition: DTTracoId.h:62
DTTracoId(const DTTracoId &tracoId)
Constructor.
Definition: DTTracoId.h:47
DTChamberId _statId
Definition: DTTracoId.h:103
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:42
int sector() const
Definition: DTChamberId.h:52
virtual ~DTTracoId()
Destructor.
Definition: DTTracoId.h:53
DTTracoId(const DTChamberId &mu_stat_id, const int traco_id)
Constructor.
Definition: DTTracoId.h:40
DTTracoId & operator=(const DTTracoId &tracoId)=default