test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::RPCGeomServ ( const RPCDetId id)
RPCGeomServ::~RPCGeomServ ( void  )
virtual

Definition at line 16 of file RPCGeomServ.cc.

17 {}
RPCGeomServ::RPCGeomServ ( )
protected

Definition at line 530 of file RPCGeomServ.cc.

530  : _id(0), _n(""), _sn(""), _cn(""), _t (-99), _z(false), _a(false)
531 {}
std::string _sn
Definition: RPCGeomServ.h:29
std::string _n
Definition: RPCGeomServ.h:28
std::string _cn
Definition: RPCGeomServ.h:30
const RPCDetId * _id
Definition: RPCGeomServ.h:27

Member Function Documentation

bool RPCGeomServ::aclockwise ( )
virtual

Definition at line 505 of file RPCGeomServ.cc.

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

506 {
507  if (_id->region()==0 && _t<-90 ){
508  if (_id->ring() > 0){
509  if (_id->layer()==2){
510  _a=false;
511  }
512  }else if(_id->ring() <0){
513  if (_id->layer()==1){
514  _a=false;
515  }
516  }else if(_id->ring() ==0) {
517  if ((_id->sector() == 1 || _id->sector() == 4 ||
518  _id->sector() == 5 || _id->sector() == 8 ||
519  _id->sector() == 9 || _id->sector() == 12) && _id->layer()==1)
520  _a=false;
521  else if ((_id->sector() == 2 || _id->sector() == 3 ||
522  _id->sector() == 6 || _id->sector() == 7 ||
523  _id->sector() == 10|| _id->sector() == 11) && _id->layer()==2)
524  _a=false;
525  }
526  }
527  return _a;
528 }
int ring() const
Definition: RPCDetId.h:72
int layer() const
Definition: RPCDetId.h:108
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
std::string RPCGeomServ::chambername ( )
virtual

Definition at line 120 of file RPCGeomServ.cc.

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

Referenced by RPCMonitorDigi::bookHistograms(), RPCMonitorDigi::bookRollME(), RPCDqmClient::getMonitorElements(), and RPCMonitorDigi::performSourceOperation().

121 {
122  if( _cn.size() < 1 )
123  {
124  int station = _id->station();
125  int region = _id->region();
126  int ring = _id->ring();
127  int layer = _id->layer();
128  int sector = _id->sector();
129  int subsector = _id->subsector();
130 
131  std::stringstream os;
132 
133  if( region == 0 )
134  {
135  os << "W";
136 
137  os << std::setw(2) << std::setfill('+') << ring
138  << std::setfill(' ') << "_";
139 
140  os << "RB" << station;
141  if ( station <= 2 ) {
142 
143  (layer == 1 ) ? os << "in" : os << "out";
144 
145  }else if( station > 2 )
146  {
147  if( sector == 4 && station == 4 )
148  {
149  if( subsector == 1 )
150  {
151  os << "--";
152  }
153  else if( subsector == 2 )
154  {
155  os << "-";
156  }
157  else if( subsector == 3 )
158  {
159  os << "+";
160  }
161  else if( subsector == 4 )
162  {
163  os <<"++";
164  }
165  }
166 
167  if( station == 3 )
168  {
169  if( subsector == 1 )
170  os << "-";
171  else
172  os << "+";
173  }
174  else if( station == 4
175  && sector != 9
176  && sector != 11
177  && sector != 4 )
178  {
179  if( subsector == 1 )
180  os << "-";
181  else
182  os << "+";
183  }
184  }
185 
186  os << "_";
187  os << "S" << std::setw(2) << std::setfill('0')
188  << sector << std::setfill(' ');
189  }
190  else
191  {
192  os << "RE";
193 
194  os << std::setw(2) << std::setfill('+') << station * region
195  << std::setfill(' ') << "_";
196 
197  os << "R" << ring;
198  os << "_CH" << std::setw(2) << std::setfill('0') << this->segment();
199  }
200  _cn = os.str();
201  }
202  return _cn;
203 }
int ring() const
Definition: RPCDetId.h:72
int layer() const
Definition: RPCDetId.h:108
virtual int segment()
Definition: RPCGeomServ.cc:467
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
std::string _cn
Definition: RPCGeomServ.h:30
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:114
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
int RPCGeomServ::chambernr ( )
virtual

Definition at line 324 of file RPCGeomServ.cc.

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

Referenced by RPCMon_SS_Dbx_Global::analyze().

325 {
326 
327  // Station1
328  if( _id->station() ==1) {
329 
330  // in
331  if(_id->layer() ==1) {
332 
333  if(_id->roll()==1)
334  _cnr = 1;
335  else
336  _cnr = 2;
337  }
338  //out
339  else
340  {
341  if(_id->roll()==1)
342  _cnr = 3;
343  else
344  _cnr = 4;
345 
346  }
347  }
348 
349 
350  //Station 2
351  if (_id->station()==2) {
352 
353  //in
354  if(_id->layer()==1) {
355 
356  if(_id->roll()==1)//backward
357  _cnr = 5;
358  if(_id->roll()==3)//forward
359  _cnr=6;
360  if(_id->roll()==2)//middle
361  _cnr=7;
362  }
363  //out
364  else {
365 
366  if(_id->roll()==2)
367 
368  _cnr=7;
369 
370  if(_id->roll()==1)
371  _cnr=8;
372  if(_id->roll()==3)
373  _cnr=9;
374 
375  }
376  }
377 
378  //RB3- RB3+
379  if(_id->station()==3)
380  {
381  if(_id->subsector()==1) {
382 
383  if(_id->roll()==1)
384  _cnr=10;
385  else
386  _cnr=11;
387  }
388  else {
389 
390  if(_id->roll()==1)
391  _cnr=12;
392  else
393  _cnr=13;
394  }
395 
396  }
397 
398  //RB4
399  if(_id->station()==4) {
400 
401  if (_id->sector()== 4) {
402 
403  if ( _id->subsector()==2){//RB4-
404 
405  if(_id->roll()==1)
406  _cnr=14;
407  else
408  _cnr=15;
409 
410  }
411 
412  if ( _id->subsector()==3){//RB4+
413 
414  if(_id->roll()==1)
415  _cnr=16;
416  else
417  _cnr=17;
418 
419  }
420 
421  if ( _id->subsector()==1) {//RB4--
422 
423  if(_id->roll()==1)
424  _cnr=18;
425  else
426  _cnr=19;
427  }
428 
429  if ( _id->subsector()==4){//RB4++
430 
431  if(_id->roll()==1)
432  _cnr=20;
433  else
434  _cnr=21;
435 
436  }
437 
438  }
439 
440  else
441 
442  {
443  if(_id->subsector()==1) {
444 
445  if(_id->roll()==1)
446  _cnr=14;
447  else
448  _cnr=15;
449  }
450  else {
451 
452  if(_id->roll()==1)
453  _cnr=16;
454  else
455  _cnr=17;
456  }
457  }
458  }
459 
460 
461  // _cnr=10;
462  return _cnr;
463 
464 }
int roll() const
Definition: RPCDetId.h:120
int layer() const
Definition: RPCDetId.h:108
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:114
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int station() const
Definition: RPCDetId.h:96
std::vector< int > RPCGeomServ::channelInChip ( void  )

Definition at line 275 of file RPCGeomServ.cc.

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

276 {
277  std::vector<int> chipCh(4,8);//Endcap
278 
279  if(_id->region()==0){//Barrel
280  chipCh.clear();
281 
282  int station = _id->station();
283 
284  if (station<3 && _id->layer()==1){ // i.e. RB1in ||RB2in
285  chipCh.push_back(7);
286  chipCh.push_back(8);
287  }else if (station == 1 || station == 3){//i.e. RB1out || RB3
288  chipCh.push_back(7);
289  chipCh.push_back(7);
290  }else if (station == 2){// i.e. RB2out
291  chipCh.push_back(6);
292  chipCh.push_back(8);
293  }else if (_id->sector() == 4 || _id->sector()==10 ||(_id->sector() == 8 && _id->subsector()!=1) || (_id->sector() == 12 && _id->subsector()==1)){
294  chipCh.push_back(6);//i.e. Sector 4 & 10 RB4 and Sector 8 &12 RB4+
295  chipCh.push_back(6);
296  }else {
297  chipCh.push_back(8);
298  chipCh.push_back(8);
299  }
300  }
301 
302  return chipCh;
303 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:114
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
int RPCGeomServ::eta_partition ( )
virtual

Definition at line 307 of file RPCGeomServ.cc.

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

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

308 {
309  if (_t<-90){
310  if (_id->region() == 0 ){
311  if (this->inverted()) {
312  _t = 3*(_id->ring())+ (3-_id->roll())-1;
313  }else{
314  _t = 3*(_id->ring())+ _id->roll()-2;
315  }
316  }else{
317  _t = _id->region() * (3*(3-_id->ring()) + _id->roll() + 7);
318  }
319  }
320  return _t;
321 }
int roll() const
Definition: RPCDetId.h:120
int ring() const
Definition: RPCDetId.h:72
virtual bool inverted()
Definition: RPCGeomServ.cc:478
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
bool RPCGeomServ::inverted ( )
virtual

Definition at line 478 of file RPCGeomServ.cc.

References zpositive().

Referenced by eta_partition().

479 {
480  // return !(this->zpositive() && this->aclockwise());
481  return !(this->zpositive());
482 }
virtual bool zpositive()
Definition: RPCGeomServ.cc:486
std::string RPCGeomServ::name ( void  )
virtual

Definition at line 20 of file RPCGeomServ.cc.

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

Referenced by cuy.divideElement::__init__(), cuy.plotElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), cuy.graphElement::__init__(), RPCMon_SS_Dbx_Global::analyze(), RPCDBPopConAnalyzer::analyze(), RPCEfficiency::analyze(), RPCEfficiencySecond::bookDetUnitSeg(), RPCMonitorDigi::bookHistograms(), RPCMonitorDigi::bookRollME(), DTSegtoRPC::DTSegtoRPC(), RPCEfficiencySecond::endRun(), rpcdqmclient::clientTools::getMEs(), RPCDqmClient::getMonitorElements(), L1TRPCTPG::L1TRPCBookME(), HSCPValidator::makeSimDigiPlotsRPC(), RPCMonitorDigi::performSourceOperation(), cond::PayLoadInspector< DataT >::plot(), RPCSimAsymmetricCls::simulate(), RPCSimAverageNoiseEff::simulate(), RPCSimAverageNoiseEff::simulateNoise(), RPCSimAsymmetricCls::simulateNoise(), cond::PayLoadInspector< DataT >::summary(), and TracktoRPC::TracktoRPC().

21 {
22  if( _n.size() < 1 )
23  {
24  int station = _id->station();
25  int region = _id->region();
26  int roll = _id->roll();
27  int ring = _id->ring();
28  int layer = _id->layer();
29  int sector = _id->sector();
30  int subsector = _id->subsector();
31 
32  std::stringstream os;
33 
34  if( region == 0 )
35  {
36  os << "W";
37  os << std::setw(2) << std::setfill('+') << ring
38  << std::setfill(' ') << "_";
39 
40  os << "RB" << station;
41  if ( station <= 2){
42  (layer == 1 ) ? os << "in" : os << "out";
43 
44  }else if( station > 2 )
45  {
46  if( sector == 4 && station == 4 )
47  {
48  if( subsector == 1 )
49  {
50  os << "--";
51  }
52  else if( subsector == 2 )
53  {
54  os << "-";
55  }
56  else if( subsector == 3 )
57  {
58  os << "+";
59  }
60  else if( subsector == 4 )
61  {
62  os << "++";
63  }
64  }
65 
66  if( station == 3 )
67  {
68  if( subsector == 1 )
69  os << "-";
70  else
71  os << "+";
72  }
73  else if( station == 4
74  && sector != 9
75  && sector !=11
76  && sector != 4 )
77  {
78  if( subsector == 1 )
79  os << "-";
80  else
81  os << "+";
82  }
83  }
84 
85  os << "_";
86  os << "S" << std::setw(2) << std::setfill('0')
87  << sector << std::setfill(' ');
88  if( roll == 1 )
89  os << "_Backward";
90  else if( roll == 3 )
91  os << "_Forward";
92  else if( roll == 2 )
93  os << "_Middle";
94  }
95  else
96  {
97  os << "RE";
98 
99  os << std::setw(2) << std::setfill('+') << station * region
100  << std::setfill(' ') << "_";
101 
102  os << "R" << ring;
103  os << "_CH" << std::setw(2) << std::setfill('0') << this->segment();
104 
105  if( roll == 1 )
106  os << "_A";
107  else if( roll == 2 )
108  os << "_B";
109  else if( roll == 3 )
110  os << "_C";
111  else if( roll == 4 )
112  os << "_D";
113  }
114  _n = os.str();
115  }
116  return _n;
117 }
std::string _n
Definition: RPCGeomServ.h:28
int roll() const
Definition: RPCDetId.h:120
int ring() const
Definition: RPCDetId.h:72
int layer() const
Definition: RPCDetId.h:108
virtual int segment()
Definition: RPCGeomServ.cc:467
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:114
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
int RPCGeomServ::segment ( void  )
virtual

Definition at line 467 of file RPCGeomServ.cc.

References _id, relativeConstraints::ring, RPCDetId::ring(), RPCDetId::sector(), relativeConstraints::station, RPCDetId::station(), and RPCDetId::subsector().

Referenced by RPCMon_SS_Dbx_Global::analyze(), RPCDBPopConAnalyzer::analyze(), RPCEfficiency::bookHistograms(), chambername(), RPCClusterSizeTest::clientOperation(), RPCDeadChannelTest::clientOperation(), CSCSegtoRPC::CSCSegtoRPC(), RPCEfficiencySecond::endRun(), RPCNoisyStripTest::fillGlobalME(), RPCOccupancyTest::fillGlobalME(), RPCMultiplicityTest::fillGlobalME(), name(), ObjectMap2CSC::ObjectMap2CSC(), ObjectMapCSC::ObjectMapCSC(), RPCMonitorDigi::performSourceOperation(), and TracktoRPC::TracktoRPC().

468 {
469  int nsub = 6;
470  int station = _id->station();
471  int ring = _id->ring();
472  ( ring == 1 && station > 1 ) ? nsub = 3 : nsub = 6;
473 
474  return( _id->subsector() + nsub * ( _id->sector() - 1 ));
475 }
int ring() const
Definition: RPCDetId.h:72
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:114
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int station() const
Definition: RPCDetId.h:96
std::string RPCGeomServ::shortname ( void  )
virtual

Definition at line 206 of file RPCGeomServ.cc.

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

Referenced by RPCEfficiencySecond::endRun().

207 {
208  if( _sn.size() < 1 )
209  {
210  int station = _id->station();
211  int region = _id->region();
212  int roll = _id->roll();
213  int ring = _id->ring();
214  int layer = _id->layer();
215  int sector = _id->sector();
216  int subsector = _id->subsector();
217 
218  std::stringstream os;
219 
220  if( region == 0 )
221  {
222  os << "RB" << station;
223  if( station <= 2 ){
224 
225  (layer == 1 ) ? os << "in" : os << "out";
226 
227  }
228  else
229  {
230  if( sector == 4 && station == 4 )
231  {
232  if( subsector == 1 )
233  {
234  os << "--";
235  }
236  else if( subsector == 2 )
237  {
238  os << ",-";
239  }
240  else if( subsector == 3 )
241  {
242  os << "+";
243  }
244  else if( subsector == 4 )
245  {
246  os << "++";
247  }
248  }
249  else
250  {
251  if( subsector == 1 )
252  os << ",-";
253  else
254  os << "+";
255  }
256  }
257  if( roll == 1 )
258  os << " B";
259  else if( roll == 3 )
260  os << " F";
261  else if( roll == 2 )
262  os << " M";
263  }
264  else
265  {
266  os << "Ri" << ring << " Su" << subsector;
267  }
268  _sn = os.str();
269  }
270  return _sn;
271 }
std::string _sn
Definition: RPCGeomServ.h:29
int roll() const
Definition: RPCDetId.h:120
int ring() const
Definition: RPCDetId.h:72
int layer() const
Definition: RPCDetId.h:108
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:114
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
bool RPCGeomServ::zpositive ( )
virtual

Definition at line 486 of file RPCGeomServ.cc.

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

Referenced by inverted().

487 {
488  if (_id->region()==0 && _t<-90 ){
489  if (_id->ring()<0){
490  _z=false;
491  }
492  if (_id->ring()==0){
493  if (_id->sector() == 1 || _id->sector() == 4 ||
494  _id->sector() == 5 || _id->sector() == 8 ||
495  _id->sector() == 9 || _id->sector() == 12){
496  _z=false;
497  }
498  }
499  }
500 
501  return _z;
502 }
int ring() const
Definition: RPCDetId.h:72
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63

Member Data Documentation

bool RPCGeomServ::_a
protected

Definition at line 34 of file RPCGeomServ.h.

Referenced by aclockwise().

std::string RPCGeomServ::_cn
protected

Definition at line 30 of file RPCGeomServ.h.

Referenced by chambername().

int RPCGeomServ::_cnr
protected

Definition at line 32 of file RPCGeomServ.h.

Referenced by chambernr().

const RPCDetId* RPCGeomServ::_id
protected
std::string RPCGeomServ::_n
protected

Definition at line 28 of file RPCGeomServ.h.

Referenced by name().

std::string RPCGeomServ::_sn
protected

Definition at line 29 of file RPCGeomServ.h.

Referenced by shortname().

int RPCGeomServ::_t
protected

Definition at line 31 of file RPCGeomServ.h.

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

bool RPCGeomServ::_z
protected

Definition at line 33 of file RPCGeomServ.h.

Referenced by zpositive().