CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RPCBookDetUnitME.cc
Go to the documentation of this file.
6 
8  const RPCDetId& detId,
9  const RPCGeometry* rpcGeo,
10  const std::string& recHitType,
11  std::map<std::string, MonitorElement*>& meMap) {
12  ibooker.setCurrentFolder(
14 
15  //get number of strips in current roll
16  int nstrips = this->stripsInRoll(detId, rpcGeo);
17  if (nstrips == 0) {
18  nstrips = 1;
19  }
20 
22  const std::string nameRoll = RPCNameHelper::name(detId, useRollInfo_);
23 
25  if (detId.region() != 0 || //Endcaps
26  (abs(detId.ring()) == 2 && detId.station() == 2 && detId.layer() != 1) || //Wheel -/+2 RB2out
27  (abs(detId.ring()) != 2 && detId.station() == 2 && detId.layer() == 1)) {
28  nstrips *= 3;
29  } //Wheel -1,0,+1 RB2in
30  else {
31  nstrips *= 2;
32  }
33  }
34 
35  std::string tmpStr;
36 
37  tmpStr = "Occupancy_" + nameRoll;
38  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, nstrips, 0.5, nstrips + 0.5);
39 
40  tmpStr = "BXDistribution_" + nameRoll;
41  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 7, -3.5, 3.5);
42 
43  if (detId.region() == 0) {
44  tmpStr = "ClusterSize_" + nameRoll;
45  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 15, 0.5, 15.5);
46 
47  tmpStr = "Multiplicity_" + nameRoll;
48  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 30, 0.5, 30.5);
49 
50  } else {
51  tmpStr = "ClusterSize_" + nameRoll;
52  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 10, 0.5, 10.5);
53 
54  tmpStr = "Multiplicity_" + nameRoll;
55  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 15, 0.5, 15.5);
56  }
57 
58  tmpStr = "NumberOfClusters_" + nameRoll;
59  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 10, 0.5, 10.5);
60 }
61 
63  const std::string& recHitType,
64  std::map<std::string, MonitorElement*>& meMap) {
65  for (int wheel = -2; wheel <= 2; wheel++) {
66  ibooker.setCurrentFolder(
67  fmt::format("{}/{}/Barrel/Wheel_{}/SummaryBySectors", subsystemFolder_, recHitType, wheel));
68 
69  for (int sector = 1; sector <= 12; sector++) {
70  const std::string meName = fmt::format("Occupancy_Wheel_{}_Sector_{}", wheel, sector);
71 
72  if (sector == 9 || sector == 11)
73  meMap[meName] = ibooker.book2D(meName, meName, 91, 0.5, 91.5, 15, 0.5, 15.5);
74  else if (sector == 4)
75  meMap[meName] = ibooker.book2D(meName, meName, 91, 0.5, 91.5, 21, 0.5, 21.5);
76  else
77  meMap[meName] = ibooker.book2D(meName, meName, 91, 0.5, 91.5, 17, 0.5, 17.5);
78 
79  meMap[meName]->setAxisTitle("strip", 1);
80  RPCRollMapHisto::setBarrelRollAxis(meMap[meName], wheel, 2, true);
81  }
82  }
83 
84  for (int region = -1; region <= 1; region++) {
85  if (region == 0)
86  continue;
87 
88  std::string regionName = "Endcap-";
89  if (region == 1)
90  regionName = "Endcap+";
91 
92  for (int disk = 1; disk <= RPCMonitorDigi::numberOfDisks_; disk++) {
93  ibooker.setCurrentFolder(
94  fmt::format("{}/{}/{}/Disk_{}/SummaryByRings/", subsystemFolder_, recHitType, regionName, region * disk));
95 
96  for (int ring = RPCMonitorDigi::numberOfInnerRings_; ring <= 3; ring++) {
97  const std::string meName1 = fmt::format("Occupancy_Disk_{}_Ring_{}_CH01-CH18", (region * disk), ring);
98 
99  auto me1 = ibooker.book2D(meName1, meName1, 96, 0.5, 96.5, 18, 0.5, 18.5);
100  me1->setAxisTitle("strip", 1);
101 
102  for (int i = 1; i <= 18; i++) {
103  const std::string ylabel = fmt::format("R{}_CH{:02d}", ring, i);
104  me1->setBinLabel(i, ylabel, 2);
105  }
106 
107  me1->setBinLabel(1, "1", 1);
108  me1->setBinLabel(16, "RollA", 1);
109  me1->setBinLabel(32, "32", 1);
110  me1->setBinLabel(33, "1", 1);
111  me1->setBinLabel(48, "RollB", 1);
112  me1->setBinLabel(64, "32", 1);
113  me1->setBinLabel(65, "1", 1);
114  me1->setBinLabel(80, "RollC", 1);
115  me1->setBinLabel(96, "32", 1);
116 
117  const std::string meName2 = fmt::format("Occupancy_Disk_{}_Ring_{}_CH19-CH36", (region * disk), ring);
118 
119  auto me2 = ibooker.book2D(meName2, meName2, 96, 0.5, 96.5, 18, 18.5, 36.5);
120  me2->setAxisTitle("strip", 1);
121 
122  for (int i = 1; i <= 18; i++) {
123  const std::string ylabel = fmt::format("R{}_CH{:02d}", ring, i + 18);
124  me2->setBinLabel(i, ylabel, 2);
125  }
126 
127  me2->setBinLabel(1, "1", 1);
128  me2->setBinLabel(16, "RollA", 1);
129  me2->setBinLabel(32, "32", 1);
130  me2->setBinLabel(33, "1", 1);
131  me2->setBinLabel(48, "RollB", 1);
132  me2->setBinLabel(64, "32", 1);
133  me2->setBinLabel(65, "1", 1);
134  me2->setBinLabel(80, "RollC", 1);
135  me2->setBinLabel(96, "32", 1);
136 
137  meMap[meName1] = me1;
138  meMap[meName2] = me2;
139  } //loop ring
140  } //loop disk
141  } //loop region
142 }
143 
145  const std::string& recHitType,
146  std::map<std::string, MonitorElement*>& meMap) {
147  ibooker.setCurrentFolder(subsystemFolder_ + "/" + recHitType + "/" + globalFolder_);
148 
149  std::string tmpStr;
150 
151  for (int wheel = -2; wheel <= 2; wheel++) { //Loop on wheel
152  tmpStr = fmt::format("1DOccupancy_Wheel_{}", wheel);
153  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 12, 0.5, 12.5);
154  for (int i = 1; i <= 12; ++i) {
155  meMap[tmpStr]->setBinLabel(i, fmt::format("Sec{}", i), 1);
156  }
157 
158  tmpStr = fmt::format("Occupancy_Roll_vs_Sector_Wheel_{}", wheel);
159  meMap[tmpStr] = RPCRollMapHisto::bookBarrel(ibooker, wheel, tmpStr, tmpStr, true);
160 
161  tmpStr = fmt::format("BxDistribution_Wheel_{}", wheel);
162  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 9, -4.5, 4.5);
163 
164  for (int layer = 1; layer <= 6; layer++) {
165  const std::string name = fmt::format("ClusterSize_Wheel_{}_Layer{}", wheel, layer);
166  const std::string title = fmt::format("ClusterSize - Wheel {} Layer{}", wheel, layer);
167  meMap[name] = ibooker.book1D(name, title, 16, 0.5, 16.5);
168  }
169 
170  } //end loop on wheel
171 
172  for (int disk = -RPCMonitorDigi::numberOfDisks_; disk <= RPCMonitorDigi::numberOfDisks_; disk++) {
173  if (disk == 0)
174  continue;
175 
176  tmpStr = fmt::format("Occupancy_Ring_vs_Segment_Disk_{}", disk);
177  meMap[tmpStr] = RPCRollMapHisto::bookEndcap(ibooker, disk, tmpStr, tmpStr, true);
178 
179  tmpStr = fmt::format("BxDistribution_Disk_{}", disk);
180  meMap[tmpStr] = ibooker.book1D(tmpStr, tmpStr, 9, -4.5, 4.5);
181 
182  for (int ring = RPCMonitorDigi::numberOfInnerRings_; ring <= 3; ring++) {
183  const std::string name = fmt::format("ClusterSize_Disk_{}_Ring{}", disk, ring);
184  const std::string title = fmt::format("ClusterSize - Disk{} Ring{}", disk, ring);
185  meMap[name] = ibooker.book1D(name, title, 16, 0.5, 16.5);
186  }
187  }
188 
189  for (int ring = RPCMonitorDigi::numberOfInnerRings_; ring <= 3; ring++) {
190  const std::string meName = fmt::format("1DOccupancy_Ring_{}", ring);
191  meMap[meName] = ibooker.book1D(
192  meName, meName, RPCMonitorDigi::numberOfDisks_ * 2, 0.5, (RPCMonitorDigi::numberOfDisks_ * 2.0) + 0.5);
193  for (int xbin = 1; xbin <= RPCMonitorDigi::numberOfDisks_ * 2; xbin++) {
195  if (xbin < RPCMonitorDigi::numberOfDisks_ + 1)
196  label = fmt::format("Disk {}", (xbin - (RPCMonitorDigi::numberOfDisks_ + 1)));
197  else
198  label = fmt::format("Disk {}", (xbin - RPCMonitorDigi::numberOfDisks_));
199  meMap[meName]->setBinLabel(xbin, label, 1);
200  }
201  }
202 }
203 
204 //returns the number of strips in each roll
205 int RPCMonitorDigi::stripsInRoll(const RPCDetId& id, const RPCGeometry* rpcGeo) const {
206  const RPCRoll* rpcRoll = rpcGeo->roll(id);
207  if (!rpcRoll)
208  return 1;
209 
210  return rpcRoll->nstrips();
211 }
212 
214  const std::string& recHitType,
215  std::map<std::string, MonitorElement*>& meMap) {
216  std::string currentFolder = subsystemFolder_ + "/" + recHitType + "/" + globalFolder_;
217  ibooker.setCurrentFolder(currentFolder);
218 
219  std::stringstream name;
220  std::stringstream title;
221  for (int r = 0; r < 3; r++) { //RPC regions are E-, B, and E+
222 
224  //Cluster size
225  name.str("");
226  title.str("");
227  name << "ClusterSize_" << regionName;
228  title << "ClusterSize - " << regionName;
229  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
230  }
231 
232  //Number of Cluster
233  name.str("");
234  title.str("");
235  name << "NumberOfClusters_Barrel";
236  title << "Number of Clusters per Event - Barrel";
237  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 30, 0.5, 30.5);
238 
239  name.str("");
240  title.str("");
241  name << "NumberOfClusters_Endcap+";
242  title << "Number of Clusters per Event - Endcap+";
243  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 15, 0.5, 15.5);
244 
245  name.str("");
246  title.str("");
247  name << "NumberOfClusters_Endcap-";
248  title << "Number of Clusters per Event - Endcap-";
249  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 15, 0.5, 15.5);
250 
251  //Number of Digis
252  name.str("");
253  title.str("");
254  name << "Multiplicity_Barrel";
255  title << "Multiplicity per Event per Roll - Barrel";
256  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 50, 0.5, 50.5);
257 
258  name.str("");
259  title.str("");
260  name << "Multiplicity_Endcap+";
261  title << "Multiplicity per Event per Roll - Endcap+";
262  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 32, 0.5, 32.5);
263 
264  name.str("");
265  title.str("");
266  name << "Multiplicity_Endcap-";
267  title << "Multiplicity per Event per Roll - Endcap-";
268  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 32, 0.5, 32.5);
269 
270  for (int layer = 1; layer <= 6; layer++) {
271  name.str("");
272  title.str("");
273  name << "ClusterSize_Layer" << layer;
274  title << "ClusterSize - Layer" << layer;
275  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
276  }
277 
278  for (int ring = RPCMonitorDigi::numberOfInnerRings_; ring <= 3; ring++) {
279  name.str("");
280  title.str("");
281  name << "ClusterSize_Ring" << ring;
282  title << "ClusterSize - Ring" << ring;
283  meMap[name.str()] = ibooker.book1D(name.str(), title.str(), 16, 0.5, 16.5);
284  }
285 
286  meMap["Occupancy_for_Endcap"] = ibooker.book2D("Occupancy_for_Endcap",
287  "Occupancy Endcap",
289  0.5,
290  ((float)RPCMonitorDigi::numberOfDisks_ * 2.0) + 0.5,
291  2,
292  1.5,
293  3.5);
294  meMap["Occupancy_for_Endcap"]->setAxisTitle("Disk", 1);
295  meMap["Occupancy_for_Endcap"]->setAxisTitle("Ring", 2);
296 
297  std::stringstream binlabel;
298  for (int bin = 1; bin <= RPCMonitorDigi::numberOfDisks_ * 2; bin++) {
299  binlabel.str("");
300  if (bin < (RPCMonitorDigi::numberOfDisks_ + 1)) { //negative endcap
301  binlabel << (bin - (RPCMonitorDigi::numberOfDisks_ + 1));
302  } else { //positive endcaps
303  binlabel << (bin - RPCMonitorDigi::numberOfDisks_);
304  }
305  meMap["Occupancy_for_Endcap"]->setBinLabel(bin, binlabel.str(), 1);
306  }
307 
308  meMap["Occupancy_for_Endcap"]->setBinLabel(1, "2", 2);
309  meMap["Occupancy_for_Endcap"]->setBinLabel(2, "3", 2);
310 
311  meMap["Occupancy_for_Barrel"] =
312  ibooker.book2D("Occupancy_for_Barrel", "Occupancy Barrel", 12, 0.5, 12.5, 5, -2.5, 2.5);
313  meMap["Occupancy_for_Barrel"]->setAxisTitle("Sec", 1);
314  meMap["Occupancy_for_Barrel"]->setAxisTitle("Wheel", 2);
315 
316  for (int bin = 1; bin <= 12; bin++) {
317  binlabel.str("");
318  binlabel << bin;
319  meMap["Occupancy_for_Barrel"]->setBinLabel(bin, binlabel.str(), 1);
320  if (bin <= 5) {
321  binlabel.str("");
322  binlabel << (bin - 3);
323  meMap["Occupancy_for_Barrel"]->setBinLabel(bin, binlabel.str(), 2);
324  }
325  }
326 }
std::string globalFolder_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
int nstrips() const
Definition: RPCRoll.cc:24
void bookSectorRingME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement at Sector/Ring level.
constexpr std::array< uint8_t, layerIndexSize > layer
static void setBarrelRollAxis(MonitorElement *me, const int wheel, const int axis, const bool useRollInfo)
char const * label
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 const std::array< std::string, 3 > regionNames_
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)
static std::string name(const RPCDetId &detId, const bool useRoll)
Definition: RPCNameHelper.cc:6
int layer() const
Definition: RPCDetId.h:85
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
static MonitorElement * bookBarrel(IBooker &booker, const int wheel, const std::string &prefix, const std::string &title, const bool useRollInfo)
static std::string folderStructure(const RPCDetId &detId)
void bookWheelDiskME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at Wheel/Disk level.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
void bookRegionME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at region (Barrel/Endcap) level.
static MonitorElement * bookEndcap(IBooker &booker, const int disk, const std::string &prefix, const std::string &title, const bool useRollInfo)
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