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

◆ detId2ChamberLabel()

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

Definition at line 373 of file utils.h.

373  {
374  if (_id.region() == 0) { //Barrel
375  if (_id.station() == 1) { // Station1
376  if (_id.layer() == 1) {
377  ChLabel = "RB1in";
378 
379  } else {
380  ChLabel = "RB1out";
381  }
382 
383  } else if (_id.station() == 2) { //Station 2
384  if (_id.layer() == 1) {
385  ChLabel = "RB2in";
386  } else {
387  ChLabel = "RB2out";
388  }
389  } else if (_id.station() == 3) { //Station 3
390  if (_id.subsector() == 1) {
391  ChLabel = "RB3+";
392  } else {
393  ChLabel = "RB3-";
394  }
395  } else if (_id.station() == 4) { //Station 4
396  if (_id.sector() == 4) {
397  if (_id.subsector() == 1) {
398  ChLabel = "RB4-";
399 
400  } else if (_id.subsector() == 2) {
401  ChLabel = "RB4+";
402  } else if (_id.subsector() == 3) {
403  ChLabel = "RB4--";
404  } else if (_id.subsector() == 4) {
405  ChLabel = "RB4++";
406  }
407  } else {
408  if (_id.subsector() == 1)
409  ChLabel = "RB4-";
410  else
411  ChLabel = "RB4-";
412  }
413  }
414  } else { //Endcap
415  }
416  return ChLabel;
417  }

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

◆ detId2ChamberNr()

int rpcdqm::utils::detId2ChamberNr ( const RPCDetId _id)
inline

Definition at line 327 of file utils.h.

327  {
328  if (_id.region() == 0) { //Barrel
329  if (_id.station() == 1) { // Station1
330  if (_id.layer() == 1) {
331  ch = 1; //RB1in
332 
333  } else {
334  ch = 2; //RB1out
335  }
336 
337  } else if (_id.station() == 2) { //Station 2
338  if (_id.layer() == 1) {
339  ch = 3; //RB2in
340  } else {
341  ch = 4; //RB2out
342  }
343  } else if (_id.station() == 3) { //Station 3
344  if (_id.subsector() == 1) {
345  ch = 5; //RB3+
346  } else {
347  ch = 6; //RB3-
348  }
349  } else if (_id.station() == 4) { //Station 4
350  if (_id.sector() == 4) {
351  if (_id.subsector() == 1) {
352  ch = 7; //RB4-
353 
354  } else if (_id.subsector() == 2) {
355  ch = 8; //RB4+
356  } else if (_id.subsector() == 3) {
357  ch = 9; //RB4--
358  } else if (_id.subsector() == 4) {
359  ch = 10; //RB4++
360  }
361  } else {
362  if (_id.subsector() == 1)
363  ch = 7; //RB4-
364  else
365  ch = 8; //RB4+
366  }
367  }
368  } else { //Endcap
369  }
370  return ch;
371  }

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

◆ detId2RollNr()

int rpcdqm::utils::detId2RollNr ( const RPCDetId _id)
inline

Definition at line 31 of file utils.h.

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  }

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

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

◆ doEndcapLabeling()

void rpcdqm::utils::doEndcapLabeling ( bool  useRollInfo)
inline

Definition at line 208 of file utils.h.

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

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

Referenced by labelYAxisRoll().

◆ dolabeling()

void rpcdqm::utils::dolabeling ( bool  useRollInfo)
inline

Definition at line 154 of file utils.h.

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

References ylabel.

Referenced by labelYAxisRoll().

◆ fillvect()

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  }

References Wvector1, and Wvector2.

◆ labelXAxisSector()

void rpcdqm::utils::labelXAxisSector ( MonitorElement myMe)
inline

Definition at line 231 of file utils.h.

231  {
232  //before do some checks
233  if (!myMe)
234  return;
236 
237  std::stringstream xLabel;
238 
239  for (int x = 1; x <= myMe->getNbinsX(); x++) {
240  xLabel.str("");
241  xLabel << "Sec" << x;
242  myMe->setBinLabel(x, xLabel.str(), 1);
243  }
244  }

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

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

◆ labelXAxisSegment()

void rpcdqm::utils::labelXAxisSegment ( MonitorElement myMe)
inline

Definition at line 247 of file utils.h.

247  {
248  //before do some checks
249  if (!myMe)
250  return;
252 
253  std::stringstream xLabel;
254 
255  myMe->setAxisTitle("Segments", 1);
256 
257  for (int x = 1; x <= myMe->getNbinsX(); x++) {
258  xLabel.str("");
259  xLabel << x;
260  myMe->setBinLabel(x, xLabel.str(), 1);
261  }
262  }

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

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

◆ labelYAxisRing()

void rpcdqm::utils::labelYAxisRing ( MonitorElement myMe,
int  numberOfRings,
bool  useRollInfo 
)
inline

Definition at line 291 of file utils.h.

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

References dqm::impl::MonitorElement::getNbinsY(), SummaryClient_cfi::labels, pfIsolationCalculator_cfi::numberOfRings, dqm::impl::MonitorElement::setBinLabel(), rpcdqm::RPCMEHelper::setNoAlphanumeric(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

◆ labelYAxisRoll()

void rpcdqm::utils::labelYAxisRoll ( MonitorElement myMe,
int  region,
int  ring,
bool  useRollInfo 
)
inline

Definition at line 265 of file utils.h.

265  {
266  //before do some checks
267  if (!myMe)
268  return;
270 
271  //set bin labels
272  if (region == 0) {
273  //initialize label vector
274  this->dolabeling(useRollInfo);
275  if (ring == -2 || ring == 2)
276  ylabel[7] = ylabel[0];
277 
278  for (int y = 1; y <= myMe->getNbinsY() && y < 22; y++)
279  myMe->setBinLabel(y, ylabel[y], 2);
280 
281  } else { //Endcap
282 
283  this->doEndcapLabeling(useRollInfo);
284 
285  for (int y = 1; y <= myMe->getNbinsY() && y < (int)endcapYLabels_.size(); y++)
286  myMe->setBinLabel(y, endcapYLabels_[y], 2);
287  }
288  }

References doEndcapLabeling(), dolabeling(), endcapYLabels_, dqm::impl::MonitorElement::getNbinsY(), createfilelist::int, HLT_FULL_cff::region, relativeConstraints::ring, dqm::impl::MonitorElement::setBinLabel(), rpcdqm::RPCMEHelper::setNoAlphanumeric(), and ylabel.

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

◆ SectorStrips1()

std::vector<int> rpcdqm::utils::SectorStrips1 ( )
inline

Definition at line 152 of file utils.h.

152 { return Wvector1; }

References Wvector1.

◆ SectorStrips2()

std::vector<int> rpcdqm::utils::SectorStrips2 ( )
inline

Definition at line 150 of file utils.h.

150 { return Wvector2; }

References Wvector2.

◆ YLabel()

std::string rpcdqm::utils::YLabel ( int  i)
inline

Definition at line 228 of file utils.h.

228 { return ylabel[i]; }

References mps_fire::i, and ylabel.

Member Data Documentation

◆ _cnr

int rpcdqm::utils::_cnr
private

Definition at line 420 of file utils.h.

Referenced by detId2RollNr().

◆ ch

int rpcdqm::utils::ch
private

Definition at line 421 of file utils.h.

Referenced by detId2ChamberNr(), and doEndcapLabeling().

◆ ChLabel

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

Definition at line 423 of file utils.h.

Referenced by detId2ChamberLabel().

◆ endcapYLabels_

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

Definition at line 422 of file utils.h.

Referenced by doEndcapLabeling(), and labelYAxisRoll().

◆ Wvector1

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

Definition at line 425 of file utils.h.

Referenced by fillvect(), and SectorStrips1().

◆ Wvector2

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

Definition at line 424 of file utils.h.

Referenced by fillvect(), and SectorStrips2().

◆ ylabel

std::string rpcdqm::utils::ylabel[22]
private
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
mps_fire.i
i
Definition: mps_fire.py:428
RPCDetId::station
int station() const
Definition: RPCDetId.h:78
RPCDetId::region
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
pfIsolationCalculator_cfi.numberOfRings
numberOfRings
Definition: pfIsolationCalculator_cfi.py:9
RPCDetId::subsector
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel,...
Definition: RPCDetId.h:88
rpcdqm::RPCMEHelper::setNoAlphanumeric
static void setNoAlphanumeric(MonitorElement *myMe)
Definition: utils.h:18
rpcdqm::utils::ylabel
std::string ylabel[22]
Definition: utils.h:426
rpcdqm::utils::doEndcapLabeling
void doEndcapLabeling(bool useRollInfo)
Definition: utils.h:208
rpcdqm::utils::ChLabel
std::string ChLabel
Definition: utils.h:423
nsub
const int nsub
Definition: CMTRawAnalyzer.h:421
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
rpcdqm::utils::Wvector2
std::vector< int > Wvector2
Definition: utils.h:424
RPCDetId::roll
int roll() const
Definition: RPCDetId.h:92
rpcdqm::utils::_cnr
int _cnr
Definition: utils.h:420
dqm::impl::MonitorElement::getNbinsY
virtual int getNbinsY() const
get # of bins in Y-axis
Definition: MonitorElement.cc:580
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88272
createfilelist.int
int
Definition: createfilelist.py:10
rpcdqm::utils::Wvector1
std::vector< int > Wvector1
Definition: utils.h:425
dqm::impl::MonitorElement::setBinLabel
virtual 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)
Definition: MonitorElement.cc:771
rpcdqm::utils::endcapYLabels_
std::vector< std::string > endcapYLabels_
Definition: utils.h:422
RPCDetId::ring
int ring() const
Definition: RPCDetId.h:59
alignCSCRings.r
r
Definition: alignCSCRings.py:93
rpcdqm::utils::ch
int ch
Definition: utils.h:421
rpcdqm::utils::dolabeling
void dolabeling(bool useRollInfo)
Definition: utils.h:154
dqm::impl::MonitorElement::getNbinsX
virtual int getNbinsX() const
get # of bins in X-axis
Definition: MonitorElement.cc:574
genVertex_cff.x
x
Definition: genVertex_cff.py:12
RPCDetId::sector
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
RPCDetId::layer
int layer() const
Definition: RPCDetId.h:85
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800