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 
34  public:
35 
37  DTBtiId() : _bti(0) {}
38 
40  DTBtiId(const DTSuperLayerId& mu_superlayer_id,
41  const int bti_id) : _suplId(mu_superlayer_id),
42  _bti(bti_id) {}
43 
45  DTBtiId(const DTChamberId& mu_stat_id,
46  const int superlayer_id,
47  const int bti_id) : _suplId(mu_stat_id,superlayer_id),
48  _bti(bti_id) {}
49 
51  DTBtiId(const int wheel_id,
52  const int station_id,
53  const int sector_id,
54  const int superlayer_id,
55  const int bti_id) :
56  _suplId(wheel_id,station_id,sector_id,superlayer_id),
57  _bti(bti_id) {}
58 
60  DTBtiId(const DTBtiId& btiId) :
61  _suplId(btiId._suplId), _bti(btiId._bti) {}
62 
64  virtual ~DTBtiId() {}
65 
67  inline int wheel() const { return _suplId.wheel(); }
69  inline int station() const { return _suplId.station(); }
71  inline int sector() const { return _suplId.sector(); }
73  inline int superlayer() const { return _suplId.superlayer(); }
75  inline int bti() const { return _bti; }
77  inline DTSuperLayerId SLId() const { return _suplId; }
78 
79  bool operator == ( const DTBtiId& id) const {
80  if ( wheel()!=id.wheel()) return false;
81  if ( sector()!=id.sector())return false;
82  if ( station()!=id.station())return false;
83  if ( superlayer()!=id.superlayer())return false;
84  if ( _bti!=id.bti())return false;
85  return true;
86  }
87 
88  bool operator < ( const DTBtiId& id) const {
89  if ( wheel() < id.wheel() ) return true;
90  if ( wheel() > id.wheel() ) return false;
91 
92  if ( station() < id.station() ) return true;
93  if ( station() > id.station() ) return false;
94 
95  if ( sector() < id.sector() ) return true;
96  if ( sector() > id.sector() ) return false;
97 
98  if ( superlayer() < id.superlayer() ) return true;
99  if ( superlayer() > id.superlayer() ) return false;
100 
101  if ( bti() < id.bti() ) return true;
102  if ( bti() > id.bti() ) return false;
103 
104  return false;
105  }
106 
107 
108  private:
109  DTSuperLayerId _suplId; // this is 4 bytes
110  int _bti;
111 
112 };
113 
114 #endif
int _bti
Definition: DTBtiId.h:110
DTBtiId(const DTBtiId &btiId)
Constructor.
Definition: DTBtiId.h:60
int wheel() const
Returns wheel number.
Definition: DTBtiId.h:67
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:73
int sector() const
Returns sector number.
Definition: DTBtiId.h:71
int station() const
Returns station number.
Definition: DTBtiId.h:69
DTBtiId(const DTChamberId &mu_stat_id, const int superlayer_id, const int bti_id)
Constructor.
Definition: DTBtiId.h:45
bool operator==(const DTBtiId &id) const
Definition: DTBtiId.h:79
bool operator<(const DTBtiId &id) const
Definition: DTBtiId.h:88
DTBtiId()
Constructor.
Definition: DTBtiId.h:37
int superlayer() const
Return the superlayer number (deprecated method name)
int bti() const
Returns the bti.
Definition: DTBtiId.h:75
DTBtiId(const DTSuperLayerId &mu_superlayer_id, const int bti_id)
Constructor.
Definition: DTBtiId.h:40
int sector() const
Definition: DTChamberId.h:61
DTSuperLayerId _suplId
Definition: DTBtiId.h:109
virtual ~DTBtiId()
Destructor.
Definition: DTBtiId.h:64
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
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:51
DTSuperLayerId SLId() const
Returns the superlayer id.
Definition: DTBtiId.h:77