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
 
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 ( )
virtual

Definition at line 11 of file RPCGeomServ.cc.

12 {}
RPCGeomServ::RPCGeomServ ( )
protected

Definition at line 537 of file RPCGeomServ.cc.

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

Member Function Documentation

bool RPCGeomServ::aclockwise ( )
virtual

Definition at line 508 of file RPCGeomServ.cc.

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

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

Definition at line 129 of file RPCGeomServ.cc.

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

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

130 {
131  if (_n.size()<1){
132  std::string buf;
133 
134  if (_id->region()==0){
135  buf="W";
136  {
137  std::stringstream os;
138  os << std::setw(2)<<std::setfill('+')<<_id->ring()
139  <<std::setfill(' ')<<"_";
140  buf += os.str();
141  }
142 
143  {
144  std::stringstream os;
145  os <<"RB"<<_id->station();
146  if (_id->station()<=2) {
147  if (_id->layer()==1)
148  os<<"in";
149  else
150  os<<"out";
151  }
152  //os<<"_";
153  buf += os.str();
154  }
155 
156 
157  {
158  std::stringstream os;
159  // os <<"S"<<std::setw(2)<<std::setfill('0')
160  // <<_id->sector()<<std::setfill(' ');
161  if (_id->station()>2){
162  if (_id->sector()== 4 && _id->station()==4){
163  if ( _id->subsector()==1){
164  os<<"--";
165  }
166  else if ( _id->subsector()==2){
167  os <<"-";
168  }
169  else if ( _id->subsector()==3){
170  os <<"+";
171  }
172  else if ( _id->subsector()==4){
173  os <<"++";
174  }
175  }
176 
177  if(_id->station()==3){
178  if (_id->subsector()==1)
179  os <<"-";
180  else
181  os <<"+";
182  }else if(_id->station()==4 && _id->sector()!=9 && _id->sector()!=11 && _id->sector()!=4){
183  if (_id->subsector()==1)
184  os <<"-";
185  else
186  os <<"+";
187  }
188  }
189 
190  os<<"_";
191  os <<"S"<<std::setw(2)<<std::setfill('0')
192  <<_id->sector()<<std::setfill(' ');
193  buf += os.str();
194  }
195 
196  }
197  else {
198  buf="RE";
199 
200  {
201  std::stringstream os;
202  os << std::setw(2)<<std::setfill('+')<<_id->station()*_id->region()
203  <<std::setfill(' ')<<"_";
204  buf += os.str();
205  }
206 
207  {
208  std::stringstream os;
209  os <<"R"<<_id->ring();
210  os <<"_CH"<<std::setw(2)<<std::setfill('0')<<this->segment();
211  buf += os.str();
212  }
213 
214 
215  }
216  _n=buf;
217  }
218  return _n;
219 }
std::string _n
Definition: RPCGeomServ.h:28
int ring() const
Definition: RPCDetId.h:74
int layer() const
Definition: RPCDetId.h:110
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:104
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:116
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
int station() const
Definition: RPCDetId.h:98
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:122
int layer() const
Definition: RPCDetId.h:110
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:104
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:116
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int station() const
Definition: RPCDetId.h:98
std::vector< int > RPCGeomServ::channelInChip ( )

Definition at line 277 of file RPCGeomServ.cc.

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

277  {
278 
279  std::vector<int> chipCh(4,8);//Endcap
280 
281  if(_id->region()==0){//Barrel
282  chipCh.clear();
283 
284  if (_id->station()<3 && _id->layer()==1){ // i.e. RB1in ||RB2in
285  chipCh.push_back(7);
286  chipCh.push_back(8);
287  }else if (_id->station() == 1 || _id->station() == 3){//i.e. RB1out || RB3
288  chipCh.push_back(7);
289  chipCh.push_back(7);
290  }else if (_id->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 layer() const
Definition: RPCDetId.h:110
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:104
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:116
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
int station() const
Definition: RPCDetId.h:98
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:122
int ring() const
Definition: RPCDetId.h:74
virtual bool inverted()
Definition: RPCGeomServ.cc:481
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
bool RPCGeomServ::inverted ( )
virtual

Definition at line 481 of file RPCGeomServ.cc.

References zpositive().

Referenced by eta_partition().

482 {
483  // return !(this->zpositive() && this->aclockwise());
484  return !(this->zpositive());
485 }
virtual bool zpositive()
Definition: RPCGeomServ.cc:489
std::string RPCGeomServ::name ( void  )
virtual

Definition at line 15 of file RPCGeomServ.cc.

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

Referenced by RPCMon_SS_Dbx_Global::analyze(), RPCEfficiency::analyze(), RPCMonitorDigi::beginRun(), RPCEfficiencySecond::bookDetUnitSeg(), RPCMonitorDigi::bookRollME(), DTSegtoRPC::DTSegtoRPC(), RPCEfficiencySecond::endRun(), rpcdqmclient::clientTools::getMEs(), RPCDqmClient::getMonitorElements(), L1TRPCTPG::L1TRPCBookME(), HSCPValidator::makeSimDigiPlotsRPC(), RPCMonitorDigi::performSourceOperation(), cond::PayLoadInspector< DataT >::plot(), RPCSimAverageNoiseEffCls::simulate(), RPCSimAverageNoiseEff::simulate(), RPCSimAverageNoiseEffCls::simulateNoise(), RPCSimAverageNoiseEff::simulateNoise(), cond::PayLoadInspector< DataT >::summary(), and TracktoRPC::TracktoRPC().

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

Definition at line 467 of file RPCGeomServ.cc.

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

Referenced by RPCMon_SS_Dbx_Global::analyze(), RPCEfficiency::beginRun(), 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().

467  {
468  int seg=0;
469  int nsec=36;
470  int nsub=6;
471  if ( _id->ring()==1 && _id->station() > 1) {
472  nsub=3;
473  nsec=18;
474  }
475  seg =_id->subsector()+nsub*(_id->sector()-1);//+1;
476  // if(seg==nsec+1)seg=1;
477  return seg;
478 }
int ring() const
Definition: RPCDetId.h:74
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:104
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:116
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int station() const
Definition: RPCDetId.h:98
std::string RPCGeomServ::shortname ( )
virtual

Definition at line 222 of file RPCGeomServ.cc.

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

Referenced by RPCEfficiencySecond::endRun().

223 {
224  if (_sn.size()<1)
225  {
226  std::string buf;
227 
228  if (_id->region()==0){
229  std::stringstream os;
230  os <<"RB"<<_id->station();
231  if (_id->station()<=2){
232  if (_id->layer()==1){
233  os<<"in";
234  }else{
235  os<<"out";
236  }
237  }else{
238  if (_id->sector()== 4 && _id->station()==4){
239  if ( _id->subsector()==1){
240  os<<"--";
241  }
242  else if ( _id->subsector()==2){
243  os <<",-";
244  }
245  else if ( _id->subsector()==3){
246  os <<"+";
247  }
248  else if ( _id->subsector()==4){
249  os <<"++";
250  }
251  }else{
252  if (_id->subsector()==1)
253  os <<",-";
254  else
255  os <<"+";
256  }
257  }
258  if (_id->roll()==1)
259  os<<" B";
260  else if (_id->roll() == 3)
261  os<<" F";
262  else if (_id->roll() == 2)
263  os<<" M";
264  buf += os.str();
265  }
266  else {
267  std::stringstream os;
268  os <<"Ri"<<_id->ring()<<" Su"<<_id->subsector();
269  buf += os.str();
270  }
271  _sn=buf;
272  }
273  return _sn;
274 }
std::string _sn
Definition: RPCGeomServ.h:29
int roll() const
Definition: RPCDetId.h:122
int ring() const
Definition: RPCDetId.h:74
int layer() const
Definition: RPCDetId.h:110
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:104
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:116
const RPCDetId * _id
Definition: RPCGeomServ.h:27
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
int station() const
Definition: RPCDetId.h:98
bool RPCGeomServ::zpositive ( )
virtual

Definition at line 489 of file RPCGeomServ.cc.

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

Referenced by inverted().

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

Member Data Documentation

bool RPCGeomServ::_a
protected

Definition at line 33 of file RPCGeomServ.h.

Referenced by aclockwise().

int RPCGeomServ::_cnr
protected

Definition at line 31 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 chambername(), and name().

std::string RPCGeomServ::_sn
protected

Definition at line 29 of file RPCGeomServ.h.

Referenced by shortname().

int RPCGeomServ::_t
protected

Definition at line 30 of file RPCGeomServ.h.

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

bool RPCGeomServ::_z
protected

Definition at line 32 of file RPCGeomServ.h.

Referenced by zpositive().