CMS 3D CMS Logo

DTBtiId.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
8 //
9 //--------------------------------------------------
10 #ifndef DT_BTI_ID_H_
11 #define DT_BTI_ID_H_
12 
13 //------------------------------------
14 // Collaborating Class Declarations --
15 //------------------------------------
16 
17 //----------------------
18 // Base Class Headers --
19 //----------------------
22 
23 //---------------
24 // C++ Headers --
25 //---------------
26 
27 // ---------------------
28 // -- Class Interface --
29 // ---------------------
30 
31 //typedef unsigned char myint8;
32 class DTBtiId {
33 public:
35  DTBtiId() : _bti(0) {}
36 
38  DTBtiId(const DTSuperLayerId& mu_superlayer_id, const int bti_id) : _suplId(mu_superlayer_id), _bti(bti_id) {}
39 
41  DTBtiId(const DTChamberId& mu_stat_id, const int superlayer_id, const int bti_id)
42  : _suplId(mu_stat_id, superlayer_id), _bti(bti_id) {}
43 
45  DTBtiId(const int wheel_id, const int station_id, const int sector_id, const int superlayer_id, const int bti_id)
46  : _suplId(wheel_id, station_id, sector_id, superlayer_id), _bti(bti_id) {}
47 
49  DTBtiId(const DTBtiId& btiId) : _suplId(btiId._suplId), _bti(btiId._bti) {}
50 
51  // Assignment Operator
52  DTBtiId& operator=(const DTBtiId& btiId) = default;
53 
55  virtual ~DTBtiId() {}
56 
58  inline int wheel() const { return _suplId.wheel(); }
60  inline int station() const { return _suplId.station(); }
62  inline int sector() const { return _suplId.sector(); }
64  inline int superlayer() const { return _suplId.superlayer(); }
66  inline int bti() const { return _bti; }
68  inline DTSuperLayerId SLId() const { return _suplId; }
69 
70  bool operator==(const DTBtiId& id) const {
71  if (wheel() != id.wheel())
72  return false;
73  if (sector() != id.sector())
74  return false;
75  if (station() != id.station())
76  return false;
77  if (superlayer() != id.superlayer())
78  return false;
79  if (_bti != id.bti())
80  return false;
81  return true;
82  }
83 
84  bool operator<(const DTBtiId& id) const {
85  if (wheel() < id.wheel())
86  return true;
87  if (wheel() > id.wheel())
88  return false;
89 
90  if (station() < id.station())
91  return true;
92  if (station() > id.station())
93  return false;
94 
95  if (sector() < id.sector())
96  return true;
97  if (sector() > id.sector())
98  return false;
99 
100  if (superlayer() < id.superlayer())
101  return true;
102  if (superlayer() > id.superlayer())
103  return false;
104 
105  if (bti() < id.bti())
106  return true;
107  if (bti() > id.bti())
108  return false;
109 
110  return false;
111  }
112 
113 private:
114  DTSuperLayerId _suplId; // this is 4 bytes
115  int _bti;
116 };
117 
118 #endif
int station() const
Return the station number.
Definition: DTChamberId.h:45
bool operator<(const DTBtiId &id) const
Definition: DTBtiId.h:84
int sector() const
Returns sector number.
Definition: DTBtiId.h:62
int _bti
Definition: DTBtiId.h:115
int bti() const
Returns the bti.
Definition: DTBtiId.h:66
DTBtiId(const DTBtiId &btiId)
Constructor.
Definition: DTBtiId.h:49
bool operator==(const DTBtiId &id) const
Definition: DTBtiId.h:70
int wheel() const
Returns wheel number.
Definition: DTBtiId.h:58
DTBtiId(const DTChamberId &mu_stat_id, const int superlayer_id, const int bti_id)
Constructor.
Definition: DTBtiId.h:41
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:64
DTBtiId & operator=(const DTBtiId &btiId)=default
DTBtiId()
Constructor.
Definition: DTBtiId.h:35
DTBtiId(const DTSuperLayerId &mu_superlayer_id, const int bti_id)
Constructor.
Definition: DTBtiId.h:38
int superlayer() const
Return the superlayer number (deprecated method name)
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:42
int sector() const
Definition: DTChamberId.h:52
DTSuperLayerId _suplId
Definition: DTBtiId.h:114
DTSuperLayerId SLId() const
Returns the superlayer id.
Definition: DTBtiId.h:68
virtual ~DTBtiId()
Destructor.
Definition: DTBtiId.h:55
int station() const
Returns station number.
Definition: DTBtiId.h:60
DTBtiId(const int wheel_id, const int station_id, const int sector_id, const int superlayer_id, const int bti_id)
Constructor.
Definition: DTBtiId.h:45