CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
RPCGeomServ Class Reference

#include <RPCGeomServ.h>

Public Member Functions

virtual bool aclockwise ()
 
virtual std::string chambername ()
 
virtual int chambernr ()
 
std::vector< int > channelInChip ()
 
virtual int eta_partition ()
 
virtual bool inverted ()
 
virtual std::string name ()
 
 RPCGeomServ (const RPCDetId &id)
 
virtual int segment ()
 
virtual std::string shortname ()
 
virtual bool zpositive ()
 
virtual ~RPCGeomServ ()
 

Protected Member Functions

 RPCGeomServ ()
 

Protected Attributes

bool _a
 
std::string _cn
 
int _cnr
 
const RPCDetId_id
 
std::string _n
 
std::string _sn
 
int _t
 
bool _z
 

Detailed Description

Definition at line 8 of file RPCGeomServ.h.

Constructor & Destructor Documentation

◆ RPCGeomServ() [1/2]

RPCGeomServ::RPCGeomServ ( const RPCDetId id)

◆ ~RPCGeomServ()

RPCGeomServ::~RPCGeomServ ( void  )
virtual

Definition at line 9 of file RPCGeomServ.cc.

9 {}

◆ RPCGeomServ() [2/2]

RPCGeomServ::RPCGeomServ ( )
protected

Definition at line 415 of file RPCGeomServ.cc.

415 : _id(nullptr), _n(""), _sn(""), _cn(""), _t(-99), _z(false), _a(false) {}

Member Function Documentation

◆ aclockwise()

bool RPCGeomServ::aclockwise ( )
virtual

Definition at line 391 of file RPCGeomServ.cc.

391  {
392  if (_id->region() == 0 && _t < -90) {
393  if (_id->ring() > 0) {
394  if (_id->layer() == 2) {
395  _a = false;
396  }
397  } else if (_id->ring() < 0) {
398  if (_id->layer() == 1) {
399  _a = false;
400  }
401  } else if (_id->ring() == 0) {
402  if ((_id->sector() == 1 || _id->sector() == 4 || _id->sector() == 5 || _id->sector() == 8 || _id->sector() == 9 ||
403  _id->sector() == 12) &&
404  _id->layer() == 1)
405  _a = false;
406  else if ((_id->sector() == 2 || _id->sector() == 3 || _id->sector() == 6 || _id->sector() == 7 ||
407  _id->sector() == 10 || _id->sector() == 11) &&
408  _id->layer() == 2)
409  _a = false;
410  }
411  }
412  return _a;
413 }

References _a, _id, _t, RPCDetId::layer(), RPCDetId::region(), RPCDetId::ring(), and RPCDetId::sector().

◆ chambername()

std::string RPCGeomServ::chambername ( )
virtual

Definition at line 89 of file RPCGeomServ.cc.

89  {
90  if (_cn.empty()) {
91  int station = _id->station();
92  int region = _id->region();
93  int ring = _id->ring();
94  int layer = _id->layer();
95  int sector = _id->sector();
96  int subsector = _id->subsector();
97 
98  std::stringstream os;
99 
100  if (region == 0) {
101  os << "W";
102 
103  os << std::setw(2) << std::setfill('+') << ring << std::setfill(' ') << "_";
104 
105  os << "RB" << station;
106  if (station <= 2) {
107  (layer == 1) ? os << "in" : os << "out";
108 
109  } else if (station > 2) {
110  if (sector == 4 && station == 4) {
111  if (subsector == 1) {
112  os << "--";
113  } else if (subsector == 2) {
114  os << "-";
115  } else if (subsector == 3) {
116  os << "+";
117  } else if (subsector == 4) {
118  os << "++";
119  }
120  }
121 
122  if (station == 3) {
123  if (subsector == 1)
124  os << "-";
125  else
126  os << "+";
127  } else if (station == 4 && sector != 9 && sector != 11 && sector != 4) {
128  if (subsector == 1)
129  os << "-";
130  else
131  os << "+";
132  }
133  }
134 
135  os << "_";
136  os << "S" << std::setw(2) << std::setfill('0') << sector << std::setfill(' ');
137  } else {
138  os << "RE";
139 
140  os << std::setw(2) << std::setfill('+') << station * region << std::setfill(' ') << "_";
141 
142  os << "R" << ring;
143  os << "_CH" << std::setw(2) << std::setfill('0') << this->segment();
144  }
145  _cn = os.str();
146  }
147  return _cn;
148 }

References _cn, _id, RPCDetId::layer(), phase1PixelTopology::layer, RPCDetId::region(), HLT_FULL_cff::region, RPCDetId::ring(), relativeConstraints::ring, RPCDetId::sector(), segment(), relativeConstraints::station, RPCDetId::station(), and RPCDetId::subsector().

◆ chambernr()

int RPCGeomServ::chambernr ( )
virtual

Definition at line 245 of file RPCGeomServ.cc.

245  {
246  // Station1
247  if (_id->station() == 1) {
248  // in
249  if (_id->layer() == 1) {
250  if (_id->roll() == 1)
251  _cnr = 1;
252  else
253  _cnr = 2;
254  }
255  //out
256  else {
257  if (_id->roll() == 1)
258  _cnr = 3;
259  else
260  _cnr = 4;
261  }
262  }
263 
264  //Station 2
265  if (_id->station() == 2) {
266  //in
267  if (_id->layer() == 1) {
268  if (_id->roll() == 1) //backward
269  _cnr = 5;
270  if (_id->roll() == 3) //forward
271  _cnr = 6;
272  if (_id->roll() == 2) //middle
273  _cnr = 7;
274  }
275  //out
276  else {
277  if (_id->roll() == 2)
278 
279  _cnr = 7;
280 
281  if (_id->roll() == 1)
282  _cnr = 8;
283  if (_id->roll() == 3)
284  _cnr = 9;
285  }
286  }
287 
288  //RB3- RB3+
289  if (_id->station() == 3) {
290  if (_id->subsector() == 1) {
291  if (_id->roll() == 1)
292  _cnr = 10;
293  else
294  _cnr = 11;
295  } else {
296  if (_id->roll() == 1)
297  _cnr = 12;
298  else
299  _cnr = 13;
300  }
301  }
302 
303  //RB4
304  if (_id->station() == 4) {
305  if (_id->sector() == 4) {
306  if (_id->subsector() == 2) { //RB4-
307 
308  if (_id->roll() == 1)
309  _cnr = 14;
310  else
311  _cnr = 15;
312  }
313 
314  if (_id->subsector() == 3) { //RB4+
315 
316  if (_id->roll() == 1)
317  _cnr = 16;
318  else
319  _cnr = 17;
320  }
321 
322  if (_id->subsector() == 1) { //RB4--
323 
324  if (_id->roll() == 1)
325  _cnr = 18;
326  else
327  _cnr = 19;
328  }
329 
330  if (_id->subsector() == 4) { //RB4++
331 
332  if (_id->roll() == 1)
333  _cnr = 20;
334  else
335  _cnr = 21;
336  }
337 
338  }
339 
340  else
341 
342  {
343  if (_id->subsector() == 1) {
344  if (_id->roll() == 1)
345  _cnr = 14;
346  else
347  _cnr = 15;
348  } else {
349  if (_id->roll() == 1)
350  _cnr = 16;
351  else
352  _cnr = 17;
353  }
354  }
355  }
356 
357  // _cnr=10;
358  return _cnr;
359 }

References _cnr, _id, RPCDetId::layer(), RPCDetId::roll(), RPCDetId::sector(), RPCDetId::station(), and RPCDetId::subsector().

◆ channelInChip()

std::vector< int > RPCGeomServ::channelInChip ( void  )

Definition at line 200 of file RPCGeomServ.cc.

200  {
201  std::vector<int> chipCh(4, 8); //Endcap
202 
203  if (_id->region() == 0) { //Barrel
204  chipCh.clear();
205 
206  int station = _id->station();
207 
208  if (station < 3 && _id->layer() == 1) { // i.e. RB1in ||RB2in
209  chipCh.emplace_back(7);
210  chipCh.emplace_back(8);
211  } else if (station == 1 || station == 3) { //i.e. RB1out || RB3
212  chipCh.emplace_back(7);
213  chipCh.emplace_back(7);
214  } else if (station == 2) { // i.e. RB2out
215  chipCh.emplace_back(6);
216  chipCh.emplace_back(8);
217  } else if (_id->sector() == 4 || _id->sector() == 10 || (_id->sector() == 8 && _id->subsector() != 1) ||
218  (_id->sector() == 12 && _id->subsector() == 1)) {
219  chipCh.emplace_back(6); //i.e. Sector 4 & 10 RB4 and Sector 8 &12 RB4+
220  chipCh.emplace_back(6);
221  } else {
222  chipCh.emplace_back(8);
223  chipCh.emplace_back(8);
224  }
225  }
226 
227  return chipCh;
228 }

References _id, phase1PixelTopology::layer, RPCDetId::region(), RPCDetId::sector(), relativeConstraints::station, RPCDetId::station(), and RPCDetId::subsector().

◆ eta_partition()

int RPCGeomServ::eta_partition ( )
virtual

Definition at line 230 of file RPCGeomServ.cc.

230  {
231  if (_t < -90) {
232  if (_id->region() == 0) {
233  if (this->inverted()) {
234  _t = 3 * (_id->ring()) + (3 - _id->roll()) - 1;
235  } else {
236  _t = 3 * (_id->ring()) + _id->roll() - 2;
237  }
238  } else {
239  _t = _id->region() * (3 * (3 - _id->ring()) + _id->roll() + 7);
240  }
241  }
242  return _t;
243 }

References _id, _t, inverted(), RPCDetId::region(), RPCDetId::ring(), and RPCDetId::roll().

Referenced by RPCStripsRing::getRingId(), and RPCStripsRing::RPCStripsRing().

◆ inverted()

bool RPCGeomServ::inverted ( )
virtual

Definition at line 370 of file RPCGeomServ.cc.

370  {
371  // return !(this->zpositive() && this->aclockwise());
372  return !(this->zpositive());
373 }

References zpositive().

Referenced by eta_partition().

◆ name()

std::string RPCGeomServ::name ( void  )
virtual

Definition at line 11 of file RPCGeomServ.cc.

11  {
12  if (_n.empty()) {
13  int station = _id->station();
14  int region = _id->region();
15  int roll = _id->roll();
16  int ring = _id->ring();
17  int layer = _id->layer();
18  int sector = _id->sector();
19  int subsector = _id->subsector();
20 
21  std::stringstream os;
22 
23  if (region == 0) {
24  os << "W";
25  os << std::setw(2) << std::setfill('+') << ring << std::setfill(' ') << "_";
26 
27  os << "RB" << station;
28  if (station <= 2) {
29  (layer == 1) ? os << "in" : os << "out";
30 
31  } else if (station > 2) {
32  if (sector == 4 && station == 4) {
33  if (subsector == 1) {
34  os << "--";
35  } else if (subsector == 2) {
36  os << "-";
37  } else if (subsector == 3) {
38  os << "+";
39  } else if (subsector == 4) {
40  os << "++";
41  }
42  }
43 
44  if (station == 3) {
45  if (subsector == 1)
46  os << "-";
47  else
48  os << "+";
49  } else if (station == 4 && sector != 9 && sector != 11 && sector != 4) {
50  if (subsector == 1)
51  os << "-";
52  else
53  os << "+";
54  }
55  }
56 
57  os << "_";
58  os << "S" << std::setw(2) << std::setfill('0') << sector << std::setfill(' ');
59  if (roll == 1)
60  os << "_Backward";
61  else if (roll == 3)
62  os << "_Forward";
63  else if (roll == 2)
64  os << "_Middle";
65  } else {
66  os << "RE";
67 
68  os << std::setw(2) << std::setfill('+') << station * region << std::setfill(' ') << "_";
69 
70  os << "R" << ring;
71  os << "_CH" << std::setw(2) << std::setfill('0') << this->segment();
72 
73  if (roll == 1)
74  os << "_A";
75  else if (roll == 2)
76  os << "_B";
77  else if (roll == 3)
78  os << "_C";
79  else if (roll == 4)
80  os << "_D";
81  else if (roll == 5)
82  os << "_E";
83  }
84  _n = os.str();
85  }
86  return _n;
87 }

References _id, _n, RPCDetId::layer(), phase1PixelTopology::layer, RPCDetId::region(), HLT_FULL_cff::region, RPCDetId::ring(), relativeConstraints::ring, RPCDetId::roll(), RPCDetId::sector(), segment(), relativeConstraints::station, RPCDetId::station(), and RPCDetId::subsector().

Referenced by config.CFG::__str__(), validation.Sample::digest(), VIDSelectorBase.VIDSelectorBase::initialize(), RPCSimAverageNoiseEff::simulate(), RPCSimAsymmetricCls::simulate(), RPCSimAverageNoiseEff::simulateNoise(), RPCSimAsymmetricCls::simulateNoise(), DTSegtoRPC::thePoints(), and TracktoRPC::thePoints().

◆ segment()

int RPCGeomServ::segment ( void  )
virtual

◆ shortname()

std::string RPCGeomServ::shortname ( void  )
virtual

Definition at line 150 of file RPCGeomServ.cc.

150  {
151  if (_sn.empty()) {
152  int station = _id->station();
153  int region = _id->region();
154  int roll = _id->roll();
155  int ring = _id->ring();
156  int layer = _id->layer();
157  int sector = _id->sector();
158  int subsector = _id->subsector();
159 
160  std::stringstream os;
161 
162  if (region == 0) {
163  os << "RB" << station;
164  if (station <= 2) {
165  (layer == 1) ? os << "in" : os << "out";
166 
167  } else {
168  if (sector == 4 && station == 4) {
169  if (subsector == 1) {
170  os << "--";
171  } else if (subsector == 2) {
172  os << ",-";
173  } else if (subsector == 3) {
174  os << "+";
175  } else if (subsector == 4) {
176  os << "++";
177  }
178  } else {
179  if (subsector == 1)
180  os << ",-";
181  else
182  os << "+";
183  }
184  }
185  if (roll == 1)
186  os << " B";
187  else if (roll == 3)
188  os << " F";
189  else if (roll == 2)
190  os << " M";
191  } else {
192  os << "Ri" << ring << " Su" << subsector;
193  }
194  _sn = os.str();
195  }
196  return _sn;
197 }

References _id, _sn, RPCDetId::layer(), phase1PixelTopology::layer, RPCDetId::region(), HLT_FULL_cff::region, RPCDetId::ring(), relativeConstraints::ring, RPCDetId::roll(), RPCDetId::sector(), relativeConstraints::station, RPCDetId::station(), and RPCDetId::subsector().

◆ zpositive()

bool RPCGeomServ::zpositive ( )
virtual

Definition at line 375 of file RPCGeomServ.cc.

375  {
376  if (_id->region() == 0 && _t < -90) {
377  if (_id->ring() < 0) {
378  _z = false;
379  }
380  if (_id->ring() == 0) {
381  if (_id->sector() == 1 || _id->sector() == 4 || _id->sector() == 5 || _id->sector() == 8 || _id->sector() == 9 ||
382  _id->sector() == 12) {
383  _z = false;
384  }
385  }
386  }
387 
388  return _z;
389 }

References _id, _t, _z, RPCDetId::region(), RPCDetId::ring(), and RPCDetId::sector().

Referenced by inverted().

Member Data Documentation

◆ _a

bool RPCGeomServ::_a
protected

Definition at line 34 of file RPCGeomServ.h.

Referenced by aclockwise().

◆ _cn

std::string RPCGeomServ::_cn
protected

Definition at line 30 of file RPCGeomServ.h.

Referenced by chambername().

◆ _cnr

int RPCGeomServ::_cnr
protected

Definition at line 32 of file RPCGeomServ.h.

Referenced by chambernr().

◆ _id

const RPCDetId* RPCGeomServ::_id
protected

◆ _n

std::string RPCGeomServ::_n
protected

Definition at line 28 of file RPCGeomServ.h.

Referenced by name().

◆ _sn

std::string RPCGeomServ::_sn
protected

Definition at line 29 of file RPCGeomServ.h.

Referenced by shortname().

◆ _t

int RPCGeomServ::_t
protected

Definition at line 31 of file RPCGeomServ.h.

Referenced by aclockwise(), eta_partition(), and zpositive().

◆ _z

bool RPCGeomServ::_z
protected

Definition at line 33 of file RPCGeomServ.h.

Referenced by zpositive().

RPCGeomServ::_a
bool _a
Definition: RPCGeomServ.h:34
RPCDetId::station
int station() const
Definition: RPCDetId.h:78
RPCDetId::region
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
RPCDetId::subsector
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
relativeConstraints.station
station
Definition: relativeConstraints.py:67
RPCGeomServ::_sn
std::string _sn
Definition: RPCGeomServ.h:29
RPCGeomServ::_n
std::string _n
Definition: RPCGeomServ.h:28
nsub
const int nsub
Definition: CMTRawAnalyzer.h:421
RPCGeomServ::_cnr
int _cnr
Definition: RPCGeomServ.h:32
RPCGeomServ::_z
bool _z
Definition: RPCGeomServ.h:33
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
RPCDetId::roll
int roll() const
Definition: RPCDetId.h:92
RPCGeomServ::_t
int _t
Definition: RPCGeomServ.h:31
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88286
RPCDetId::ring
int ring() const
Definition: RPCDetId.h:59
RPCGeomServ::segment
virtual int segment()
Definition: RPCGeomServ.cc:361
RPCGeomServ::zpositive
virtual bool zpositive()
Definition: RPCGeomServ.cc:375
RPCGeomServ::inverted
virtual bool inverted()
Definition: RPCGeomServ.cc:370
RPCDetId::sector
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
RPCGeomServ::_cn
std::string _cn
Definition: RPCGeomServ.h:30
RPCDetId::layer
int layer() const
Definition: RPCDetId.h:85
RPCGeomServ::_id
const RPCDetId * _id
Definition: RPCGeomServ.h:27