CMS 3D CMS Logo

RPCBookDetUnitME.cc
Go to the documentation of this file.
6 #include <iomanip>
7 
9  const RPCDetId& detId,
10  const RPCGeometry* rpcGeo,
11  const std::string& recHitType,
12  std::map<std::string, MonitorElement*>& meMap) {
13  RPCBookFolderStructure folderStr;
14  std::string folder = subsystemFolder_ + "/" + recHitType + "/" + folderStr.folderStructure(detId);
15 
16  ibooker.setCurrentFolder(folder);
17 
18  //get number of strips in current roll
19  int nstrips = this->stripsInRoll(detId, rpcGeo);
20  if (nstrips == 0) {
21  nstrips = 1;
22  }
23 
25  RPCGeomServ RPCname(detId);
26  std::string nameRoll = "";
27 
29  nameRoll = RPCname.name();
30  } else {
31  nameRoll = RPCname.chambername();
32 
33  if (detId.region() != 0 || //Endcaps
34  (abs(detId.ring()) == 2 && detId.station() == 2 && detId.layer() != 1) || //Wheel -/+2 RB2out
35  (abs(detId.ring()) != 2 && detId.station() == 2 && detId.layer() == 1)) {
36  nstrips *= 3;
37  } //Wheel -1,0,+1 RB2in
38  else {
39  nstrips *= 2;
40  }
41  }
42 
43  std::stringstream os;
44  os.str("");
45  os << "Occupancy_" << nameRoll;
46  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), nstrips, 0.5, nstrips + 0.5);
47 
48  os.str("");
49  os << "BXDistribution_" << nameRoll;
50  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 7, -3.5, 3.5);
51 
52  if (detId.region() == 0) {
53  os.str("");
54  os << "ClusterSize_" << nameRoll;
55  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 15, 0.5, 15.5);
56 
57  os.str("");
58  os << "Multiplicity_" << nameRoll;
59  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 30, 0.5, 30.5);
60 
61  } else {
62  os.str("");
63  os << "ClusterSize_" << nameRoll;
64  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 10, 0.5, 10.5);
65 
66  os.str("");
67  os << "Multiplicity_" << nameRoll;
68  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 15, 0.5, 15.5);
69  }
70 
71  os.str("");
72  os << "NumberOfClusters_" << nameRoll;
73  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 10, 0.5, 10.5);
74 }
75 
77  const std::string& recHitType,
78  std::map<std::string, MonitorElement*>& meMap) {
79  std::stringstream os;
80 
81  for (int wheel = -2; wheel <= 2; wheel++) {
82  os.str("");
83  os << subsystemFolder_ << "/" << recHitType << "/Barrel/Wheel_" << wheel << "/SummaryBySectors";
84  ibooker.setCurrentFolder(os.str());
85 
86  for (int sector = 1; sector <= 12; sector++) {
87  os.str("");
88  os << "Occupancy_Wheel_" << wheel << "_Sector_" << sector;
89 
90  if (sector == 9 || sector == 11)
91  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 91, 0.5, 91.5, 15, 0.5, 15.5);
92  else if (sector == 4)
93  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 91, 0.5, 91.5, 21, 0.5, 21.5);
94  else
95  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 91, 0.5, 91.5, 17, 0.5, 17.5);
96 
97  meMap[os.str()]->setAxisTitle("strip", 1);
98  rpcdqm::utils rpcUtils;
99  rpcUtils.labelYAxisRoll(meMap[os.str()], 0, wheel, true);
100  }
101  }
102 
103  for (int region = -1; region <= 1; region++) {
104  if (region == 0)
105  continue;
106 
107  std::string regionName = "Endcap-";
108  if (region == 1)
109  regionName = "Endcap+";
110 
111  for (int disk = 1; disk <= RPCMonitorDigi::numberOfDisks_; disk++) {
112  os.str("");
113  os << subsystemFolder_ << "/" << recHitType << "/" << regionName << "/Disk_" << (region * disk)
114  << "/SummaryByRings/";
115 
116  ibooker.setCurrentFolder(os.str());
117 
118  for (int ring = RPCMonitorDigi::numberOfInnerRings_; ring <= 3; ring++) {
119  os.str("");
120  os << "Occupancy_Disk_" << (region * disk) << "_Ring_" << ring << "_CH01-CH18";
121 
122  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 96, 0.5, 96.5, 18, 0.5, 18.5);
123  meMap[os.str()]->setAxisTitle("strip", 1);
125 
126  std::stringstream yLabel;
127  for (int i = 1; i <= 18; i++) {
128  yLabel.str("");
129  yLabel << "R" << ring << "_CH" << std::setw(2) << std::setfill('0') << i;
130  meMap[os.str()]->setBinLabel(i, yLabel.str(), 2);
131  }
132 
133  for (int i = 1; i <= 96; i++) {
134  if (i == 1)
135  meMap[os.str()]->setBinLabel(i, "1", 1);
136  else if (i == 16)
137  meMap[os.str()]->setBinLabel(i, "RollA", 1);
138  else if (i == 32)
139  meMap[os.str()]->setBinLabel(i, "32", 1);
140  else if (i == 33)
141  meMap[os.str()]->setBinLabel(i, "1", 1);
142  else if (i == 48)
143  meMap[os.str()]->setBinLabel(i, "RollB", 1);
144  else if (i == 64)
145  meMap[os.str()]->setBinLabel(i, "32", 1);
146  else if (i == 65)
147  meMap[os.str()]->setBinLabel(i, "1", 1);
148  else if (i == 80)
149  meMap[os.str()]->setBinLabel(i, "RollC", 1);
150  else if (i == 96)
151  meMap[os.str()]->setBinLabel(i, "32", 1);
152  else
153  meMap[os.str()]->setBinLabel(i, "", 1);
154  }
155 
156  os.str("");
157  os << "Occupancy_Disk_" << (region * disk) << "_Ring_" << ring << "_CH19-CH36";
158 
159  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 96, 0.5, 96.5, 18, 18.5, 36.5);
160  meMap[os.str()]->setAxisTitle("strip", 1);
162 
163  for (int i = 1; i <= 18; i++) {
164  yLabel.str("");
165  yLabel << "R" << ring << "_CH" << i + 18;
166  meMap[os.str()]->setBinLabel(i, yLabel.str(), 2);
167  }
168 
169  for (int i = 1; i <= 96; i++) {
170  if (i == 1)
171  meMap[os.str()]->setBinLabel(i, "1", 1);
172  else if (i == 16)
173  meMap[os.str()]->setBinLabel(i, "RollA", 1);
174  else if (i == 32)
175  meMap[os.str()]->setBinLabel(i, "32", 1);
176  else if (i == 33)
177  meMap[os.str()]->setBinLabel(i, "1", 1);
178  else if (i == 48)
179  meMap[os.str()]->setBinLabel(i, "RollB", 1);
180  else if (i == 64)
181  meMap[os.str()]->setBinLabel(i, "32", 1);
182  else if (i == 65)
183  meMap[os.str()]->setBinLabel(i, "1", 1);
184  else if (i == 80)
185  meMap[os.str()]->setBinLabel(i, "RollC", 1);
186  else if (i == 96)
187  meMap[os.str()]->setBinLabel(i, "32", 1);
188  else
189  meMap[os.str()]->setBinLabel(i, "", 1);
190  }
191 
192  } //loop ring
193  } //loop disk
194  } //loop region
195 }
196 
198  const std::string& recHitType,
199  std::map<std::string, MonitorElement*>& meMap) {
200  ibooker.setCurrentFolder(subsystemFolder_ + "/" + recHitType + "/" + globalFolder_);
201 
202  std::stringstream os, label, name, title;
203  rpcdqm::utils rpcUtils;
204 
205  for (int wheel = -2; wheel <= 2; wheel++) { //Loop on wheel
206  os.str("");
207  os << "1DOccupancy_Wheel_" << wheel;
208  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 12, 0.5, 12.5);
209  for (int i = 1; i < 12; i++) {
210  label.str("");
211  label << "Sec" << i;
212  meMap[os.str()]->setBinLabel(i, label.str(), 1);
213  }
214 
215  os.str("");
216  os << "Occupancy_Roll_vs_Sector_Wheel_" << wheel;
217  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
218  rpcUtils.labelXAxisSector(meMap[os.str()]);
219  rpcUtils.labelYAxisRoll(meMap[os.str()], 0, wheel, true);
220 
221  os.str("");
222  os << "BxDistribution_Wheel_" << wheel;
223  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 9, -4.5, 4.5);
224 
225  for (int layer = 1; layer <= 6; layer++) {
226  name.str("");
227  title.str("");
228  name << "ClusterSize_Wheel_" << wheel << "_Layer" << layer;
229  title << "ClusterSize - Wheel " << wheel << " Layer" << layer;
230  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
231  }
232 
233  } //end loop on wheel
234 
235  for (int disk = -RPCMonitorDigi::numberOfDisks_; disk <= RPCMonitorDigi::numberOfDisks_; disk++) {
236  if (disk == 0)
237  continue;
238 
239  os.str("");
240  os << "Occupancy_Ring_vs_Segment_Disk_" << disk;
241  meMap[os.str()] = ibooker.book2D(os.str(), os.str(), 36, 0.5, 36.5, 6, 0.5, 6.5);
242 
243  rpcUtils.labelXAxisSegment(meMap[os.str()]);
244  rpcUtils.labelYAxisRing(meMap[os.str()], 2, true);
245 
246  os.str("");
247  os << "BxDistribution_Disk_" << disk;
248  meMap[os.str()] = ibooker.book1D(os.str(), os.str(), 9, -4.5, 4.5);
249 
250  for (int ring = RPCMonitorDigi::numberOfInnerRings_; ring <= 3; ring++) {
251  name.str("");
252  title.str("");
253  name << "ClusterSize_Disk_" << disk << "_Ring" << ring;
254  title << "ClusterSize - Disk" << disk << " Ring" << ring;
255  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
256  }
257  }
258 
259  for (int ring = RPCMonitorDigi::numberOfInnerRings_; ring <= 3; ring++) {
260  os.str("");
261  os << "1DOccupancy_Ring_" << ring;
262  meMap[os.str()] = ibooker.book1D(os.str(),
263  os.str(),
265  0.5,
266  ((double)RPCMonitorDigi::numberOfDisks_ * 2.0) + 0.5);
267  for (int xbin = 1; xbin <= RPCMonitorDigi::numberOfDisks_ * 2; xbin++) {
268  label.str("");
269  if (xbin < RPCMonitorDigi::numberOfDisks_ + 1)
270  label << "Disk " << (xbin - (RPCMonitorDigi::numberOfDisks_ + 1));
271  else
272  label << "Disk " << (xbin - RPCMonitorDigi::numberOfDisks_);
273  meMap[os.str()]->setBinLabel(xbin, label.str(), 1);
274  }
275  }
276 }
277 
278 //returns the number of strips in each roll
279 int RPCMonitorDigi::stripsInRoll(const RPCDetId& id, const RPCGeometry* rpcGeo) const {
280  const RPCRoll* rpcRoll = rpcGeo->roll(id);
281  if (!rpcRoll)
282  return 1;
283 
284  return rpcRoll->nstrips();
285 }
286 
288  const std::string& recHitType,
289  std::map<std::string, MonitorElement*>& meMap) {
290  std::string currentFolder = subsystemFolder_ + "/" + recHitType + "/" + globalFolder_;
291  ibooker.setCurrentFolder(currentFolder);
292 
293  std::stringstream name;
294  std::stringstream title;
295  for (int r = 0; r < 3; r++) { //RPC regions are E-, B, and E+
296 
298  //Cluster size
299  name.str("");
300  title.str("");
301  name << "ClusterSize_" << regionName;
302  title << "ClusterSize - " << regionName;
303  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
304  }
305 
306  //Number of Cluster
307  name.str("");
308  title.str("");
309  name << "NumberOfClusters_Barrel";
310  title << "Number of Clusters per Event - Barrel";
311  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 30, 0.5, 30.5);
312 
313  name.str("");
314  title.str("");
315  name << "NumberOfClusters_Endcap+";
316  title << "Number of Clusters per Event - Endcap+";
317  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 15, 0.5, 15.5);
318 
319  name.str("");
320  title.str("");
321  name << "NumberOfClusters_Endcap-";
322  title << "Number of Clusters per Event - Endcap-";
323  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 15, 0.5, 15.5);
324 
325  //Number of Digis
326  name.str("");
327  title.str("");
328  name << "Multiplicity_Barrel";
329  title << "Multiplicity per Event per Roll - Barrel";
330  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 50, 0.5, 50.5);
331 
332  name.str("");
333  title.str("");
334  name << "Multiplicity_Endcap+";
335  title << "Multiplicity per Event per Roll - Endcap+";
336  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 32, 0.5, 32.5);
337 
338  name.str("");
339  title.str("");
340  name << "Multiplicity_Endcap-";
341  title << "Multiplicity per Event per Roll - Endcap-";
342  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 32, 0.5, 32.5);
343 
344  for (int layer = 1; layer <= 6; layer++) {
345  name.str("");
346  title.str("");
347  name << "ClusterSize_Layer" << layer;
348  title << "ClusterSize - Layer" << layer;
349  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
350  }
351 
352  for (int ring = RPCMonitorDigi::numberOfInnerRings_; ring <= 3; ring++) {
353  name.str("");
354  title.str("");
355  name << "ClusterSize_Ring" << ring;
356  title << "ClusterSize - Ring" << ring;
357  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
358  }
359 
360  meMap["Occupancy_for_Endcap"] = ibooker.book2D("Occupancy_for_Endcap",
361  "Occupancy Endcap",
363  0.5,
364  ((float)RPCMonitorDigi::numberOfDisks_ * 2.0) + 0.5,
365  2,
366  1.5,
367  3.5);
368  meMap["Occupancy_for_Endcap"]->setAxisTitle("Disk", 1);
369  meMap["Occupancy_for_Endcap"]->setAxisTitle("Ring", 2);
370 
371  std::stringstream binlabel;
372  for (int bin = 1; bin <= RPCMonitorDigi::numberOfDisks_ * 2; bin++) {
373  binlabel.str("");
374  if (bin < (RPCMonitorDigi::numberOfDisks_ + 1)) { //negative endcap
375  binlabel << (bin - (RPCMonitorDigi::numberOfDisks_ + 1));
376  } else { //positive endcaps
377  binlabel << (bin - RPCMonitorDigi::numberOfDisks_);
378  }
379  meMap["Occupancy_for_Endcap"]->setBinLabel(bin, binlabel.str(), 1);
380  }
381 
382  meMap["Occupancy_for_Endcap"]->setBinLabel(1, "2", 2);
383  meMap["Occupancy_for_Endcap"]->setBinLabel(2, "3", 2);
384 
385  meMap["Occupancy_for_Barrel"] =
386  ibooker.book2D("Occupancy_for_Barrel", "Occupancy Barrel", 12, 0.5, 12.5, 5, -2.5, 2.5);
387  meMap["Occupancy_for_Barrel"]->setAxisTitle("Sec", 1);
388  meMap["Occupancy_for_Barrel"]->setAxisTitle("Wheel", 2);
389 
390  for (int bin = 1; bin <= 12; bin++) {
391  binlabel.str("");
392  binlabel << bin;
393  meMap["Occupancy_for_Barrel"]->setBinLabel(bin, binlabel.str(), 1);
394  if (bin <= 5) {
395  binlabel.str("");
396  binlabel << (bin - 3);
397  meMap["Occupancy_for_Barrel"]->setBinLabel(bin, binlabel.str(), 2);
398  }
399  }
400 }
virtual std::string chambername()
Definition: RPCGeomServ.cc:89
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
Definition: DQMStore.cc:239
std::string globalFolder_
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:418
int nstrips() const
Definition: RPCRoll.cc:24
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:247
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:265
void bookSectorRingME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement at Sector/Ring level.
char const * label
virtual std::string name()
Definition: RPCGeomServ.cc:11
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:291
int stripsInRoll(const RPCDetId &id, const RPCGeometry *rpcGeo) const
int ring() const
Definition: RPCDetId.h:59
void bookRollME(DQMStore::IBooker &, const RPCDetId &, const RPCGeometry *rpcGeo, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement for one RPCDetId (= roll)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static void setNoAlphanumeric(MonitorElement *myMe)
Definition: utils.h:18
static const std::array< std::string, 3 > regionNames_
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:231
int layer() const
Definition: RPCDetId.h:85
std::string folderStructure(RPCDetId detId)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Definition: DQMStore.cc:266
void bookWheelDiskME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at Wheel/Disk level.
void bookRegionME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at region (Barrel/Endcap) level.
std::string subsystemFolder_
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:50
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
int station() const
Definition: RPCDetId.h:78