CMS 3D CMS Logo

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 }
RPCRoll
Definition: RPCRoll.h:12
RPCRollMapHisto::bookBarrel
static MonitorElement * bookBarrel(IBooker &booker, const int wheel, const std::string &prefix, const std::string &title, const bool useRollInfo)
Definition: RPCRollMapHisto.cc:8
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
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
RPCNameHelper.h
RPCDetId
Definition: RPCDetId.h:16
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
RPCGeometry::roll
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:50
RPCMonitorDigi::subsystemFolder_
std::string subsystemFolder_
Definition: RPCMonitorDigi.h:73
RPCMonitorDigi::numberOfDisks_
int numberOfDisks_
Definition: RPCMonitorDigi.h:60
RPCMonitorDigi::bookRollME
void bookRollME(DQMStore::IBooker &, const RPCDetId &, const RPCGeometry *rpcGeo, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement for one RPCDetId (= roll)
Definition: RPCBookDetUnitME.cc:7
RPCRollMapHisto::bookEndcap
static MonitorElement * bookEndcap(IBooker &booker, const int disk, const std::string &prefix, const std::string &title, const bool useRollInfo)
Definition: RPCRollMapHisto.cc:81
hlt_dqm_clientPB-live_cfg.me2
me2
Definition: hlt_dqm_clientPB-live_cfg.py:78
dqm-mbProfile.format
format
Definition: dqm-mbProfile.py:16
RPCBookFolderStructure::folderStructure
static std::string folderStructure(const RPCDetId &detId)
Definition: RPCBookFolderStructure.h:15
RPCRollMapHisto.h
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
RPCMonitorDigi::regionNames_
static const std::array< std::string, 3 > regionNames_
Definition: RPCMonitorDigi.h:47
RPCNameHelper::name
static std::string name(const RPCDetId &detId, const bool useRoll)
Definition: RPCNameHelper.cc:6
RPCMonitorDigi::bookWheelDiskME
void bookWheelDiskME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at Wheel/Disk level.
Definition: RPCBookDetUnitME.cc:144
RPCMonitorDigi::stripsInRoll
int stripsInRoll(const RPCDetId &id, const RPCGeometry *rpcGeo) const
Definition: RPCBookDetUnitME.cc:205
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88286
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
RPCBookFolderStructure.h
RPCMonitorDigi::numberOfInnerRings_
int numberOfInnerRings_
Definition: RPCMonitorDigi.h:60
RPCRoll::nstrips
int nstrips() const
Definition: RPCRoll.cc:24
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
RPCMonitorDigi::bookRegionME
void bookRegionME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at region (Barrel/Endcap) level.
Definition: RPCBookDetUnitME.cc:213
hlt_dqm_clientPB-live_cfg.me1
me1
Definition: hlt_dqm_clientPB-live_cfg.py:73
RPCRollMapHisto::setBarrelRollAxis
static void setBarrelRollAxis(MonitorElement *me, const int wheel, const int axis, const bool useRollInfo)
Definition: RPCRollMapHisto.cc:25
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RPCDetId::ring
int ring() const
Definition: RPCDetId.h:59
alignCSCRings.r
r
Definition: alignCSCRings.py:93
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
HistogramManager_cfi.ylabel
ylabel
Definition: HistogramManager_cfi.py:73
RPCMonitorDigi::globalFolder_
std::string globalFolder_
Definition: RPCMonitorDigi.h:72
RPCMonitorDigi::bookSectorRingME
void bookSectorRingME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement at Sector/Ring level.
Definition: RPCBookDetUnitME.cc:62
dqm::implementation::IBooker::book2D
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
RPCMonitorDigi::useRollInfo_
bool useRollInfo_
Definition: RPCMonitorDigi.h:53
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
dqm::implementation::IBooker
Definition: DQMStore.h:43
RPCGeometry
Definition: RPCGeometry.h:20
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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
RPCGeometry.h
label
const char * label
Definition: PFTauDecayModeTools.cc:11
RPCMonitorDigi.h
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98