CMS 3D CMS Logo

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

Member Function Documentation

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

Definition at line 403 of file utils.h.

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

403  {
404  if(_id.region()==0){//Barrel
405  if( _id.station() ==1) {// Station1
406  if(_id.layer() ==1) {
407 
408  ChLabel="RB1in";
409 
410  } else {
411  ChLabel="RB1out";
412  }
413 
414  }else if (_id.station()==2) {//Station 2
415  if(_id.layer()==1) {
416 
417  ChLabel="RB2in";
418  }else{
419 
420  ChLabel="RB2out";
421  }
422  }else if(_id.station()==3){//Station 3
423  if(_id.subsector()==1){
424  ChLabel="RB3+";
425  } else {
426 
427  ChLabel="RB3-";
428  }
429  } else if(_id.station()==4) {//Station 4
430  if (_id.sector()== 4) {
431  if ( _id.subsector()==1){
432 
433  ChLabel="RB4-";
434 
435  }else if (_id.subsector()==2){
436  ChLabel="RB4+";
437  }else if ( _id.subsector()==3) {
438  ChLabel="RB4--";
439  }else if ( _id.subsector()==4){
440  ChLabel="RB4++";
441  }
442  } else {
443  if(_id.subsector()==1) ChLabel="RB4-";
444  else ChLabel="RB4-";
445  }
446  }
447  }else{//Endcap
448  }
449  return ChLabel;
450  }
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:456
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 351 of file utils.h.

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

351  {
352  if(_id.region()==0){//Barrel
353  if( _id.station() ==1) {// Station1
354  if(_id.layer() ==1) {
355 
356  ch=1; //RB1in
357 
358  } else {
359  ch=2; //RB1out
360  }
361 
362  }else if (_id.station()==2) {//Station 2
363  if(_id.layer()==1) {
364 
365  ch=3;//RB2in
366  }else{
367 
368  ch=4; //RB2out
369  }
370  }else if(_id.station()==3){//Station 3
371  if(_id.subsector()==1){
372  ch=5; //RB3+
373  } else {
374 
375  ch=6; //RB3-
376  }
377  } else if(_id.station()==4) {//Station 4
378  if (_id.sector()== 4) {
379  if ( _id.subsector()==1){
380 
381  ch=7; //RB4-
382 
383  }else if (_id.subsector()==2){
384  ch=8; //RB4+
385  }else if ( _id.subsector()==3) {
386  ch=9; //RB4--
387  }else if ( _id.subsector()==4){
388  ch=10; //RB4++
389  }
390  } else {
391  if(_id.subsector()==1) ch= 7; //RB4-
392  else ch= 8; //RB4+
393  }
394  }
395  }else{//Endcap
396  }
397  return ch;
398  }
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 31 of file utils.h.

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

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

31  {
32  if(_id.region()==0){//Barrel
33  if( _id.station() ==1) {// Station1
34  if(_id.layer() ==1) { //in
35  if(_id.roll()==1) //forward
36  _cnr = 1;//RB1inF
37  else //backward
38  _cnr = 2;//RB1inB
39  } else {//out
40  if(_id.roll()==1)
41  _cnr = 3;//RB1outF
42  else
43  _cnr = 4;//RB1outB
44  }
45  }else if (_id.station()==2) {//Station 2
46  if(_id.layer()==1) {
47  if(_id.roll()==1)
48  _cnr = 5;//RB2inB
49  else if(_id.roll()==3)
50  _cnr=6;//RB2inF
51  else if(_id.roll()==2)
52  _cnr=7;//RB2inM
53  }else{
54  if(_id.roll()==2)
55  _cnr=7;//RB2outM
56  else if(_id.roll()==1)
57  _cnr=8;//RB2outB
58  else if(_id.roll()==3)
59  _cnr=9;//RB2outF
60  }
61  }else if(_id.station()==3){//Station 3
62  if(_id.subsector()==1){
63  if(_id.roll()==1)
64  _cnr=10;//RB3-B
65  else
66  _cnr=11;//RB3-F
67  } else {
68  if(_id.roll()==1)
69  _cnr=12;//RB3+B
70  else
71  _cnr=13;//RB3+F
72  }
73  } else if(_id.station()==4) {//Station 4
74  if (_id.sector()== 4) {
75  if ( _id.subsector()==2){//RB4--
76  if(_id.roll()==1)
77  _cnr=14;
78  else
79  _cnr=15;
80  }else if (_id.subsector()==3){//RB4-
81  if(_id.roll()==1)
82  _cnr=16;
83  else
84  _cnr=17;
85  }else if ( _id.subsector()==1) {//RB4+
86  if(_id.roll()==1)
87  _cnr=18;
88  else
89  _cnr=19;
90  }else if ( _id.subsector()==4){//RB4++
91  if(_id.roll()==1)
92  _cnr=20;
93  else
94  _cnr=21;
95  }
96  } else {
97  if(_id.subsector()==1) {
98  if(_id.roll()==1)
99  _cnr=14;
100  else
101  _cnr=15;
102  } else {
103  if(_id.roll()==1)
104  _cnr=16;
105  else
106  _cnr=17;
107  }
108  }
109  }
110  }else{//Endcap
111  int nsub=6;
112  if ( _id.ring()==1 && _id.station() > 1) {
113  nsub=3;
114  }
115  _cnr = (_id.subsector()-1)*3+_id.roll()+(_id.ring()-1)*nsub*3;
116  }
117  return _cnr;
118  }
int roll() const
Definition: RPCDetId.h:120
int ring() const
Definition: RPCDetId.h:72
int _cnr
Definition: utils.h:453
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 221 of file utils.h.

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

221  {
222 
223  std::string rolls[3];
224  rolls[0]="A";
225  rolls[1]="B";
226  rolls[2]="C";
227 
228  endcapYLabels_.clear();
229  std::stringstream myLabel;
230 
231  for(int ring = 1 ; ring <=3; ring ++){
232  for(int ch = 1; ch<=6; ch++){
233  for(int r=0; r<3; r++){
234  myLabel.str("");
235  myLabel<<"R"<<ring<<"_C"<<ch<<"_"<<rolls[r];
236  endcapYLabels_.push_back(myLabel.str());
237  }
238  }
239  }
240  }
std::vector< std::string > endcapYLabels_
Definition: utils.h:455
void rpcdqm::utils::dolabeling ( bool  useRollInfo)
inline

Definition at line 160 of file utils.h.

References SiPixelPhase1HitsV_cfi::ylabel.

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

Definition at line 120 of file utils.h.

120  {
121  Wvector2.push_back(0); //Sec 0 - doen't exist ;)
122  Wvector2.push_back(1140); //Sec1
123  Wvector2.push_back(1140); //Sec2
124  Wvector2.push_back(1140); //Sec3
125  Wvector2.push_back(1236); //Sec4
126  Wvector2.push_back(1140); //Sec5
127  Wvector2.push_back(1140); //Sec6
128  Wvector2.push_back(1140); //Sec7
129  Wvector2.push_back(1116); //Sec8
130  Wvector2.push_back(1044); //Sec9
131  Wvector2.push_back(1188); //Sec10
132  Wvector2.push_back(1044); //Sec11
133  Wvector2.push_back(1166); //Sec12
134 
135  Wvector1.push_back(0); //Sec 0 - doen't exist ;)
136  Wvector1.push_back(1146); //Sec1
137  Wvector1.push_back(1146); //Sec2
138  Wvector1.push_back(1146); //Sec3
139  Wvector1.push_back(1242); //Sec4
140  Wvector1.push_back(1146); //Sec5
141  Wvector1.push_back(1146); //Sec6
142  Wvector1.push_back(1146); //Sec7
143  Wvector1.push_back(1122); //Sec8
144  Wvector1.push_back(1050); //Sec9
145  Wvector1.push_back(1194); //Sec10
146  Wvector1.push_back(1050); //Sec11
147  Wvector1.push_back(1122); //Sec12
148 
149  }
std::vector< int > Wvector1
Definition: utils.h:458
std::vector< int > Wvector2
Definition: utils.h:457
void rpcdqm::utils::labelXAxisSector ( MonitorElement myMe)
inline

Definition at line 249 of file utils.h.

References MonitorElement::getNbinsX(), MonitorElement::setBinLabel(), and rpcdqm::RPCMEHelper::setNoAlphanumeric().

Referenced by RPCMonitorDigi::bookWheelDiskME(), RPCEfficiencySecond::dqmEndJob(), RPCClusterSizeTest::myBooker(), RPCNoisyStripTest::myBooker(), RPCMultiplicityTest::myBooker(), RPCOccupancyTest::myBooker(), RPCDeadChannelTest::myBooker(), and RPCChamberQuality::myBooker().

249  {
250  //before do some checks
251  if (!myMe) return;
253 
254  std::stringstream xLabel;
255 
256  for(int x = 1; x<= myMe->getNbinsX(); x++){
257  xLabel.str("");
258  xLabel<<"Sec"<<x;
259  myMe->setBinLabel(x, xLabel.str(), 1);
260  }
261  }
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)
static void setNoAlphanumeric(MonitorElement *myMe)
Definition: utils.h:18
int getNbinsX(void) const
get # of bins in X-axis
void rpcdqm::utils::labelXAxisSegment ( MonitorElement myMe)
inline

Definition at line 264 of file utils.h.

References MonitorElement::getNbinsX(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and rpcdqm::RPCMEHelper::setNoAlphanumeric().

Referenced by RPCMonitorDigi::bookWheelDiskME(), RPCEfficiencySecond::dqmEndJob(), RPCClusterSizeTest::myBooker(), RPCNoisyStripTest::myBooker(), RPCMultiplicityTest::myBooker(), RPCOccupancyTest::myBooker(), RPCDeadChannelTest::myBooker(), and RPCChamberQuality::myBooker().

264  {
265  //before do some checks
266  if (!myMe) return;
268 
269  std::stringstream xLabel;
270 
271  myMe->setAxisTitle("Segments", 1);
272 
273  for(int x = 1; x<= myMe->getNbinsX(); x++){
274  xLabel.str("");
275  xLabel<<x;
276  myMe->setBinLabel(x, xLabel.str(), 1);
277  }
278 
279  }
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)
static void setNoAlphanumeric(MonitorElement *myMe)
Definition: utils.h:18
int getNbinsX(void) const
get # of bins in X-axis
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 311 of file utils.h.

References MonitorElement::getNbinsY(), tablePrinter::labels, MonitorElement::setBinLabel(), rpcdqm::RPCMEHelper::setNoAlphanumeric(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by RPCMonitorDigi::bookWheelDiskME(), RPCEfficiencySecond::dqmEndJob(), RPCClusterSizeTest::myBooker(), RPCNoisyStripTest::myBooker(), RPCMultiplicityTest::myBooker(), RPCOccupancyTest::myBooker(), RPCDeadChannelTest::myBooker(), and RPCChamberQuality::myBooker().

311  {
312 
313  //before do some checks
314  if (!myMe) return;
315  std::string labels[9];
316  if(useRollInfo){
317  labels[0]= "C";
318  labels[1]= "Ring1 B";
319  labels[2]= "A";
320  labels[3]= "C";
321  labels[4]= "Ring2 B";
322  labels[5]= "A";
323  labels[6]= "C";
324  labels[7]= "Ring3 B";
325  labels[8]= "A";
326  }else{
327  labels[0]= "";
328  labels[1]= "Ring1";
329  labels[2]= "";
330  labels[3]= "";
331  labels[4]= "Ring2";
332  labels[5]= "";
333  labels[6]= "";
334  labels[7]= "Ring3";
335  labels[8]= "";
336 
337  }
338  int startBin ;
339  (numberOfRings == 2 ? startBin = 3: startBin = 0);
340 
341  //set bin labels
343  for(int y =1 ;y<= myMe->getNbinsY() && y<=9; y++ ){
344  myMe->setBinLabel(y,labels[y-1+startBin],2);
345 
346  }
347  }
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
static void setNoAlphanumeric(MonitorElement *myMe)
Definition: utils.h:18
void rpcdqm::utils::labelYAxisRoll ( MonitorElement myMe,
int  region,
int  ring,
bool  useRollInfo 
)
inline

Definition at line 283 of file utils.h.

References MonitorElement::getNbinsY(), createfilelist::int, MonitorElement::setBinLabel(), rpcdqm::RPCMEHelper::setNoAlphanumeric(), and SiPixelPhase1HitsV_cfi::ylabel.

Referenced by RPCMonitorDigi::bookSectorRingME(), RPCMonitorDigi::bookWheelDiskME(), RPCEfficiencySecond::dqmEndJob(), RPCClusterSizeTest::myBooker(), RPCNoisyStripTest::myBooker(), RPCMultiplicityTest::myBooker(), RPCOccupancyTest::myBooker(), RPCDeadChannelTest::myBooker(), and RPCChamberQuality::myBooker().

283  {
284 
285  //before do some checks
286  if (!myMe) return;
288 
289  //set bin labels
290  if(region == 0){
291 
292  //initialize label vector
293  this->dolabeling(useRollInfo);
294  if(ring == -2 || ring == 2) ylabel[7]=ylabel[0];
295 
296  for(int y = 1; y<= myMe->getNbinsY() && y<22; y++)
297  myMe->setBinLabel(y, ylabel[y], 2);
298 
299  }else{//Endcap
300 
301  this->doEndcapLabeling(useRollInfo);
302 
303  for(int y = 1; y<= myMe->getNbinsY() && y<(int)endcapYLabels_.size(); y++)
304  myMe->setBinLabel(y, endcapYLabels_[y], 2);
305 
306  }
307  }
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:459
std::vector< std::string > endcapYLabels_
Definition: utils.h:455
void dolabeling(bool useRollInfo)
Definition: utils.h:160
static void setNoAlphanumeric(MonitorElement *myMe)
Definition: utils.h:18
void doEndcapLabeling(bool useRollInfo)
Definition: utils.h:221
std::vector<int> rpcdqm::utils::SectorStrips1 ( )
inline

Definition at line 155 of file utils.h.

155  {
156  return Wvector1;
157  }
std::vector< int > Wvector1
Definition: utils.h:458
std::vector<int> rpcdqm::utils::SectorStrips2 ( )
inline

Definition at line 151 of file utils.h.

151  {
152  return Wvector2;
153  }
std::vector< int > Wvector2
Definition: utils.h:457
std::string rpcdqm::utils::YLabel ( int  i)
inline

Definition at line 242 of file utils.h.

References mps_fire::i, and SiPixelPhase1HitsV_cfi::ylabel.

242  {
243 
244  return ylabel[i];
245 
246  }
std::string ylabel[22]
Definition: utils.h:459

Member Data Documentation

int rpcdqm::utils::_cnr
private

Definition at line 453 of file utils.h.

int rpcdqm::utils::ch
private

Definition at line 454 of file utils.h.

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

Definition at line 456 of file utils.h.

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

Definition at line 455 of file utils.h.

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

Definition at line 458 of file utils.h.

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

Definition at line 457 of file utils.h.

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