CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 // ---------------------
32 // -- Class Interface --
33 // ---------------------
34 
35 class DTTracoId {
36 
37  public:
38 
40  DTTracoId() : _traco(0) {}
41 
43  DTTracoId(const DTChamberId& mu_stat_id,
44  const int traco_id) : _statId(mu_stat_id),
45  _traco(traco_id) {}
46 
48  DTTracoId(const int wheel_id,
49  const int station_id,
50  const int sector_id,
51  const int traco_id) :
52  _statId(wheel_id,station_id,sector_id),
53  _traco(traco_id) {}
54 
56  DTTracoId(const DTTracoId& tracoId) :
57  _statId(tracoId._statId),
58  _traco(tracoId._traco) {}
59 
61  virtual ~DTTracoId() {}
62 
64  inline int wheel() const { return _statId.wheel(); }
66  inline int station() const { return _statId.station(); }
68  inline int sector() const { return _statId.sector(); }
70  inline int traco() const { return _traco; }
72  inline DTChamberId ChamberId() const { return _statId; }
73 
74  bool operator == ( const DTTracoId& id) const {
75  if ( wheel()!=id.wheel()) return false;
76  if ( sector()!=id.sector())return false;
77  if ( station()!=id.station())return false;
78  if ( _traco!=id.traco())return false;
79  return true;
80  }
81 
82  bool operator < ( const DTTracoId& id) const {
83  if ( wheel() < id.wheel() ) return true;
84  if ( wheel() > id.wheel() ) return false;
85 
86  if ( station() < id.station() ) return true;
87  if ( station() > id.station() ) return false;
88 
89  if ( sector() < id.sector() ) return true;
90  if ( sector() > id.sector() ) return false;
91 
92  if ( traco() < id.traco() ) return true;
93  if ( traco() > id.traco() ) return false;
94 
95  return false;
96 
97  }
98 
99 
100  private:
101  DTChamberId _statId; // this is 3 bytes
102  int _traco;
103 
104 };
105 
106 #endif
bool operator==(const DTTracoId &id) const
Definition: DTTracoId.h:74
int _traco
Definition: DTTracoId.h:102
DTTracoId(const int wheel_id, const int station_id, const int sector_id, const int traco_id)
Constructor.
Definition: DTTracoId.h:48
int sector() const
Returns sector number.
Definition: DTTracoId.h:68
int traco() const
Returns the traco.
Definition: DTTracoId.h:70
bool operator<(const DTTracoId &id) const
Definition: DTTracoId.h:82
int station() const
Returns station number.
Definition: DTTracoId.h:66
DTChamberId ChamberId() const
Returns the chamber id.
Definition: DTTracoId.h:72
DTTracoId()
Constructor.
Definition: DTTracoId.h:40
DTTracoId(const DTTracoId &tracoId)
Constructor.
Definition: DTTracoId.h:56
int wheel() const
Returns wheel number.
Definition: DTTracoId.h:64
DTChamberId _statId
Definition: DTTracoId.h:101
int sector() const
Definition: DTChamberId.h:61
virtual ~DTTracoId()
Destructor.
Definition: DTTracoId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
DTTracoId(const DTChamberId &mu_stat_id, const int traco_id)
Constructor.
Definition: DTTracoId.h:43