CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
RPCDetId Class Reference

#include <RPCDetId.h>

Inheritance diagram for RPCDetId:
DetId

Public Member Functions

void buildfromDB (int region, int ring, int layer, int sector, const std::string &subsector, const std::string &roll, const std::string &dbname)
 
void buildfromTrIndex (int trIndex)
 Built from the trigger det Index. More...
 
RPCDetId chamberId () const
 Return the corresponding ChamberId. More...
 
int layer () const
 
bool operator< (const RPCDetId &r) const
 Sort Operator based on the raw detector id. More...
 
int region () const
 Region id: 0 for Barrel, +/-1 For +/- Endcap. More...
 
int ring () const
 
int roll () const
 
 RPCDetId ()
 
 RPCDetId (uint32_t id)
 
 RPCDetId (DetId id)
 
 RPCDetId (int region, int ring, int station, int sector, int layer, int subsector, int roll)
 Construct from fully qualified identifier. More...
 
int sector () const
 Sector id: the group of chambers at same phi (and increasing r) More...
 
int station () const
 
int subsector () const
 SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel, from 1 to 6 in Endcap) More...
 
int trIndex () const
 
- Public Member Functions inherited from DetId
constexpr Detector det () const
 get the detector field from this detid More...
 
constexpr DetId ()
 Create an empty or null id (also for persistence) More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. More...
 
constexpr DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr bool null () const
 is this a null id ? More...
 
constexpr operator uint32_t () const
 
constexpr bool operator!= (DetId id) const
 inequality More...
 
constexpr uint32_t operator() () const
 
constexpr bool operator< (DetId id) const
 comparison More...
 
constexpr bool operator== (DetId id) const
 equality More...
 
constexpr uint32_t rawId () const
 get the raw id More...
 
constexpr int subdetId () const
 get the contents of the subdetector field (not cast into any detector's numbering enum) More...
 

Static Public Attributes

static constexpr uint32_t chamberIdMask_ = ~(RollMask_ << RollStartBit_)
 
static constexpr int maxLayerId = 2
 
static constexpr int maxRegionId = 1
 
static constexpr int maxRingBarrelId = 2
 
static constexpr int maxRingForwardId = 3
 
static constexpr int maxRollId = 5
 
static constexpr int maxSectorBarrelId = 12
 
static constexpr int maxSectorForwardId = 6
 
static constexpr int maxSectorId = 12
 
static constexpr int maxStationId = 4
 
static constexpr int maxSubSectorBarrelId = 4
 
static constexpr int maxSubSectorForwardId = 6
 
static constexpr int maxSubSectorId = 6
 
static constexpr int minLayerId = 1
 
static constexpr int minRegionId = -1
 
static constexpr int minRingBarrelId = -2
 
static constexpr int minRingForwardId = 1
 
static constexpr int minRollId = 0
 
static constexpr int minSectorBarrelId = 1
 
static constexpr int minSectorForwardId = 1
 
static constexpr int minSectorId = 0
 
static constexpr int minStationId = 1
 
static constexpr int minSubSectorBarrelId = 1
 
static constexpr int minSubSectorForwardId = 1
 
static constexpr int minSubSectorId = 0
 
static constexpr int RingBarrelOffSet = 3
 
- Static Public Attributes inherited from DetId
static const int kDetMask = 0xF
 
static const int kDetOffset = 28
 
static const int kSubdetMask = 0x7
 
static const int kSubdetOffset = 25
 

Private Member Functions

void init (int region, int ring, int station, int sector, int layer, int subsector, int roll)
 

Private Attributes

int trind
 

Static Private Attributes

static constexpr unsigned int LayerMask_ = 0X1
 
static constexpr int LayerNumBits_ = 1
 
static constexpr int LayerStartBit_ = SectorStartBit_ + SectorNumBits_
 
static constexpr int RegionMask_ = 0X3
 
static constexpr int RegionNumBits_ = 2
 
static constexpr int RegionStartBit_ = 0
 
static constexpr unsigned int RingMask_ = 0X7
 
static constexpr int RingNumBits_ = 3
 
static constexpr int RingStartBit_ = RegionStartBit_ + RegionNumBits_
 
static constexpr unsigned int RollMask_ = 0X7
 
static constexpr int RollNumBits_ = 3
 
static constexpr int RollStartBit_ = SubSectorStartBit_ + SubSectorNumBits_
 
static constexpr unsigned int SectorMask_ = 0XF
 
static constexpr int SectorNumBits_ = 4
 
static constexpr int SectorStartBit_ = StationStartBit_ + StationNumBits_
 
static constexpr unsigned int StationMask_ = 0X3
 
static constexpr int StationNumBits_ = 2
 
static constexpr int StationStartBit_ = RingStartBit_ + RingNumBits_
 
static constexpr unsigned int SubSectorMask_ = 0X7
 
static constexpr int SubSectorNumBits_ = 3
 
static constexpr int SubSectorStartBit_ = LayerStartBit_ + LayerNumBits_
 

Additional Inherited Members

- Public Types inherited from DetId
enum  Detector {
  Tracker = 1, Muon = 2, Ecal = 3, Hcal = 4,
  Calo = 5, Forward = 6, VeryForward = 7, HGCalEE = 8,
  HGCalHSi = 9, HGCalHSc = 10, HGCalTrigger = 11
}
 
- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

DetUnit identifier for RPCs

Author
Ilaria Segoni

Definition at line 16 of file RPCDetId.h.

Constructor & Destructor Documentation

◆ RPCDetId() [1/4]

RPCDetId::RPCDetId ( )

Definition at line 13 of file RPCDetId.cc.

Referenced by chamberId().

int trind
Definition: RPCDetId.h:170
static constexpr int RPC
Definition: MuonSubdetId.h:13
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ RPCDetId() [2/4]

RPCDetId::RPCDetId ( uint32_t  id)

Construct from a packed id. It is required that the Detector part of id is Muon and the SubDet part is RPC, otherwise an exception is thrown.

Definition at line 15 of file RPCDetId.cc.

References DetId::det(), Exception, DetId::Muon, MuonSubdetId::RPC, and DetId::subdetId().

15  : DetId(id), trind(0) {
16  // std::cout<<" constructor of the RPCDetId" <<std::endl;
17  if (det() != DetId::Muon || subdetId() != MuonSubdetId::RPC) {
18  throw cms::Exception("InvalidDetId") << "RPCDetId ctor:"
19  << " det: " << det() << " subdet: " << subdetId() << " is not a valid RPC id";
20  }
21 }
int trind
Definition: RPCDetId.h:170
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr int RPC
Definition: MuonSubdetId.h:13
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ RPCDetId() [3/4]

RPCDetId::RPCDetId ( DetId  id)

Definition at line 22 of file RPCDetId.cc.

References DetId::det(), Exception, DetId::Muon, MuonSubdetId::RPC, and DetId::subdetId().

22  : DetId(id), trind(0) {
23  // std::cout<<" constructor of the RPCDetId" <<std::endl;
24  if (det() != DetId::Muon || subdetId() != MuonSubdetId::RPC) {
25  throw cms::Exception("InvalidDetId") << "RPCDetId ctor:"
26  << " det: " << det() << " subdet: " << subdetId() << " is not a valid RPC id";
27  }
28 }
int trind
Definition: RPCDetId.h:170
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr int RPC
Definition: MuonSubdetId.h:13
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ RPCDetId() [4/4]

RPCDetId::RPCDetId ( int  region,
int  ring,
int  station,
int  sector,
int  layer,
int  subsector,
int  roll 
)

Construct from fully qualified identifier.

Definition at line 30 of file RPCDetId.cc.

References init(), layer(), ring(), roll(), sector(), station(), and subsector().

33 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
void init(int region, int ring, int station, int sector, int layer, int subsector, int roll)
Definition: RPCDetId.cc:219
int trind
Definition: RPCDetId.h:170
int ring() const
Definition: RPCDetId.h:59
int roll() const
Definition: RPCDetId.h:92
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:88
static constexpr int RPC
Definition: MuonSubdetId.h:13
int station() const
Definition: RPCDetId.h:78
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
int layer() const
Definition: RPCDetId.h:85
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

Member Function Documentation

◆ buildfromDB()

void RPCDetId::buildfromDB ( int  region,
int  ring,
int  layer,
int  sector,
const std::string &  subsector,
const std::string &  roll,
const std::string &  dbname 
)

Definition at line 35 of file RPCDetId.cc.

References funct::abs(), Reference_intrackfit_cff::barrel, buildfromTrIndex(), gather_cfg::cout, region(), ring(), roll(), sector(), station(), subsector(), and trIndex().

Referenced by DBSpecToDetUnit::operator()().

41  {
42  bool barrel = (region == 0);
43  //STATION
44  int station = -1;
45  if (barrel) {
46  if (trlayer == 1 || trlayer == 2)
47  station = 1;
48  else if (trlayer == 3 || trlayer == 4)
49  station = 2;
50  else
51  station = trlayer - 2;
52  } else {
53  station = abs(ring);
54  }
55 
56  //LAYER
57  //int layer = 1;
58  //if (barrel && station==1) layer = trlayer;
59  //if (barrel && station==2) layer = trlayer-2;
60 
61  //SUBSECTOR
62  int subsector = 1;
63 
64  if (barrel) {
65  if (station == 3 && subs == "+")
66  subsector = 2;
67  if (station == 4 &&
68  (sector == 1 || sector == 2 || sector == 3 || sector == 5 || sector == 6 || sector == 7 || sector == 8 ||
69  sector == 10 || sector == 12) &&
70  (subs == "+")) {
71  subsector = 2;
72  }
73 
74  if (station == 4 && sector == 4) {
75  if (subs == "--")
76  subsector = 1;
77  if (subs == "-")
78  subsector = 2;
79  if (subs == "+")
80  subsector = 3;
81  if (subs == "++")
82  subsector = 4;
83  }
84  }
85 
86  // ROLL
87  int iroll = 0;
88 
89  if (roll == "Backward" || roll == "A")
90  iroll = 1;
91  else if (roll == "Central" || roll == "B")
92  iroll = 2;
93  else if (roll == "Forward" || roll == "C")
94  iroll = 3;
95  else if (roll == "D")
96  iroll = 4;
97  else {
98  std::cout << "** RPC: DBSpecToDetUnit, how to assigne roll to: " << roll << " ???" << std::endl;
99  }
100 
101  int trIndex = 0;
102  if (barrel) {
103  //cout <<" BARREL: " << endl;
104  int eta_id = 6 + ring;
105  int plane_id = station;
106  if (trlayer == 2)
107  plane_id = 5;
108  if (trlayer == 4)
109  plane_id = 6;
110  int sector_id = sector * 3;
111  int copy_id = subsector;
112  int roll_id = iroll;
113  trIndex = (eta_id * 10000 + plane_id * 1000 + sector_id * 10 + copy_id) * 10 + roll_id;
114  } else {
115  // cout << "ENDCAP : " << endl;
116  int eta_id = trlayer;
117  if (ring > 0)
118  eta_id = 12 - trlayer;
119  int plane_id = abs(ring);
120  int sector_id = sector;
121 
122  if (region < 0) {
123  if (sector_id < 20) {
124  sector_id = 19 + 1 - sector_id;
125  } else {
126  sector_id = 36 + 20 - sector_id;
127  }
128  }
129  sector_id -= 1;
130 
131  //
132  int copy_id = 1;
133  int roll_id = iroll;
134  trIndex = (eta_id * 10000 + plane_id * 1000 + sector_id * 10 + copy_id) * 10 + roll_id;
135  }
136  this->buildfromTrIndex(trIndex);
137 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
void buildfromTrIndex(int trIndex)
Built from the trigger det Index.
Definition: RPCDetId.cc:139
int trIndex() const
Definition: RPCDetId.h:96
int ring() const
Definition: RPCDetId.h:59
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int roll() const
Definition: RPCDetId.h:92
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:88
int station() const
Definition: RPCDetId.h:78
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53

◆ buildfromTrIndex()

void RPCDetId::buildfromTrIndex ( int  trIndex)

Built from the trigger det Index.

Definition at line 139 of file RPCDetId.cc.

References init(), layer(), region(), ring(), roll(), sector(), station(), subsector(), trind, and trIndex().

Referenced by buildfromDB().

139  {
140  trind = trIndex;
141  int eta_id = trIndex / 100000;
142  int region = 0;
143  int ring = 0;
144  if (eta_id <= 3) {
145  region = -1;
146  ring = eta_id;
147  } else if (eta_id >= 9) {
148  region = 1;
149  ring = 12 - eta_id;
150  } else {
151  region = 0;
152  ring = eta_id - 6;
153  }
154  trIndex = trIndex % 100000;
155  int plane_id = trIndex / 10000;
156  int station = 0;
157  int layer = 0;
158  if (plane_id <= 4) {
159  station = plane_id;
160  layer = 1;
161  } else {
162  station = plane_id - 4;
163  layer = 2;
164  }
165  trIndex = trIndex % 10000;
166  int sector_id = trIndex / 100;
167 
168  // RE+1/1 :: the chamber at x=0 (phi=0) start as CH02 instead of CH01, which is not desired
169  // while for other chambers: RE+1/(2,3) and RE+2,3,4/(2,3) the rotation seems to be arbitrary
170  // I will leave the code for the existing chambers as it is, but will remove RE+1/1 from selection
171  // These lines are programmed very asymmetric between Pos \& Neg endcap:
172  // - it affects the whole Negative Endcap
173  // - it affects the whole RE+/-1 Station
174  // - it affects all RE+(1,2,3,4)/(2,3)
175  // ==> why does it act differently on RE-(2,3,4)/1 and RE+(2,3,4)/1 ???
176  if (region != 0) {
177  if (!(ring == 1 && station > 1 && region == 1)) {
178  // skip RE+1/1 (ri=1, st=1, re=-1,+1)
179  if (!(ring == 1 && station == 1 && region != 0)) {
180  sector_id += 1;
181  if (sector_id == 37)
182  sector_id = 1;
183  }
184  }
185  }
186 
187  if (region == -1) {
188  if (sector_id < 20) {
189  sector_id = 19 + 1 - sector_id;
190  } else {
191  sector_id = 36 + 20 - sector_id;
192  }
193  }
194  trIndex = trIndex % 100;
195  int copy_id = trIndex / 10;
196  int sector = (sector_id - 1) / 3 + 1;
197  if (region != 0) {
198  sector = (sector + 1) / 2;
199  }
200  int subsector = 0;
201  if (region == 0) {
202  subsector = copy_id;
203  } else {
204  if (ring == 1 && station > 1) {
205  // 20 degree chambers
206  subsector = ((sector_id + 1) / 2 - 1) % 3 + 1;
207  } else {
208  // 10 degree chambers
209  subsector = (sector_id - 1) % 6 + 1;
210  }
211  // std::cout <<" RE"<<station*region<<"/"<<ring<<" sector_id "<<sector_id
212  // << " sector "<<sector <<" sub "<<subsector<<std::endl;
213  }
214 
215  int roll = trIndex % 10;
216  this->init(region, ring, station, sector, layer, subsector, roll);
217 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
void init(int region, int ring, int station, int sector, int layer, int subsector, int roll)
Definition: RPCDetId.cc:219
int trind
Definition: RPCDetId.h:170
int trIndex() const
Definition: RPCDetId.h:96
int ring() const
Definition: RPCDetId.h:59
int roll() const
Definition: RPCDetId.h:92
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:88
int station() const
Definition: RPCDetId.h:78
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
int layer() const
Definition: RPCDetId.h:85

◆ chamberId()

RPCDetId RPCDetId::chamberId ( ) const
inline

Return the corresponding ChamberId.

Definition at line 99 of file RPCDetId.h.

References chamberIdMask_, DetId::id_, and RPCDetId().

Referenced by RPCNeutronWriter::chamberId().

99 { return RPCDetId(id_ & chamberIdMask_); }
RPCDetId()
Definition: RPCDetId.cc:13
static constexpr uint32_t chamberIdMask_
Definition: RPCDetId.h:165
uint32_t id_
Definition: DetId.h:69

◆ init()

void RPCDetId::init ( int  region,
int  ring,
int  station,
int  sector,
int  layer,
int  subsector,
int  roll 
)
private

Definition at line 219 of file RPCDetId.cc.

References Exception, DetId::id_, layer(), LayerMask_, LayerStartBit_, maxLayerId, maxRegionId, HLT_2024v13_cff::maxRing, maxRingBarrelId, maxRingForwardId, maxRollId, maxSectorId, maxStationId, maxSubSectorId, minLayerId, minRegionId, HLT_2024v13_cff::minRing, minRingBarrelId, minRingForwardId, minRollId, minSectorId, minStationId, minSubSectorId, region(), RegionMask_, RegionStartBit_, ring(), RingBarrelOffSet, RingMask_, RingStartBit_, roll(), RollMask_, RollStartBit_, sector(), SectorMask_, SectorStartBit_, station(), StationMask_, StationStartBit_, subsector(), SubSectorMask_, and SubSectorStartBit_.

Referenced by buildfromTrIndex(), and RPCDetId().

219  {
220  int minRing = 0;
222  if (!region) {
225  }
226 
227  if (region < minRegionId || region > maxRegionId || ring < minRing || ring > maxRing || station < minStationId ||
228  station > maxStationId || sector < minSectorId || sector > maxSectorId || layer < minLayerId ||
229  layer > maxLayerId || subsector < minSubSectorId || subsector > maxSubSectorId || roll < minRollId ||
230  roll > maxRollId) {
231  throw cms::Exception("InvalidDetId") << "RPCDetId ctor:"
232  << " Invalid parameters: "
233  << " region " << region << " ring " << ring << " station " << station
234  << " sector " << sector << " layer " << layer << " subsector " << subsector
235  << " roll " << roll << std::endl;
236  }
237 
238  int regionInBits = region - minRegionId;
239  int ringInBits = 0;
240  if (region != 0)
241  ringInBits = ring - minRingForwardId;
242  if (!region)
243  ringInBits = ring + RingBarrelOffSet - minRingBarrelId;
244 
245  int stationInBits = station - minStationId;
246  int sectorInBits = sector - (minSectorId + 1);
247  int layerInBits = layer - minLayerId;
248  int subSectorInBits = subsector - (minSubSectorId + 1);
249  int rollInBits = roll;
250 
251  id_ |= (regionInBits & RegionMask_) << RegionStartBit_ | (ringInBits & RingMask_) << RingStartBit_ |
252  (stationInBits & StationMask_) << StationStartBit_ | (sectorInBits & SectorMask_) << SectorStartBit_ |
253  (layerInBits & LayerMask_) << LayerStartBit_ | (subSectorInBits & SubSectorMask_) << SubSectorStartBit_ |
254  (rollInBits & RollMask_) << RollStartBit_;
255 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
static constexpr int RegionMask_
Definition: RPCDetId.h:138
static constexpr int minLayerId
Definition: RPCDetId.h:120
static constexpr unsigned int SectorMask_
Definition: RPCDetId.h:150
static constexpr unsigned int SubSectorMask_
Definition: RPCDetId.h:158
static constexpr int SectorStartBit_
Definition: RPCDetId.h:149
static constexpr int SubSectorStartBit_
Definition: RPCDetId.h:157
static constexpr int minRingForwardId
Definition: RPCDetId.h:104
static constexpr int minRingBarrelId
Definition: RPCDetId.h:106
static constexpr unsigned int StationMask_
Definition: RPCDetId.h:146
int ring() const
Definition: RPCDetId.h:59
static constexpr unsigned int LayerMask_
Definition: RPCDetId.h:154
static constexpr int maxSectorId
Definition: RPCDetId.h:114
static constexpr int maxRingBarrelId
Definition: RPCDetId.h:107
static constexpr int RollStartBit_
Definition: RPCDetId.h:161
static constexpr int minRegionId
Definition: RPCDetId.h:101
static constexpr int maxRollId
Definition: RPCDetId.h:131
static constexpr int minSubSectorId
Definition: RPCDetId.h:123
static constexpr int maxRingForwardId
Definition: RPCDetId.h:105
static constexpr int RingStartBit_
Definition: RPCDetId.h:141
static constexpr int StationStartBit_
Definition: RPCDetId.h:145
int roll() const
Definition: RPCDetId.h:92
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:88
static constexpr int LayerStartBit_
Definition: RPCDetId.h:153
static constexpr int minStationId
Definition: RPCDetId.h:110
static constexpr int minSectorId
Definition: RPCDetId.h:113
static constexpr int RingBarrelOffSet
Definition: RPCDetId.h:108
static constexpr int maxLayerId
Definition: RPCDetId.h:121
static constexpr int maxRegionId
Definition: RPCDetId.h:102
static constexpr int RegionStartBit_
Definition: RPCDetId.h:137
uint32_t id_
Definition: DetId.h:69
int station() const
Definition: RPCDetId.h:78
static constexpr unsigned int RollMask_
Definition: RPCDetId.h:162
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
static constexpr unsigned int RingMask_
Definition: RPCDetId.h:142
static constexpr int minRollId
Definition: RPCDetId.h:130
int layer() const
Definition: RPCDetId.h:85
static constexpr int maxSubSectorId
Definition: RPCDetId.h:124
static constexpr int maxStationId
Definition: RPCDetId.h:111

◆ layer()

int RPCDetId::layer ( ) const
inline

Layer id: each station can have two layers of chambers: layer 1 is the inner chamber and layer 2 is the outer chamber (when present) Only in Barrel: RB1 and RB2.

Definition at line 85 of file RPCDetId.h.

References DetId::id_, createfilelist::int, LayerMask_, LayerStartBit_, and minLayerId.

Referenced by OMTFinputMaker::acceptDigi(), RpcDigiToStubsConverterOmtf::acceptDigi(), RPCGeomServ::aclockwise(), RPCDigiValid::analyze(), L1MuonRecoTreeProducer::analyze(), RPCGeometryBuilderFromCondDB::build(), buildfromTrIndex(), RPCGeometryBuilder::buildGeometry(), RPCGeomServ::chambername(), RPCGeomServ::chambernr(), RPCIntegrator::createL1Phase2MuDTPhDigi(), rpcdqm::utils::detId2ChamberLabel(), rpcdqm::utils::detId2ChamberNr(), rpcdqm::utils::detId2RollNr(), getDetLayer(), OMTFConfiguration::getLayerNumber(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), init(), RPCNeutronWriter::localDetId(), RPCIntegrator::makeRPCOnlySegments(), RPCGeomServ::name(), operator<(), RPCDetId(), RPCtoDTTranslator::run(), IOPrinter::run(), and RPCGeomServ::shortname().

85 { return int((id_ >> LayerStartBit_) & LayerMask_) + minLayerId; }
static constexpr int minLayerId
Definition: RPCDetId.h:120
static constexpr unsigned int LayerMask_
Definition: RPCDetId.h:154
static constexpr int LayerStartBit_
Definition: RPCDetId.h:153
uint32_t id_
Definition: DetId.h:69

◆ operator<()

bool RPCDetId::operator< ( const RPCDetId r) const
inline

Sort Operator based on the raw detector id.

Definition at line 29 of file RPCDetId.h.

References layer(), alignCSCRings::r, DetId::rawId(), and station().

29  {
30  if (r.station() == this->station()) {
31  if (this->layer() == r.layer()) {
32  return this->rawId() < r.rawId();
33  } else {
34  return (this->layer() < r.layer());
35  }
36  } else {
37  return this->station() < r.station();
38  }
39  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int station() const
Definition: RPCDetId.h:78
int layer() const
Definition: RPCDetId.h:85

◆ region()

int RPCDetId::region ( ) const
inline

Region id: 0 for Barrel, +/-1 For +/- Endcap.

Definition at line 53 of file RPCDetId.h.

References DetId::id_, createfilelist::int, minRegionId, RegionMask_, and RegionStartBit_.

Referenced by OMTFinputMaker::acceptDigi(), RpcDigiToStubsConverterOmtf::acceptDigi(), RPCGeomServ::aclockwise(), L1TdeStage2CPPF::analyze(), RPCDigiValid::analyze(), L1TStage2CPPF::analyze(), RPCRecHitValid::analyze(), L1MuonRecoTreeProducer::analyze(), RPCMonitorDigi::bookHistograms(), RPCGeometryBuilderFromCondDB::build(), buildfromDB(), buildfromTrIndex(), RPCGeometryBuilder::buildGeometry(), L1TPhase2GMTEndcapStubProcessor::buildRPCOnlyStub(), RPCGeomServ::chambername(), RPCGeomServ::channelInChip(), RPCSeedPattern::checkSegment(), PrimitiveConversion::convert_rpc(), CSCObjectMap::CSCObjectMap(), rpcdqm::utils::detId2ChamberLabel(), rpcdqm::utils::detId2ChamberNr(), rpcdqm::utils::detId2RollNr(), DTObjectMap::DTObjectMap(), RPCGeomServ::eta_partition(), EMTFSubsystemCollector::extractPrimitives(), GlobalDigisAnalyzer::fillMuon(), RPCRecHitFilter::filter(), RPCNoise::filter(), OMTFConfiguration::getLayerNumber(), init(), RPCCosmicSeedrecHitFinder::iscorssEdge(), RPCGeomServ::name(), operator<<(), RPCIntegrator::prepareMetaPrimitives(), RecHitProcessor::process(), RecHitProcessor::processLook(), RPCDigiMerger::produce(), ring(), RPCHitCleaner::run(), RPCtoDTTranslator::run(), PrimitiveSelection::select_rpc(), RPCGeomServ::shortname(), RPCSimSimple::simulateNoise(), RPCSimParam::simulateNoise(), RPCSimAverage::simulateNoise(), RPCSimAverageNoise::simulateNoise(), RPCSimAverageNoiseEffCls::simulateNoise(), RPCSimAverageNoiseEff::simulateNoise(), RPCSimModelTiming::simulateNoise(), RPCSimAsymmetricCls::simulateNoise(), TracktoRPC::thePoints(), ValidateGeometry::validateRPCGeometry(), and RPCGeomServ::zpositive().

53 { return int((id_ >> RegionStartBit_) & RegionMask_) + minRegionId; }
static constexpr int RegionMask_
Definition: RPCDetId.h:138
static constexpr int minRegionId
Definition: RPCDetId.h:101
static constexpr int RegionStartBit_
Definition: RPCDetId.h:137
uint32_t id_
Definition: DetId.h:69

◆ ring()

int RPCDetId::ring ( ) const
inline

Ring id: Wheel number in Barrel (from -2 to +2) Ring Number in Endcap (from 1 to 3) Ring has a different meaning in Barrel and Endcap! In Barrel it is wheel, in Endcap it is the physical ring located on a disk (a disk contains three rings). In Endcap the ring is the group of chambers with same r (distance of beam axis) and increasing phi

Definition at line 59 of file RPCDetId.h.

References Exception, DetId::id_, createfilelist::int, minRingBarrelId, minRingForwardId, region(), sistrip::ring_, RingBarrelOffSet, RingMask_, and RingStartBit_.

Referenced by OMTFinputMaker::acceptDigi(), RpcDigiToStubsConverterOmtf::acceptDigi(), RPCGeomServ::aclockwise(), L1TdeStage2CPPF::analyze(), L1TStage2CPPF::analyze(), L1MuonRecoTreeProducer::analyze(), RPCMonitorDigi::bookHistograms(), RPCGeometryBuilderFromCondDB::build(), buildfromDB(), buildfromTrIndex(), RPCGeometryBuilder::buildGeometry(), L1TPhase2GMTEndcapStubProcessor::buildRPCOnlyStub(), RPCGeomServ::chambername(), PrimitiveConversion::convert_rpc(), RPCIntegrator::createL1Phase2MuDTPhDigi(), CSCObjectMap::CSCObjectMap(), rpcdqm::utils::detId2RollNr(), DTObjectMap::DTObjectMap(), RPCGeomServ::eta_partition(), EMTFSubsystemCollector::extractPrimitives(), GlobalDigisAnalyzer::fillMuon(), RPCRecHitFilter::filter(), geometryXMLparser.CSCAlignable::index(), init(), MuonRPCDetLayerGeometryBuilder::isFront(), RPCIntegrator::makeRPCOnlySegments(), RPCIntegrator::matchDTwithRPC(), RPCGeomServ::name(), operator<<(), RPCIntegrator::phiBending(), PrimitiveSelection::process(), RPCDigiMerger::produce(), RPCDetId(), RPCtoDTTranslator::run(), IOPrinter::run(), RPCGeomServ::segment(), PrimitiveSelection::select_rpc(), RPCGeomServ::shortname(), CSCSegtoRPC::thePoints(), TracktoRPC::thePoints(), and RPCGeomServ::zpositive().

59  {
60  int ring_ = (id_ >> RingStartBit_) & RingMask_;
61 
62  if (ring_ < RingBarrelOffSet) {
63  if (this->region() == 0) {
64  throw cms::Exception("InvalidDetId") << "RPCDetId ctor:"
65  << " Ring - Region Inconsistency, "
66  << " region " << this->region() << " ring " << ring_ << std::endl;
67  }
68 
69  return int(ring_ + minRingForwardId);
70 
71  } else { // if(ring_ >= RingBarrelOffSet)
73  }
74  }
static constexpr int minRingForwardId
Definition: RPCDetId.h:104
static constexpr int minRingBarrelId
Definition: RPCDetId.h:106
static const char ring_[]
static constexpr int RingStartBit_
Definition: RPCDetId.h:141
static constexpr int RingBarrelOffSet
Definition: RPCDetId.h:108
uint32_t id_
Definition: DetId.h:69
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
static constexpr unsigned int RingMask_
Definition: RPCDetId.h:142

◆ roll()

int RPCDetId::roll ( ) const
inline

Roll id (also known as eta partition): each chamber is divided along the strip direction in two or three parts (rolls) for Barrel and two, three or four parts for endcap

Definition at line 92 of file RPCDetId.h.

References DetId::id_, createfilelist::int, RollMask_, and RollStartBit_.

Referenced by OMTFinputMaker::acceptDigi(), RpcDigiToStubsConverterOmtf::acceptDigi(), L1TdeStage2CPPF::analyze(), L1MuonRecoTreeProducer::analyze(), buildfromDB(), buildfromTrIndex(), RPCGeomServ::chambernr(), PrimitiveConversion::convert_rpc(), rpcdqm::utils::detId2RollNr(), RPCGeomServ::eta_partition(), init(), RPCGeomServ::name(), RPCDetId(), RPCtoDTTranslator::run(), IOPrinter::run(), PrimitiveSelection::select_rpc(), and RPCGeomServ::shortname().

92  {
93  return int((id_ >> RollStartBit_) & RollMask_); // value 0 is used as wild card
94  }
static constexpr int RollStartBit_
Definition: RPCDetId.h:161
uint32_t id_
Definition: DetId.h:69
static constexpr unsigned int RollMask_
Definition: RPCDetId.h:162

◆ sector()

int RPCDetId::sector ( ) const
inline

Sector id: the group of chambers at same phi (and increasing r)

Definition at line 81 of file RPCDetId.h.

References DetId::id_, createfilelist::int, minSectorId, SectorMask_, and SectorStartBit_.

Referenced by OMTFinputMaker::acceptDigi(), RpcDigiToStubsConverterOmtf::acceptDigi(), RPCGeomServ::aclockwise(), L1TdeStage2CPPF::analyze(), L1TStage2CPPF::analyze(), L1MuonRecoTreeProducer::analyze(), RPCGeometryBuilderFromCondDB::build(), buildfromDB(), buildfromTrIndex(), RPCGeometryBuilder::buildGeometry(), L1TPhase2GMTEndcapStubProcessor::buildRPCOnlyStub(), MuonHitHelper::chamber(), RPCGeomServ::chambername(), RPCGeomServ::chambernr(), RPCGeomServ::channelInChip(), PrimitiveConversion::convert_rpc(), RPCIntegrator::createL1Phase2MuDTPhDigi(), rpcdqm::utils::detId2ChamberLabel(), rpcdqm::utils::detId2ChamberNr(), rpcdqm::utils::detId2RollNr(), DTObjectMap::DTObjectMap(), RPCRecHitFilter::filter(), geometryXMLparser.DTAlignable::index(), init(), MuonRPCDetLayerGeometryBuilder::isFront(), RPCIntegrator::makeRPCOnlySegments(), RPCIntegrator::matchDTwithRPC(), RPCGeomServ::name(), RPCIntegrator::phiBending(), RPCDetId(), RPCtoDTTranslator::run(), IOPrinter::run(), RPCGeomServ::segment(), PrimitiveSelection::select_rpc(), RPCGeomServ::shortname(), TracktoRPC::thePoints(), and RPCGeomServ::zpositive().

81 { return int((id_ >> SectorStartBit_) & SectorMask_) + (minSectorId + 1); }
static constexpr unsigned int SectorMask_
Definition: RPCDetId.h:150
static constexpr int SectorStartBit_
Definition: RPCDetId.h:149
static constexpr int minSectorId
Definition: RPCDetId.h:113
uint32_t id_
Definition: DetId.h:69

◆ station()

int RPCDetId::station ( ) const
inline

Station id : For Barrel: the four groups of chambers at same r (distance from beam axis) and increasing phi For Endcap: the three groups of chambers at same z (distance from interaction point), i.e. the disk

Definition at line 78 of file RPCDetId.h.

References DetId::id_, createfilelist::int, minStationId, StationMask_, and StationStartBit_.

Referenced by OMTFinputMaker::acceptDigi(), RpcDigiToStubsConverterOmtf::acceptDigi(), L1TdeStage2CPPF::analyze(), RPCDigiValid::analyze(), L1TStage2CPPF::analyze(), L1MuonRecoTreeProducer::analyze(), RPCChamberMasker::beginRun(), RPCMonitorDigi::bookHistograms(), RPCGeometryBuilderFromCondDB::build(), buildfromDB(), buildfromTrIndex(), RPCGeometryBuilder::buildGeometry(), L1TPhase2GMTEndcapStubProcessor::buildRPCOnlyStub(), reco::helper::JetMuonHitsIDHelper::calculate(), RPCGeomServ::chambername(), RPCGeomServ::chambernr(), RPCGeomServ::channelInChip(), RPCSeedPattern::checkSegment(), PrimitiveConversion::convert_rpc(), RPCIntegrator::createL1Phase2MuDTPhDigi(), CSCObjectMap::CSCObjectMap(), rpcdqm::utils::detId2ChamberLabel(), rpcdqm::utils::detId2ChamberNr(), rpcdqm::utils::detId2RollNr(), DTObjectMap::DTObjectMap(), EMTFSubsystemCollector::extractPrimitives(), RPCRecHitFilter::filter(), GlobalMuonRefitter::getFirstHits(), OMTFConfiguration::getLayerNumber(), GlobalMuonRefitter::getRidOfSelectStationHits(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), init(), MuonRPCDetLayerGeometryBuilder::isFront(), RPCIntegrator::makeRPCOnlySegments(), RPCIntegrator::matchDTwithRPC(), TrackTransformerForGlobalCosmicMuons::MuonKeep(), RPCGeomServ::name(), operator<(), operator<<(), RPCIntegrator::phiBending(), PrimitiveSelection::process(), RPCDigiMerger::produce(), RPCDetId(), RPCtoDTTranslator::run(), IOPrinter::run(), RPCGeomServ::segment(), PrimitiveSelection::select_rpc(), RPCGeomServ::shortname(), TAMuonChamberMatch::station(), reco::MuonChamberMatch::station(), CSCSegtoRPC::thePoints(), and TracktoRPC::thePoints().

78 { return int((id_ >> StationStartBit_) & StationMask_) + minStationId; }
static constexpr unsigned int StationMask_
Definition: RPCDetId.h:146
static constexpr int StationStartBit_
Definition: RPCDetId.h:145
static constexpr int minStationId
Definition: RPCDetId.h:110
uint32_t id_
Definition: DetId.h:69

◆ subsector()

int RPCDetId::subsector ( ) const
inline

◆ trIndex()

int RPCDetId::trIndex ( ) const
inline

Definition at line 96 of file RPCDetId.h.

References trind.

Referenced by buildfromDB(), buildfromTrIndex(), and L1TPhase2GMTEndcapStubProcessor::buildRPCOnlyStub().

96 { return trind; }
int trind
Definition: RPCDetId.h:170

Member Data Documentation

◆ chamberIdMask_

constexpr uint32_t RPCDetId::chamberIdMask_ = ~(RollMask_ << RollStartBit_)
static

Definition at line 165 of file RPCDetId.h.

Referenced by chamberId().

◆ LayerMask_

constexpr unsigned int RPCDetId::LayerMask_ = 0X1
staticprivate

Definition at line 154 of file RPCDetId.h.

Referenced by init(), and layer().

◆ LayerNumBits_

constexpr int RPCDetId::LayerNumBits_ = 1
staticprivate

Definition at line 152 of file RPCDetId.h.

◆ LayerStartBit_

constexpr int RPCDetId::LayerStartBit_ = SectorStartBit_ + SectorNumBits_
staticprivate

Definition at line 153 of file RPCDetId.h.

Referenced by init(), and layer().

◆ maxLayerId

constexpr int RPCDetId::maxLayerId = 2
static

◆ maxRegionId

constexpr int RPCDetId::maxRegionId = 1
static

Definition at line 102 of file RPCDetId.h.

Referenced by init().

◆ maxRingBarrelId

constexpr int RPCDetId::maxRingBarrelId = 2
static

Definition at line 107 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(), and init().

◆ maxRingForwardId

constexpr int RPCDetId::maxRingForwardId = 3
static

Definition at line 105 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildEndcapLayers(), and init().

◆ maxRollId

constexpr int RPCDetId::maxRollId = 5
static

◆ maxSectorBarrelId

constexpr int RPCDetId::maxSectorBarrelId = 12
static

Definition at line 116 of file RPCDetId.h.

◆ maxSectorForwardId

constexpr int RPCDetId::maxSectorForwardId = 6
static

Definition at line 118 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildLayer().

◆ maxSectorId

constexpr int RPCDetId::maxSectorId = 12
static

Definition at line 114 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(), and init().

◆ maxStationId

constexpr int RPCDetId::maxStationId = 4
static

◆ maxSubSectorBarrelId

constexpr int RPCDetId::maxSubSectorBarrelId = 4
static

Definition at line 126 of file RPCDetId.h.

◆ maxSubSectorForwardId

constexpr int RPCDetId::maxSubSectorForwardId = 6
static

Definition at line 128 of file RPCDetId.h.

◆ maxSubSectorId

constexpr int RPCDetId::maxSubSectorId = 6
static

Definition at line 124 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(), and init().

◆ minLayerId

constexpr int RPCDetId::minLayerId = 1
static

◆ minRegionId

constexpr int RPCDetId::minRegionId = -1
static

Definition at line 101 of file RPCDetId.h.

Referenced by init(), and region().

◆ minRingBarrelId

constexpr int RPCDetId::minRingBarrelId = -2
static

Definition at line 106 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(), init(), and ring().

◆ minRingForwardId

constexpr int RPCDetId::minRingForwardId = 1
static

Definition at line 104 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildEndcapLayers(), init(), and ring().

◆ minRollId

constexpr int RPCDetId::minRollId = 0
static

◆ minSectorBarrelId

constexpr int RPCDetId::minSectorBarrelId = 1
static

Definition at line 115 of file RPCDetId.h.

◆ minSectorForwardId

constexpr int RPCDetId::minSectorForwardId = 1
static

Definition at line 117 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildLayer().

◆ minSectorId

constexpr int RPCDetId::minSectorId = 0
static

Definition at line 113 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(), init(), and sector().

◆ minStationId

constexpr int RPCDetId::minStationId = 1
static

Definition at line 110 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(), init(), and station().

◆ minSubSectorBarrelId

constexpr int RPCDetId::minSubSectorBarrelId = 1
static

Definition at line 125 of file RPCDetId.h.

◆ minSubSectorForwardId

constexpr int RPCDetId::minSubSectorForwardId = 1
static

Definition at line 127 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildLayer().

◆ minSubSectorId

constexpr int RPCDetId::minSubSectorId = 0
static

Definition at line 123 of file RPCDetId.h.

Referenced by MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(), init(), and subsector().

◆ RegionMask_

constexpr int RPCDetId::RegionMask_ = 0X3
staticprivate

Definition at line 138 of file RPCDetId.h.

Referenced by init(), and region().

◆ RegionNumBits_

constexpr int RPCDetId::RegionNumBits_ = 2
staticprivate

Definition at line 136 of file RPCDetId.h.

◆ RegionStartBit_

constexpr int RPCDetId::RegionStartBit_ = 0
staticprivate

Definition at line 137 of file RPCDetId.h.

Referenced by init(), and region().

◆ RingBarrelOffSet

constexpr int RPCDetId::RingBarrelOffSet = 3
static

Definition at line 108 of file RPCDetId.h.

Referenced by init(), and ring().

◆ RingMask_

constexpr unsigned int RPCDetId::RingMask_ = 0X7
staticprivate

Definition at line 142 of file RPCDetId.h.

Referenced by init(), and ring().

◆ RingNumBits_

constexpr int RPCDetId::RingNumBits_ = 3
staticprivate

Definition at line 140 of file RPCDetId.h.

◆ RingStartBit_

constexpr int RPCDetId::RingStartBit_ = RegionStartBit_ + RegionNumBits_
staticprivate

Definition at line 141 of file RPCDetId.h.

Referenced by init(), and ring().

◆ RollMask_

constexpr unsigned int RPCDetId::RollMask_ = 0X7
staticprivate

Definition at line 162 of file RPCDetId.h.

Referenced by init(), and roll().

◆ RollNumBits_

constexpr int RPCDetId::RollNumBits_ = 3
staticprivate

Definition at line 160 of file RPCDetId.h.

◆ RollStartBit_

constexpr int RPCDetId::RollStartBit_ = SubSectorStartBit_ + SubSectorNumBits_
staticprivate

Definition at line 161 of file RPCDetId.h.

Referenced by init(), and roll().

◆ SectorMask_

constexpr unsigned int RPCDetId::SectorMask_ = 0XF
staticprivate

Definition at line 150 of file RPCDetId.h.

Referenced by init(), and sector().

◆ SectorNumBits_

constexpr int RPCDetId::SectorNumBits_ = 4
staticprivate

Definition at line 148 of file RPCDetId.h.

◆ SectorStartBit_

constexpr int RPCDetId::SectorStartBit_ = StationStartBit_ + StationNumBits_
staticprivate

Definition at line 149 of file RPCDetId.h.

Referenced by init(), and sector().

◆ StationMask_

constexpr unsigned int RPCDetId::StationMask_ = 0X3
staticprivate

Definition at line 146 of file RPCDetId.h.

Referenced by init(), and station().

◆ StationNumBits_

constexpr int RPCDetId::StationNumBits_ = 2
staticprivate

Definition at line 144 of file RPCDetId.h.

◆ StationStartBit_

constexpr int RPCDetId::StationStartBit_ = RingStartBit_ + RingNumBits_
staticprivate

Definition at line 145 of file RPCDetId.h.

Referenced by init(), and station().

◆ SubSectorMask_

constexpr unsigned int RPCDetId::SubSectorMask_ = 0X7
staticprivate

Definition at line 158 of file RPCDetId.h.

Referenced by init(), and subsector().

◆ SubSectorNumBits_

constexpr int RPCDetId::SubSectorNumBits_ = 3
staticprivate

Definition at line 156 of file RPCDetId.h.

◆ SubSectorStartBit_

constexpr int RPCDetId::SubSectorStartBit_ = LayerStartBit_ + LayerNumBits_
staticprivate

Definition at line 157 of file RPCDetId.h.

Referenced by init(), and subsector().

◆ trind

int RPCDetId::trind
private

Definition at line 170 of file RPCDetId.h.

Referenced by buildfromTrIndex(), and trIndex().