CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
50  virtual ~DTTracoId() {}
51 
53  inline int wheel() const { return _statId.wheel(); }
55  inline int station() const { return _statId.station(); }
57  inline int sector() const { return _statId.sector(); }
59  inline int traco() const { return _traco; }
61  inline DTChamberId ChamberId() const { return _statId; }
62 
63  bool operator==(const DTTracoId& id) const {
64  if (wheel() != id.wheel())
65  return false;
66  if (sector() != id.sector())
67  return false;
68  if (station() != id.station())
69  return false;
70  if (_traco != id.traco())
71  return false;
72  return true;
73  }
74 
75  bool operator<(const DTTracoId& id) const {
76  if (wheel() < id.wheel())
77  return true;
78  if (wheel() > id.wheel())
79  return false;
80 
81  if (station() < id.station())
82  return true;
83  if (station() > id.station())
84  return false;
85 
86  if (sector() < id.sector())
87  return true;
88  if (sector() > id.sector())
89  return false;
90 
91  if (traco() < id.traco())
92  return true;
93  if (traco() > id.traco())
94  return false;
95 
96  return false;
97  }
98 
99 private:
100  DTChamberId _statId; // this is 3 bytes
101  int _traco;
102 };
103 
104 #endif
bool operator==(const DTTracoId &id) const
Definition: DTTracoId.h:63
int _traco
Definition: DTTracoId.h:101
DTTracoId(const int wheel_id, const int station_id, const int sector_id, const int traco_id)
Constructor.
Definition: DTTracoId.h:43
int sector() const
Returns sector number.
Definition: DTTracoId.h:57
int traco() const
Returns the traco.
Definition: DTTracoId.h:59
bool operator<(const DTTracoId &id) const
Definition: DTTracoId.h:75
int station() const
Returns station number.
Definition: DTTracoId.h:55
DTChamberId ChamberId() const
Returns the chamber id.
Definition: DTTracoId.h:61
DTTracoId()
Constructor.
Definition: DTTracoId.h:37
DTTracoId(const DTTracoId &tracoId)
Constructor.
Definition: DTTracoId.h:47
int wheel() const
Returns wheel number.
Definition: DTTracoId.h:53
DTChamberId _statId
Definition: DTTracoId.h:100
int sector() const
Definition: DTChamberId.h:49
virtual ~DTTracoId()
Destructor.
Definition: DTTracoId.h:50
int station() const
Return the station number.
Definition: DTChamberId.h:42
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
DTTracoId(const DTChamberId &mu_stat_id, const int traco_id)
Constructor.
Definition: DTTracoId.h:40