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 
52  virtual ~DTBtiId() {}
53 
55  inline int wheel() const { return _suplId.wheel(); }
57  inline int station() const { return _suplId.station(); }
59  inline int sector() const { return _suplId.sector(); }
61  inline int superlayer() const { return _suplId.superlayer(); }
63  inline int bti() const { return _bti; }
65  inline DTSuperLayerId SLId() const { return _suplId; }
66 
67  bool operator==(const DTBtiId& id) const {
68  if (wheel() != id.wheel())
69  return false;
70  if (sector() != id.sector())
71  return false;
72  if (station() != id.station())
73  return false;
74  if (superlayer() != id.superlayer())
75  return false;
76  if (_bti != id.bti())
77  return false;
78  return true;
79  }
80 
81  bool operator<(const DTBtiId& id) const {
82  if (wheel() < id.wheel())
83  return true;
84  if (wheel() > id.wheel())
85  return false;
86 
87  if (station() < id.station())
88  return true;
89  if (station() > id.station())
90  return false;
91 
92  if (sector() < id.sector())
93  return true;
94  if (sector() > id.sector())
95  return false;
96 
97  if (superlayer() < id.superlayer())
98  return true;
99  if (superlayer() > id.superlayer())
100  return false;
101 
102  if (bti() < id.bti())
103  return true;
104  if (bti() > id.bti())
105  return false;
106 
107  return false;
108  }
109 
110 private:
111  DTSuperLayerId _suplId; // this is 4 bytes
112  int _bti;
113 };
114 
115 #endif
int station() const
Return the station number.
Definition: DTChamberId.h:42
bool operator<(const DTBtiId &id) const
Definition: DTBtiId.h:81
int sector() const
Returns sector number.
Definition: DTBtiId.h:59
int _bti
Definition: DTBtiId.h:112
int bti() const
Returns the bti.
Definition: DTBtiId.h:63
DTBtiId(const DTBtiId &btiId)
Constructor.
Definition: DTBtiId.h:49
bool operator==(const DTBtiId &id) const
Definition: DTBtiId.h:67
int wheel() const
Returns wheel number.
Definition: DTBtiId.h:55
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:61
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:39
int sector() const
Definition: DTChamberId.h:49
DTSuperLayerId _suplId
Definition: DTBtiId.h:111
DTSuperLayerId SLId() const
Returns the superlayer id.
Definition: DTBtiId.h:65
virtual ~DTBtiId()
Destructor.
Definition: DTBtiId.h:52
int station() const
Returns station number.
Definition: DTBtiId.h:57
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