CMS 3D CMS Logo

RPCCompDetId.h
Go to the documentation of this file.
1 #ifndef MuonDetId_RPCCompDetId_h
2 #define MuonDetId_RPCCompDetId_h
3 // -*- C++ -*-
4 //
5 // Package: MuonDetId
6 // Class : RPCCompDetId
7 //
13 //
14 // Author: Marcello Maggi
15 // Created: Wed Nov 2 12:09:10 CET 2011
16 //
19 #include <string>
20 
21 class RPCCompDetId : public DetId {
22 public:
23  RPCCompDetId();
24 
27  RPCCompDetId(uint32_t id);
28  RPCCompDetId(DetId id);
29 
31  RPCCompDetId(int region, int ring, int station, int sector, int layer, int subsector, int type);
32 
34  RPCCompDetId(const std::string& dbname, int type);
35 
37  bool operator<(const RPCCompDetId& r) const;
38 
39  int region() const;
40  int ring() const;
41  int wheel() const;
42  int station() const;
43  int disk() const;
44  int sector() const;
45  int layer() const;
46  int subsector() const;
47  int type() const;
48  std::string dbname() const;
49 
50  static const int minRegionId = -1;
51  static const int maxRegionId = 1;
52  static const int allRegionId = minRegionId - 1;
53 
54  static const int minRingForwardId = 1;
55  static const int maxRingForwardId = 3;
56  static const int minRingBarrelId = -2;
57  static const int maxRingBarrelId = 2;
58  static const int RingBarrelOffSet = 3;
59  static const int allRingId = minRingBarrelId - 1;
60 
61  static const int minStationId = 1;
62  static const int maxStationId = 4;
63  static const int allStationId = minStationId - 1;
64 
65  static const int minSectorId = 1;
66  static const int maxSectorId = 36;
67  static const int minSectorBarrelId = 1;
68  static const int maxSectorBarrelId = 12;
69  static const int minSectorForwardId = 1;
70  static const int maxSectorForwardId = 36;
71  static const int allSectorId = minSectorId - 1;
72 
73  static const int minLayerId = 1;
74  static const int maxLayerId = 2;
75  static const int allLayerId = minLayerId - 1;
76 
77  static const int minSubSectorId = 1;
78  static const int maxSubSectorId = 2;
79  static const int allSubSectorId = minSubSectorId - 1;
80 
81 private:
82  static const int RegionNumBits_ = 2;
83  static const int RegionStartBit_ = 0;
84  static const int RegionMask_ = 0X3;
85 
86  static const int RingNumBits_ = 3;
88  static const unsigned int RingMask_ = 0X7;
89 
90  static const int StationNumBits_ = 3;
92  static const unsigned int StationMask_ = 0X7;
93 
94  static const int SectorNumBits_ = 6;
96  static const unsigned int SectorMask_ = 0X3F;
97 
98  static const int LayerNumBits_ = 2;
100  static const unsigned int LayerMask_ = 0X3;
101 
102  static const int SubSectorNumBits_ = 2;
104  static const unsigned int SubSectorMask_ = 0X3;
105 
106 private:
107  void init(int region, int ring, int station, int sector, int layer, int subsector);
108 
109  void init();
110  void initGas();
111  std::string gasDBname() const;
112 
113 private:
115  int _type;
116 
117 }; // RPCCompDetId
118 
119 std::ostream& operator<<(std::ostream& os, const RPCCompDetId& id);
120 
121 #endif
std::string _dbname
Definition: RPCCompDetId.h:114
static const int RegionMask_
Definition: RPCCompDetId.h:84
int sector() const
Definition: RPCCompDetId.cc:65
static const int maxStationId
Definition: RPCCompDetId.h:62
static const int minRingBarrelId
Definition: RPCCompDetId.h:56
int subsector() const
Definition: RPCCompDetId.cc:69
static const int allRegionId
Definition: RPCCompDetId.h:52
static const int maxSubSectorId
Definition: RPCCompDetId.h:78
static const int allSubSectorId
Definition: RPCCompDetId.h:79
static const int RingNumBits_
Definition: RPCCompDetId.h:86
static const int allRingId
Definition: RPCCompDetId.h:59
static const unsigned int LayerMask_
Definition: RPCCompDetId.h:100
int region() const
Definition: RPCCompDetId.cc:45
static const int allSectorId
Definition: RPCCompDetId.h:71
static const int RegionStartBit_
Definition: RPCCompDetId.h:83
int layer() const
Definition: RPCCompDetId.cc:67
static const int maxSectorBarrelId
Definition: RPCCompDetId.h:68
bool operator<(const RPCCompDetId &r) const
Sort Operator based on the name.
Definition: RPCCompDetId.cc:43
int disk() const
Definition: RPCCompDetId.cc:58
int station() const
Definition: RPCCompDetId.cc:56
static const int minSubSectorId
Definition: RPCCompDetId.h:77
int type() const
Definition: RPCCompDetId.cc:71
static const int minSectorBarrelId
Definition: RPCCompDetId.h:67
static const int StationStartBit_
Definition: RPCCompDetId.h:91
static const int RingStartBit_
Definition: RPCCompDetId.h:87
static const int minRegionId
Definition: RPCCompDetId.h:50
static const int SubSectorStartBit_
Definition: RPCCompDetId.h:103
static const int allStationId
Definition: RPCCompDetId.h:63
static const int SubSectorNumBits_
Definition: RPCCompDetId.h:102
std::string gasDBname() const
static const int maxLayerId
Definition: RPCCompDetId.h:74
static const int minStationId
Definition: RPCCompDetId.h:61
static const int allLayerId
Definition: RPCCompDetId.h:75
static const unsigned int StationMask_
Definition: RPCCompDetId.h:92
static const unsigned int SectorMask_
Definition: RPCCompDetId.h:96
static const int maxRingBarrelId
Definition: RPCCompDetId.h:57
int wheel() const
Definition: RPCCompDetId.cc:49
static const int LayerNumBits_
Definition: RPCCompDetId.h:98
Definition: DetId.h:17
static const int RegionNumBits_
Definition: RPCCompDetId.h:82
int ring() const
Definition: RPCCompDetId.cc:47
static const unsigned int SubSectorMask_
Definition: RPCCompDetId.h:104
static const int maxRegionId
Definition: RPCCompDetId.h:51
static const int minSectorForwardId
Definition: RPCCompDetId.h:69
static const int minSectorId
Definition: RPCCompDetId.h:65
static const int RingBarrelOffSet
Definition: RPCCompDetId.h:58
static const int SectorNumBits_
Definition: RPCCompDetId.h:94
std::string dbname() const
Definition: RPCCompDetId.cc:73
static const int minRingForwardId
Definition: RPCCompDetId.h:54
static const int maxSectorId
Definition: RPCCompDetId.h:66
static const int maxRingForwardId
Definition: RPCCompDetId.h:55
static const int minLayerId
Definition: RPCCompDetId.h:73
std::ostream & operator<<(std::ostream &os, const RPCCompDetId &id)
static const int StationNumBits_
Definition: RPCCompDetId.h:90
static const int maxSectorForwardId
Definition: RPCCompDetId.h:70
static const unsigned int RingMask_
Definition: RPCCompDetId.h:88
static const int LayerStartBit_
Definition: RPCCompDetId.h:99
static const int SectorStartBit_
Definition: RPCCompDetId.h:95