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 386 of file utils.h.

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

386  {
387  if(_id.region()==0){//Barrel
388  if( _id.station() ==1) {// Station1
389  if(_id.layer() ==1) {
390 
391  ChLabel="RB1in";
392 
393  } else {
394  ChLabel="RB1out";
395  }
396 
397  }else if (_id.station()==2) {//Station 2
398  if(_id.layer()==1) {
399 
400  ChLabel="RB2in";
401  }else{
402 
403  ChLabel="RB2out";
404  }
405  }else if(_id.station()==3){//Station 3
406  if(_id.subsector()==1){
407  ChLabel="RB3+";
408  } else {
409 
410  ChLabel="RB3-";
411  }
412  } else if(_id.station()==4) {//Station 4
413  if (_id.sector()== 4) {
414  if ( _id.subsector()==1){
415 
416  ChLabel="RB4-";
417 
418  }else if (_id.subsector()==2){
419  ChLabel="RB4+";
420  }else if ( _id.subsector()==3) {
421  ChLabel="RB4--";
422  }else if ( _id.subsector()==4){
423  ChLabel="RB4++";
424  }
425  } else {
426  if(_id.subsector()==1) ChLabel="RB4-";
427  else ChLabel="RB4-";
428  }
429  }
430  }else{//Endcap
431  }
432  return ChLabel;
433  }
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
std::string ChLabel
Definition: utils.h:441
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
int rpcdqm::utils::detId2ChamberNr ( const RPCDetId _id)
inline

Definition at line 334 of file utils.h.

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

334  {
335  if(_id.region()==0){//Barrel
336  if( _id.station() ==1) {// Station1
337  if(_id.layer() ==1) {
338 
339  ch=1; //RB1in
340 
341  } else {
342  ch=2; //RB1out
343  }
344 
345  }else if (_id.station()==2) {//Station 2
346  if(_id.layer()==1) {
347 
348  ch=3;//RB2in
349  }else{
350 
351  ch=4; //RB2out
352  }
353  }else if(_id.station()==3){//Station 3
354  if(_id.subsector()==1){
355  ch=5; //RB3+
356  } else {
357 
358  ch=6; //RB3-
359  }
360  } else if(_id.station()==4) {//Station 4
361  if (_id.sector()== 4) {
362  if ( _id.subsector()==1){
363 
364  ch=7; //RB4-
365 
366  }else if (_id.subsector()==2){
367  ch=8; //RB4+
368  }else if ( _id.subsector()==3) {
369  ch=9; //RB4--
370  }else if ( _id.subsector()==4){
371  ch=10; //RB4++
372  }
373  } else {
374  if(_id.subsector()==1) ch= 7; //RB4-
375  else ch= 8; //RB4+
376  }
377  }
378  }else{//Endcap
379  }
380  return ch;
381  }
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
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
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:120
int ring() const
Definition: RPCDetId.h:72
int _cnr
Definition: utils.h:438
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
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
void rpcdqm::utils::doEndcapLabeling ( bool  useRollInfo)
inline

Definition at line 208 of file utils.h.

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

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:440
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:444
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:443
std::vector< int > Wvector2
Definition: utils.h:442
void rpcdqm::utils::labelXAxisSector ( MonitorElement myMe)
inline

Definition at line 236 of file utils.h.

References MonitorElement::getNbinsX(), MonitorElement::setBinLabel(), and 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  }
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
Definition: DDAxes.h:10
void rpcdqm::utils::labelXAxisSegment ( MonitorElement myMe)
inline

Definition at line 250 of file utils.h.

References MonitorElement::getNbinsX(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and 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().

250  {
251  //before do some checks
252  if (!myMe) return;
253 
254  std::stringstream xLabel;
255 
256  myMe->setAxisTitle("Segments", 1);
257 
258  for(int x = 1; x<= myMe->getNbinsX(); x++){
259  xLabel.str("");
260  xLabel<<x;
261  myMe->setBinLabel(x, xLabel.str(), 1);
262  }
263 
264  }
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
Definition: DDAxes.h:10
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 295 of file utils.h.

References MonitorElement::getNbinsY(), tablePrinter::labels, MonitorElement::setBinLabel(), AlCaHLTBitMon_QueryRunRegistry::string, 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().

295  {
296 
297  //before do some checks
298  if (!myMe) return;
299  std::string labels[9];
300  if(useRollInfo){
301  labels[0]= "C";
302  labels[1]= "Ring1 B";
303  labels[2]= "A";
304  labels[3]= "C";
305  labels[4]= "Ring2 B";
306  labels[5]= "A";
307  labels[6]= "C";
308  labels[7]= "Ring3 B";
309  labels[8]= "A";
310  }else{
311  labels[0]= "";
312  labels[1]= "Ring1";
313  labels[2]= "";
314  labels[3]= "";
315  labels[4]= "Ring2";
316  labels[5]= "";
317  labels[6]= "";
318  labels[7]= "Ring3";
319  labels[8]= "";
320 
321  }
322  int startBin ;
323  (numberOfRings == 2 ? startBin = 3: startBin = 0);
324 
325  //set bin labels
326  for(int y =1 ;y<= myMe->getNbinsY() && y<=9; y++ ){
327  myMe->setBinLabel(y,labels[y-1+startBin],2);
328 
329  }
330  }
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 268 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().

268  {
269 
270  //before do some checks
271  if (!myMe) return;
272 
273  //set bin labels
274  if(region == 0){
275 
276  //initialize label vector
277  this->dolabeling(useRollInfo);
278  if(ring == -2 || ring == 2) ylabel[7]=ylabel[0];
279 
280  for(int y = 1; y<= myMe->getNbinsY() && y<22; y++)
281  myMe->setBinLabel(y, ylabel[y], 2);
282 
283  }else{//Endcap
284 
285  this->doEndcapLabeling(useRollInfo);
286 
287  for(int y = 1; y<= myMe->getNbinsY() && y<(int)endcapYLabels_.size(); y++)
288  myMe->setBinLabel(y, endcapYLabels_[y], 2);
289 
290  }
291  }
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:444
std::vector< std::string > endcapYLabels_
Definition: utils.h:440
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:443
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:442
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:444

Member Data Documentation

int rpcdqm::utils::_cnr
private

Definition at line 438 of file utils.h.

Referenced by detId2RollNr().

int rpcdqm::utils::ch
private

Definition at line 439 of file utils.h.

Referenced by detId2ChamberNr(), and doEndcapLabeling().

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

Definition at line 441 of file utils.h.

Referenced by detId2ChamberLabel().

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

Definition at line 440 of file utils.h.

Referenced by doEndcapLabeling(), and labelYAxisRoll().

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

Definition at line 443 of file utils.h.

Referenced by fillvect(), and SectorStrips1().

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

Definition at line 442 of file utils.h.

Referenced by fillvect(), and SectorStrips2().

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