CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
rpcdqm::utils Class Reference

#include <utils.h>

Public Member Functions

std::string detId2ChamberLabel (const RPCDetId &_id)
 
int detId2ChamberNr (const RPCDetId &_id)
 
int detId2RollNr (const RPCDetId &_id)
 
void doEndcapLabeling (bool useRollInfo)
 
void dolabeling (bool useRollInfo)
 
void fillvect ()
 
void labelXAxisSector (MonitorElement *myMe)
 
void labelXAxisSegment (MonitorElement *myMe)
 
void labelYAxisRing (MonitorElement *myMe, int numberOfRings, bool useRollInfo)
 
void labelYAxisRoll (MonitorElement *myMe, int region, int ring, bool useRollInfo)
 
std::vector< int > SectorStrips1 ()
 
std::vector< int > SectorStrips2 ()
 
std::string YLabel (int i)
 

Private Attributes

int _cnr
 
int ch
 
std::string ChLabel
 
std::vector< std::string > endcapYLabels_
 
std::vector< int > Wvector1
 
std::vector< int > Wvector2
 
std::string ylabel [22]
 

Detailed Description

Definition at line 16 of file utils.h.

Member Function Documentation

std::string rpcdqm::utils::detId2ChamberLabel ( const RPCDetId _id)
inline

Definition at line 387 of file utils.h.

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

387  {
388  if(_id.region()==0){//Barrel
389  if( _id.station() ==1) {// Station1
390  if(_id.layer() ==1) {
391 
392  ChLabel="RB1in";
393 
394  } else {
395  ChLabel="RB1out";
396  }
397 
398  }else if (_id.station()==2) {//Station 2
399  if(_id.layer()==1) {
400 
401  ChLabel="RB2in";
402  }else{
403 
404  ChLabel="RB2out";
405  }
406  }else if(_id.station()==3){//Station 3
407  if(_id.subsector()==1){
408  ChLabel="RB3+";
409  } else {
410 
411  ChLabel="RB3-";
412  }
413  } else if(_id.station()==4) {//Station 4
414  if (_id.sector()== 4) {
415  if ( _id.subsector()==1){
416 
417  ChLabel="RB4-";
418 
419  }else if (_id.subsector()==2){
420  ChLabel="RB4+";
421  }else if ( _id.subsector()==3) {
422  ChLabel="RB4--";
423  }else if ( _id.subsector()==4){
424  ChLabel="RB4++";
425  }
426  } else {
427  if(_id.subsector()==1) ChLabel="RB4-";
428  else ChLabel="RB4-";
429  }
430  }
431  }else{//Endcap
432  }
433  return ChLabel;
434  }
int layer() const
Definition: RPCDetId.h:112
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:106
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:118
std::string ChLabel
Definition: utils.h:442
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:67
int station() const
Definition: RPCDetId.h:100
int rpcdqm::utils::detId2ChamberNr ( const RPCDetId _id)
inline

Definition at line 335 of file utils.h.

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

335  {
336  if(_id.region()==0){//Barrel
337  if( _id.station() ==1) {// Station1
338  if(_id.layer() ==1) {
339 
340  ch=1; //RB1in
341 
342  } else {
343  ch=2; //RB1out
344  }
345 
346  }else if (_id.station()==2) {//Station 2
347  if(_id.layer()==1) {
348 
349  ch=3;//RB2in
350  }else{
351 
352  ch=4; //RB2out
353  }
354  }else if(_id.station()==3){//Station 3
355  if(_id.subsector()==1){
356  ch=5; //RB3+
357  } else {
358 
359  ch=6; //RB3-
360  }
361  } else if(_id.station()==4) {//Station 4
362  if (_id.sector()== 4) {
363  if ( _id.subsector()==1){
364 
365  ch=7; //RB4-
366 
367  }else if (_id.subsector()==2){
368  ch=8; //RB4+
369  }else if ( _id.subsector()==3) {
370  ch=9; //RB4--
371  }else if ( _id.subsector()==4){
372  ch=10; //RB4++
373  }
374  } else {
375  if(_id.subsector()==1) ch= 7; //RB4-
376  else ch= 8; //RB4+
377  }
378  }
379  }else{//Endcap
380  }
381  return ch;
382  }
int layer() const
Definition: RPCDetId.h:112
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:106
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:118
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:67
int station() const
Definition: RPCDetId.h:100
int rpcdqm::utils::detId2RollNr ( const RPCDetId _id)
inline

Definition at line 18 of file utils.h.

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

Referenced by RPCDBPopConAnalyzer::analyze(), RPCClusterSizeTest::clientOperation(), RPCDeadChannelTest::clientOperation(), RPCEfficiencySecond::endRun(), RPCNoisyStripTest::fillGlobalME(), RPCOccupancyTest::fillGlobalME(), RPCMultiplicityTest::fillGlobalME(), and RPCMonitorDigi::performSourceOperation().

18  {
19  if(_id.region()==0){//Barrel
20  if( _id.station() ==1) {// Station1
21  if(_id.layer() ==1) { //in
22  if(_id.roll()==1) //forward
23  _cnr = 1;//RB1inF
24  else //backward
25  _cnr = 2;//RB1inB
26  } else {//out
27  if(_id.roll()==1)
28  _cnr = 3;//RB1outF
29  else
30  _cnr = 4;//RB1outB
31  }
32  }else if (_id.station()==2) {//Station 2
33  if(_id.layer()==1) {
34  if(_id.roll()==1)
35  _cnr = 5;//RB2inB
36  else if(_id.roll()==3)
37  _cnr=6;//RB2inF
38  else if(_id.roll()==2)
39  _cnr=7;//RB2inM
40  }else{
41  if(_id.roll()==2)
42  _cnr=7;//RB2outM
43  else if(_id.roll()==1)
44  _cnr=8;//RB2outB
45  else if(_id.roll()==3)
46  _cnr=9;//RB2outF
47  }
48  }else if(_id.station()==3){//Station 3
49  if(_id.subsector()==1){
50  if(_id.roll()==1)
51  _cnr=10;//RB3-B
52  else
53  _cnr=11;//RB3-F
54  } else {
55  if(_id.roll()==1)
56  _cnr=12;//RB3+B
57  else
58  _cnr=13;//RB3+F
59  }
60  } else if(_id.station()==4) {//Station 4
61  if (_id.sector()== 4) {
62  if ( _id.subsector()==2){//RB4--
63  if(_id.roll()==1)
64  _cnr=14;
65  else
66  _cnr=15;
67  }else if (_id.subsector()==3){//RB4-
68  if(_id.roll()==1)
69  _cnr=16;
70  else
71  _cnr=17;
72  }else if ( _id.subsector()==1) {//RB4+
73  if(_id.roll()==1)
74  _cnr=18;
75  else
76  _cnr=19;
77  }else if ( _id.subsector()==4){//RB4++
78  if(_id.roll()==1)
79  _cnr=20;
80  else
81  _cnr=21;
82  }
83  } else {
84  if(_id.subsector()==1) {
85  if(_id.roll()==1)
86  _cnr=14;
87  else
88  _cnr=15;
89  } else {
90  if(_id.roll()==1)
91  _cnr=16;
92  else
93  _cnr=17;
94  }
95  }
96  }
97  }else{//Endcap
98  int nsub=6;
99  if ( _id.ring()==1 && _id.station() > 1) {
100  nsub=3;
101  }
102  _cnr = (_id.subsector()-1)*3+_id.roll()+(_id.ring()-1)*nsub*3;
103  }
104  return _cnr;
105  }
int roll() const
Definition: RPCDetId.h:124
int ring() const
Definition: RPCDetId.h:76
int _cnr
Definition: utils.h:439
int layer() const
Definition: RPCDetId.h:112
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:106
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:118
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:67
int station() const
Definition: RPCDetId.h:100
void rpcdqm::utils::doEndcapLabeling ( bool  useRollInfo)
inline

Definition at line 208 of file utils.h.

References ch, endcapYLabels_, alignCSCRings::r, and relativeConstraints::ring.

Referenced by labelYAxisRoll().

208  {
209 
210  std::string rolls[3];
211  rolls[0]="A";
212  rolls[1]="B";
213  rolls[2]="C";
214 
215  endcapYLabels_.clear();
216  std::stringstream myLabel;
217 
218  for(int ring = 1 ; ring <=3; ring ++){
219  for(int ch = 1; ch<=6; ch++){
220  for(int r=0; r<3; r++){
221  myLabel.str("");
222  myLabel<<"R"<<ring<<"_C"<<ch<<"_"<<rolls[r];
223  endcapYLabels_.push_back(myLabel.str());
224  }
225  }
226  }
227  }
std::vector< std::string > endcapYLabels_
Definition: utils.h:441
void rpcdqm::utils::dolabeling ( bool  useRollInfo)
inline

Definition at line 147 of file utils.h.

References ylabel.

Referenced by labelYAxisRoll().

147  {
148 
149  if(useRollInfo){
150  ylabel[1] = "RB1in_B";
151  ylabel[2] = "RB1in_F";
152  ylabel[3] = "RB1out_B";
153  ylabel[4] = "RB1out_F";
154  ylabel[5] = "RB2in_B";
155  ylabel[6] = "RB2in_F";
156 
157  ylabel[7] = "RB2in_M";
158  ylabel[0] = "RB2out_M";
159 
160  ylabel[8] = "RB2out_B";
161  ylabel[9] = "RB2out_F";
162  ylabel[10] = "RB3-_B";
163  ylabel[11] = "RB3-_F";
164  ylabel[12] = "RB3+_B";
165  ylabel[13] = "RB3+_F";
166  ylabel[14] = "RB4,-_B";
167  ylabel[15] = "RB4,-_F";
168  ylabel[16] = "RB4+_B";
169  ylabel[17] = "RB4+_F";
170  ylabel[18] = "RB4--_B";
171  ylabel[19] = "RB4--_F";
172  ylabel[20] = "RB4++_B";
173  ylabel[21] = "RB4++_F";
174  }else{
175  ylabel[1] = "RB1in";
176  ylabel[2] = "";
177  ylabel[3] = "RB1out";
178  ylabel[4] = "";
179  ylabel[5] = "RB2in";
180  ylabel[6] = "";
181 
182  ylabel[7] = "";
183  ylabel[0] = "";
184 
185  ylabel[8] = "RB2out";
186  ylabel[9] = "";
187  ylabel[10] = "RB3-";
188  ylabel[11] = "";
189  ylabel[12] = "RB3+";
190  ylabel[13] = "";
191  ylabel[14] = "RB4,-";
192  ylabel[15] = "";
193  ylabel[16] = "RB4+";
194  ylabel[17] = "";
195  ylabel[18] = "RB4--";
196  ylabel[19] = "";
197  ylabel[20] = "RB4++";
198  ylabel[21] = "";
199  }
200 
201 
202 
203 
204 
205  }
std::string ylabel[22]
Definition: utils.h:445
void rpcdqm::utils::fillvect ( )
inline

Definition at line 107 of file utils.h.

References Wvector1, and Wvector2.

107  {
108  Wvector2.push_back(0); //Sec 0 - doen't exist ;)
109  Wvector2.push_back(1140); //Sec1
110  Wvector2.push_back(1140); //Sec2
111  Wvector2.push_back(1140); //Sec3
112  Wvector2.push_back(1236); //Sec4
113  Wvector2.push_back(1140); //Sec5
114  Wvector2.push_back(1140); //Sec6
115  Wvector2.push_back(1140); //Sec7
116  Wvector2.push_back(1116); //Sec8
117  Wvector2.push_back(1044); //Sec9
118  Wvector2.push_back(1188); //Sec10
119  Wvector2.push_back(1044); //Sec11
120  Wvector2.push_back(1166); //Sec12
121 
122  Wvector1.push_back(0); //Sec 0 - doen't exist ;)
123  Wvector1.push_back(1146); //Sec1
124  Wvector1.push_back(1146); //Sec2
125  Wvector1.push_back(1146); //Sec3
126  Wvector1.push_back(1242); //Sec4
127  Wvector1.push_back(1146); //Sec5
128  Wvector1.push_back(1146); //Sec6
129  Wvector1.push_back(1146); //Sec7
130  Wvector1.push_back(1122); //Sec8
131  Wvector1.push_back(1050); //Sec9
132  Wvector1.push_back(1194); //Sec10
133  Wvector1.push_back(1050); //Sec11
134  Wvector1.push_back(1122); //Sec12
135 
136  }
std::vector< int > Wvector1
Definition: utils.h:444
std::vector< int > Wvector2
Definition: utils.h:443
void rpcdqm::utils::labelXAxisSector ( MonitorElement myMe)
inline

Definition at line 236 of file utils.h.

References MonitorElement::getNbinsX(), MonitorElement::setBinLabel(), and vdt::x.

Referenced by RPCMon_SS_Dbx_Global::analyze(), RPCChamberQuality::beginRun(), RPCNoisyStripTest::beginRun(), RPCOccupancyTest::beginRun(), RPCDeadChannelTest::beginRun(), RPCMultiplicityTest::beginRun(), RPCClusterSizeTest::beginRun(), RPCEfficiencySecond::beginRun(), and RPCMonitorDigi::bookWheelDiskME().

236  {
237  //before do some checks
238  if (!myMe) return;
239 
240  std::stringstream xLabel;
241 
242  for(int x = 1; x<= myMe->getNbinsX(); x++){
243  xLabel.str("");
244  xLabel<<"Sec"<<x;
245  myMe->setBinLabel(x, xLabel.str(), 1);
246  }
247 
248  }
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
int getNbinsX(void) const
get # of bins in X-axis
x
Definition: VDTMath.h:216
void rpcdqm::utils::labelXAxisSegment ( MonitorElement myMe)
inline

Definition at line 251 of file utils.h.

References MonitorElement::getNbinsX(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and vdt::x.

Referenced by RPCMon_SS_Dbx_Global::analyze(), RPCChamberQuality::beginRun(), RPCNoisyStripTest::beginRun(), RPCOccupancyTest::beginRun(), RPCDeadChannelTest::beginRun(), RPCMultiplicityTest::beginRun(), RPCClusterSizeTest::beginRun(), RPCEfficiencySecond::beginRun(), and RPCMonitorDigi::bookWheelDiskME().

251  {
252  //before do some checks
253  if (!myMe) return;
254 
255  std::stringstream xLabel;
256 
257  myMe->setAxisTitle("Segments", 1);
258 
259  for(int x = 1; x<= myMe->getNbinsX(); x++){
260  xLabel.str("");
261  xLabel<<x;
262  myMe->setBinLabel(x, xLabel.str(), 1);
263  }
264 
265  }
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
int getNbinsX(void) const
get # of bins in X-axis
x
Definition: VDTMath.h:216
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void rpcdqm::utils::labelYAxisRing ( MonitorElement myMe,
int  numberOfRings,
bool  useRollInfo 
)
inline

Definition at line 296 of file utils.h.

References MonitorElement::getNbinsY(), reco_calib_source_client_cfg::labels, MonitorElement::setBinLabel(), and detailsBasic3DVector::y.

Referenced by RPCMon_SS_Dbx_Global::analyze(), RPCChamberQuality::beginRun(), RPCNoisyStripTest::beginRun(), RPCOccupancyTest::beginRun(), RPCDeadChannelTest::beginRun(), RPCMultiplicityTest::beginRun(), RPCClusterSizeTest::beginRun(), RPCEfficiencySecond::beginRun(), and RPCMonitorDigi::bookWheelDiskME().

296  {
297 
298  //before do some checks
299  if (!myMe) return;
300  std::string labels[9];
301  if(useRollInfo){
302  labels[0]= "C";
303  labels[1]= "Ring1 B";
304  labels[2]= "A";
305  labels[3]= "C";
306  labels[4]= "Ring2 B";
307  labels[5]= "A";
308  labels[6]= "C";
309  labels[7]= "Ring3 B";
310  labels[8]= "A";
311  }else{
312  labels[0]= "";
313  labels[1]= "Ring1";
314  labels[2]= "";
315  labels[3]= "";
316  labels[4]= "Ring2";
317  labels[5]= "";
318  labels[6]= "";
319  labels[7]= "Ring3";
320  labels[8]= "";
321 
322  }
323  int startBin ;
324  (numberOfRings == 2 ? startBin = 3: startBin = 0);
325 
326  //set bin labels
327  for(int y =1 ;y<= myMe->getNbinsY() && y<=9; y++ ){
328  myMe->setBinLabel(y,labels[y-1+startBin],2);
329 
330  }
331  }
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
int getNbinsY(void) const
get # of bins in Y-axis
void rpcdqm::utils::labelYAxisRoll ( MonitorElement myMe,
int  region,
int  ring,
bool  useRollInfo 
)
inline

Definition at line 269 of file utils.h.

References doEndcapLabeling(), dolabeling(), endcapYLabels_, MonitorElement::getNbinsY(), MonitorElement::setBinLabel(), detailsBasic3DVector::y, and ylabel.

Referenced by RPCMon_SS_Dbx_Global::analyze(), RPCChamberQuality::beginRun(), RPCNoisyStripTest::beginRun(), RPCOccupancyTest::beginRun(), RPCDeadChannelTest::beginRun(), RPCMultiplicityTest::beginRun(), RPCClusterSizeTest::beginRun(), RPCEfficiencySecond::beginRun(), RPCMonitorDigi::bookSectorRingME(), and RPCMonitorDigi::bookWheelDiskME().

269  {
270 
271  //before do some checks
272  if (!myMe) return;
273 
274  //set bin labels
275  if(region == 0){
276 
277  //initialize label vector
278  this->dolabeling(useRollInfo);
279  if(ring == -2 || ring == 2) ylabel[7]=ylabel[0];
280 
281  for(int y = 1; y<= myMe->getNbinsY() && y<22; y++)
282  myMe->setBinLabel(y, ylabel[y], 2);
283 
284  }else{//Endcap
285 
286  this->doEndcapLabeling(useRollInfo);
287 
288  for(int y = 1; y<= myMe->getNbinsY() && y<(int)endcapYLabels_.size(); y++)
289  myMe->setBinLabel(y, endcapYLabels_[y], 2);
290 
291  }
292  }
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
int getNbinsY(void) const
get # of bins in Y-axis
std::string ylabel[22]
Definition: utils.h:445
std::vector< std::string > endcapYLabels_
Definition: utils.h:441
void dolabeling(bool useRollInfo)
Definition: utils.h:147
void doEndcapLabeling(bool useRollInfo)
Definition: utils.h:208
std::vector<int> rpcdqm::utils::SectorStrips1 ( )
inline

Definition at line 142 of file utils.h.

References Wvector1.

142  {
143  return Wvector1;
144  }
std::vector< int > Wvector1
Definition: utils.h:444
std::vector<int> rpcdqm::utils::SectorStrips2 ( )
inline

Definition at line 138 of file utils.h.

References Wvector2.

138  {
139  return Wvector2;
140  }
std::vector< int > Wvector2
Definition: utils.h:443
std::string rpcdqm::utils::YLabel ( int  i)
inline

Definition at line 229 of file utils.h.

References i, and ylabel.

229  {
230 
231  return ylabel[i];
232 
233  }
int i
Definition: DBlmapReader.cc:9
std::string ylabel[22]
Definition: utils.h:445

Member Data Documentation

int rpcdqm::utils::_cnr
private

Definition at line 439 of file utils.h.

Referenced by detId2RollNr().

int rpcdqm::utils::ch
private

Definition at line 440 of file utils.h.

Referenced by detId2ChamberNr(), and doEndcapLabeling().

std::string rpcdqm::utils::ChLabel
private

Definition at line 442 of file utils.h.

Referenced by detId2ChamberLabel().

std::vector<std::string> rpcdqm::utils::endcapYLabels_
private

Definition at line 441 of file utils.h.

Referenced by doEndcapLabeling(), and labelYAxisRoll().

std::vector<int> rpcdqm::utils::Wvector1
private

Definition at line 444 of file utils.h.

Referenced by fillvect(), and SectorStrips1().

std::vector<int> rpcdqm::utils::Wvector2
private

Definition at line 443 of file utils.h.

Referenced by fillvect(), and SectorStrips2().

std::string rpcdqm::utils::ylabel[22]
private