CMS 3D CMS Logo

SiPixelPhase1ResidualsExtra.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelPhase1ResidualsExtra
4 // Class: SiPixelPhase1ResidualsExtra
5 //
13 //
14 // Original Author: Alessandro Rossi
15 // Created: 25th May 2021
16 //
17 //
19 // Framework
23 // DQM Framework
26 // Geometry
32 // DataFormats
39 //
40 #include <string>
41 #include <cstdlib>
42 #include <iostream>
43 #include <fstream>
44 #include <sstream>
45 
46 using namespace std;
47 using namespace edm;
48 
50  : DQMEDHarvester(iConfig), conf_(iConfig) {
51  LogInfo("PixelDQM") << "SiPixelPhase1ResidualsExtra::SiPixelPhase1ResidualsExtra: Got DQM BackEnd interface" << endl;
52  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
53  minHits_ = conf_.getParameter<int>("MinHits");
54 }
55 
57  // do anything here that needs to be done at desctruction time
58  // (e.g. close files, deallocate resources etc.)
59  LogInfo("PixelDQM") << "SiPixelPhase1ResidualsExtra::~SiPixelPhase1ResidualsExtra: Destructor" << endl;
60 }
61 
63 
65  bookMEs(iBooker);
66  fillMEs(iBooker, iGetter);
67 }
68 
69 //------------------------------------------------------------------
70 // Used to book the MEs
71 //------------------------------------------------------------------
73  iBooker.cd();
74 
75  //New residual plots for the PXBarrel separated by inner and outer modules per layer
76  iBooker.setCurrentFolder(topFolderName_ + "/PXBarrel");
77 
78  for (std::string layer : {"1", "2", "3", "4"}) {
79  float mean_range = 20.;
80  float rms_range = 200.;
81  if (layer == "1") {
82  mean_range = 50.;
83  rms_range = 1000.;
84  }
85  residuals_["residual_mean_x_Inner_PXLayer_" + layer] =
86  iBooker.book1D("residual_mean_x_Inner_PXLayer_" + layer,
87  "Mean of Track Residuals X Inner Modules for Layer " + layer + ";mean(x_rec-x_pred)[#mum]",
88  100,
89  -1 * mean_range,
90  mean_range);
91  residuals_["residual_mean_x_Outer_PXLayer_" + layer] =
92  iBooker.book1D("residual_mean_x_Outer_PXLayer_" + layer,
93  "Mean of Track Residuals X Outer Modules for Layer " + layer + ";mean(x_rec-x_pred)[#mum]",
94  100,
95  -1 * mean_range,
96  mean_range);
97  residuals_["residual_mean_y_Inner_PXLayer_" + layer] =
98  iBooker.book1D("residual_mean_y_Inner_PXLayer_" + layer,
99  "Mean of Track Residuals Y Inner Modules for Layer " + layer + ";mean(y_rec-y_pred)[#mum]",
100  100,
101  -1 * mean_range,
102  mean_range);
103  residuals_["residual_mean_y_Outer_PXLayer_" + layer] =
104  iBooker.book1D("residual_mean_y_Outer_PXLayer_" + layer,
105  "Mean of Track Residuals Y Outer Modules for Layer " + layer + ";mean(y_rec-y_pred)[#mum]",
106  100,
107  -1 * mean_range,
108  mean_range);
109 
110  residuals_["residual_rms_x_Inner_PXLayer_" + layer] =
111  iBooker.book1D("residual_rms_x_Inner_PXLayer_" + layer,
112  "RMS of Track Residuals X Inner Modules for Layer " + layer + ";rms(x_rec-x_pred)[#mum]",
113  100,
114  0.,
115  rms_range);
116  residuals_["residual_rms_x_Outer_PXLayer_" + layer] =
117  iBooker.book1D("residual_rms_x_Outer_PXLayer_" + layer,
118  "RMS of Track Residuals X Outer Modules for Layer " + layer + ";rms(x_rec-x_pred)[#mum]",
119  100,
120  0.,
121  rms_range);
122  residuals_["residual_rms_y_Inner_PXLayer_" + layer] =
123  iBooker.book1D("residual_rms_y_Inner_PXLayer_" + layer,
124  "RMS of Track Residuals Y Inner Modules for Layer " + layer + ";rms(y_rec-y_pred)[#mum]",
125  100,
126  0.,
127  rms_range);
128  residuals_["residual_rms_y_Outer_PXLayer_" + layer] =
129  iBooker.book1D("residual_rms_y_Outer_PXLayer_" + layer,
130  "RMS of Track Residuals Y Outer Modules for Layer " + layer + ";rms(y_rec-y_pred)[#mum]",
131  100,
132  0.,
133  rms_range);
135  DRnR_["NormRes_mean_x_Inner_PXLayer_" + layer] = iBooker.book1D(
136  "NormRes_mean_x_Inner_PXLayer_" + layer,
137  "Mean of Normalized Track Residuals X Inner Modules for Layer " + layer + ";mean((x_rec-x_pred)/x_err)",
138  100,
139  -1 * 1,
140  1);
141  DRnR_["NormRes_mean_x_Outer_PXLayer_" + layer] = iBooker.book1D(
142  "NormRes_mean_x_Outer_PXLayer_" + layer,
143  "Mean of Normalized Track Residuals X Outer Modules for Layer " + layer + ";mean((x_rec-x_pred)/x_err)",
144  100,
145  -1 * 1,
146  1);
147  DRnR_["NormRes_mean_y_Inner_PXLayer_" + layer] = iBooker.book1D(
148  "NormRes_mean_y_Inner_PXLayer_" + layer,
149  "Mean of Normalized Track Residuals Y Inner Modules for Layer " + layer + ";mean((y_rec-y_pred)/y_err)",
150  100,
151  -1 * 1,
152  1);
153  DRnR_["NormRes_mean_y_Outer_PXLayer_" + layer] = iBooker.book1D(
154  "NormRes_mean_y_Outer_PXLayer_" + layer,
155  "Mean of Normalized Track Residuals Y Outer Modules for Layer " + layer + ";mean((y_rec-y_pred)/y_err)",
156  100,
157  -1 * 1,
158  1);
159 
160  DRnR_["DRnR_x_Inner_PXLayer_" + layer] = iBooker.book1D(
161  "DRnR_x_Inner_PXLayer_" + layer,
162  "RMS of Normalized Track Residuals X Inner Modules for Layer " + layer + ";rms((x_rec-x_pred)/x_err)",
163  100,
164  0.,
165  2);
166  DRnR_["DRnR_x_Outer_PXLayer_" + layer] = iBooker.book1D(
167  "DRnR_x_Outer_PXLayer_" + layer,
168  "RMS of Normalized Track Residuals X Outer Modules for Layer " + layer + ";rms((x_rec-x_pred)/x_err)",
169  100,
170  0.,
171  2);
172  DRnR_["DRnR_y_Inner_PXLayer_" + layer] = iBooker.book1D(
173  "DRnR_y_Inner_PXLayer_" + layer,
174  "RMS of Normalized Track Residuals Y Inner Modules for Layer " + layer + ";rms((y_rec-y_pred)/y_err)",
175  100,
176  0.,
177  2);
178  DRnR_["DRnR_y_Outer_PXLayer_" + layer] = iBooker.book1D(
179  "DRnR_y_Outer_PXLayer_" + layer,
180  "RMS of Normalized Track Residuals Y Outer Modules for Layer " + layer + ";rms((y_rec-y_pred)/y_err)",
181  100,
182  0.,
183  2);
184  }
185 
186  //New residual plots for the PXForward separated by inner and outer modules
187  iBooker.setCurrentFolder(topFolderName_ + "/PXForward");
188 
189  residuals_["residual_mean_x_Inner"] = iBooker.book1D(
190  "residual_mean_x_Inner", "Mean of Track Residuals X Inner Modules;mean(x_rec-x_pred)[#mum]", 100, -20., 20.);
191  residuals_["residual_mean_x_Outer"] = iBooker.book1D(
192  "residual_mean_x_Outer", "Mean of Track Residuals X Outer Modules;mean(x_rec-x_pred)[#mum]", 100, -20., 20.);
193  residuals_["residual_mean_y_Inner"] = iBooker.book1D(
194  "residual_mean_y_Inner", "Mean of Track Residuals Y Inner Modules;mean(y_rec-y_pred)[#mum]", 100, -20., 20.);
195  residuals_["residual_mean_y_Outer"] = iBooker.book1D(
196  "residual_mean_y_Outer", "Mean of Track Residuals Y Outer Modules;mean(y_rec-y_pred)[#mum]", 100, -20., 20.);
197 
198  residuals_["residual_rms_x_Inner"] = iBooker.book1D(
199  "residual_rms_x_Inner", "RMS of Track Residuals X Inner Modules;rms(x_rec-x_pred)[#mum]", 100, 0., 200.);
200  residuals_["residual_rms_x_Outer"] = iBooker.book1D(
201  "residual_rms_x_Outer", "RMS of Track Residuals X Outer Modules;rms(x_rec-x_pred)[#mum]", 100, 0., 200.);
202  residuals_["residual_rms_y_Inner"] = iBooker.book1D(
203  "residual_rms_y_Inner", "RMS of Track Residuals Y Inner Modules;rms(y_rec-y_pred)[#mum]", 100, 0., 200.);
204  residuals_["residual_rms_y_Outer"] = iBooker.book1D(
205  "residual_rms_y_Outer", "RMS of Track Residuals Y Outer Modules;rms(y_rec-y_pred)[#mum]", 100, 0., 200.);
206  //Normalize Residuals inner/outer
207  DRnR_["NormRes_mean_x_Inner"] =
208  iBooker.book1D("NormRes_mean_x_Inner",
209  "Mean of Normalized Track Residuals X Inner Modules;mean((x_rec-x_pred)/x_err)",
210  100,
211  -1.,
212  1.);
213  DRnR_["NormRes_mean_x_Outer"] =
214  iBooker.book1D("NormRes_mean_x_Outer",
215  "Mean of Normalized Track Residuals X Outer Modules;mean((x_rec-x_pred)/x_err)",
216  100,
217  -1.,
218  1.);
219  DRnR_["NormRes_mean_y_Inner"] =
220  iBooker.book1D("NormRes_mean_y_Inner",
221  "Mean of Normalized Track Residuals Y Inner Modules;mean((y_rec-y_pred)/y_err)",
222  100,
223  -1.,
224  1.);
225  DRnR_["NormRes_mean_y_Outer"] =
226  iBooker.book1D("NormRes_mean_y_Outer",
227  "Mean of Normalized Track Residuals Y Outer Modules;mean((y_rec-y_pred)/y_err)",
228  100,
229  -1.,
230  1.);
231 
232  DRnR_["DRnR_x_Inner"] = iBooker.book1D(
233  "DRnR_x_Inner", "RMS of Normalized Track Residuals X Inner Modules;rms((x_rec-x_pred)/x_err)", 100, 0., 2.);
234  DRnR_["DRnR_x_Outer"] = iBooker.book1D(
235  "DRnR_x_Outer", "RMS of Normalized Track Residuals X Outer Modules;rms((x_rec-x_pred)/x_err)", 100, 0., 2.);
236  DRnR_["DRnR_y_Inner"] = iBooker.book1D(
237  "DRnR_y_Inner", "RMS of Normalized Track Residuals Y Inner Modules;rms((y_rec-y_pred)/y_err)", 100, 0., 2.);
238  DRnR_["DRnR_y_Outer"] = iBooker.book1D(
239  "DRnR_y_Outer", "RMS of Normalized Track Residuals Y Outer Modules;rms((y_rec-y_pred)/y_err)", 100, 0., 2.);
240 
241  //New residual plots for the PXForward separated by positive and negative side
242  iBooker.setCurrentFolder(topFolderName_ + "/PXForward");
243 
244  residuals_["residual_mean_x_pos"] = iBooker.book1D(
245  "residual_mean_x_pos", "Mean of Track Residuals X pos. Side;mean(x_rec-x_pred)[#mum]", 100, -20., 20.);
246  residuals_["residual_mean_x_neg"] = iBooker.book1D(
247  "residual_mean_x_neg", "Mean of Track Residuals X neg. Side;mean(x_rec-x_pred)[#mum]", 100, -20., 20.);
248  residuals_["residual_mean_y_pos"] = iBooker.book1D(
249  "residual_mean_y_pos", "Mean of Track Residuals Y pos. Side;mean(y_rec-y_pred)[#mum]", 100, -20., 20.);
250  residuals_["residual_mean_y_neg"] = iBooker.book1D(
251  "residual_mean_y_neg", "Mean of Track Residuals Y neg. Side;mean(y_rec-y_pred)[#mum]", 100, -20., 20.);
252 
253  residuals_["residual_rms_x_pos"] =
254  iBooker.book1D("residual_rms_x_pos", "RMS of Track Residuals X pos. Side;rms(x_rec-x_pred)[#mum]", 100, 0., 200.);
255  residuals_["residual_rms_x_neg"] =
256  iBooker.book1D("residual_rms_x_neg", "RMS of Track Residuals X neg. Side;rms(x_rec-x_pred)[#mum]", 100, 0., 200.);
257  residuals_["residual_rms_y_pos"] =
258  iBooker.book1D("residual_rms_y_pos", "RMS of Track Residuals Y pos. Side;rms(y_rec-y_pred)[#mum]", 100, 0., 200.);
259  residuals_["residual_rms_y_neg"] =
260  iBooker.book1D("residual_rms_y_neg", "RMS of Track Residuals Y neg. Side;rms(y_rec-y_pred)[#mum]", 100, 0., 200.);
261  //Normalized Residuals pos/neg
262  DRnR_["NormRes_mean_x_pos"] = iBooker.book1D(
263  "NormRes_mean_x_pos", "Mean of Normalized Track Residuals X pos. Side;mean((x_rec-x_pred)/x_err)", 100, -1., 1.);
264  DRnR_["NormRes_mean_x_neg"] = iBooker.book1D(
265  "NormRes_mean_x_neg", "Mean of Normalized Track Residuals X neg. Side;mean((x_rec-x_pred)/x_err)", 100, -1., 1.);
266  DRnR_["NormRes_mean_y_pos"] = iBooker.book1D(
267  "NormRes_mean_y_pos", "Mean of Normalized Track Residuals Y pos. Side;mean((y_rec-y_pred)/y_err)", 100, -1., 1.);
268  DRnR_["NormRes_mean_y_neg"] = iBooker.book1D(
269  "NormRes_mean_y_neg", "Mean of Normalized Track Residuals Y neg. Side;mean((y_rec-y_pred)/y_err)", 100, -1., 1.);
270 
271  DRnR_["DRnR_x_pos"] = iBooker.book1D(
272  "DRnR_x_pos", "RMS of Normalized Track Residuals X pos. Side;rms((x_rec-x_pred)/x_err)", 100, 0., 2.);
273  DRnR_["DRnR_x_neg"] = iBooker.book1D(
274  "DRnR_x_neg", "RMS of Normalized Track Residuals X neg. Side;rms((x_rec-x_pred)/x_err)", 100, 0., 2.);
275  DRnR_["DRnR_y_pos"] = iBooker.book1D(
276  "DRnR_y_pos", "RMS of Normalized Track Residuals Y pos. Side;rms((y_rec-y_pred)/y_err)", 100, 0., 2.);
277  DRnR_["DRnR_y_neg"] = iBooker.book1D(
278  "DRnR_y_neg", "RMS of Normalized Track Residuals Y neg. Side;rms((y_rec-y_pred)/y_err)", 100, 0., 2.);
279 
280  //Reset the iBooker
281  iBooker.setCurrentFolder("PixelPhase1/");
282 }
283 
284 //------------------------------------------------------------------
285 // Fill the MEs
286 //------------------------------------------------------------------
288  //Fill additional residuals plots
289  //PXBarrel
290 
291  //constexpr int minHits_ = 30; //Miniminal number of hits needed for module to be filled in histograms
292 
293  for (std::string layer : {"1", "2", "3", "4"}) {
294  MonitorElement* me_x =
295  iGetter.get("PixelPhase1/Tracks/PXBarrel/residual_x_per_SignedModule_per_SignedLadder_PXLayer_" + layer);
296  MonitorElement* me_y =
297  iGetter.get("PixelPhase1/Tracks/PXBarrel/residual_y_per_SignedModule_per_SignedLadder_PXLayer_" + layer);
298  MonitorElement* me2_x = iGetter.get(
299  "PixelPhase1/Tracks/ResidualsExtra/PXBarrel/DRnR_x_per_SignedModule_per_SignedLadder_PXLayer_" + layer);
300  MonitorElement* me2_y = iGetter.get(
301  "PixelPhase1/Tracks/ResidualsExtra/PXBarrel/DRnR_y_per_SignedModule_per_SignedLadder_PXLayer_" + layer);
302 
303  if (me_x == nullptr || me_y == nullptr || me2_x == nullptr || me2_y == nullptr) {
304  edm::LogWarning("SiPixelPhase1ResidualsExtra")
305  << "Residuals plots for Pixel BPIX Layer" << layer << " not found. Skipping ResidualsExtra plots generation.";
306  continue;
307  }
308 
309  for (int i = 1; i <= me_x->getNbinsY(); i++) {
310  if (i == (me_x->getNbinsY() / 2 + 1))
311  continue; //Middle bin of y axis is empty
312 
313  if (i <= me_x->getNbinsY() / 2) {
314  bool iAmInner = (i % 2 == 0); //Check whether current ladder is inner or outer ladder
315  if (iAmInner) {
316  for (int j : {1, 2, 3, 4, 6, 7, 8, 9}) {
317  if (me_x->getBinEntries(j, i) < minHits_) //Fill only if number of hits is above threshold
318  continue;
319  residuals_["residual_mean_x_Inner_PXLayer_" + layer]->Fill(me_x->getBinContent(j, i) * 1e4);
320  residuals_["residual_mean_y_Inner_PXLayer_" + layer]->Fill(me_y->getBinContent(j, i) * 1e4);
321  residuals_["residual_rms_x_Inner_PXLayer_" + layer]->Fill(me_x->getBinError(j, i) * 1e4);
322  residuals_["residual_rms_y_Inner_PXLayer_" + layer]->Fill(me_y->getBinError(j, i) * 1e4);
323  DRnR_["NormRes_mean_x_Inner_PXLayer_" + layer]->Fill(me2_x->getBinContent(j, i));
324  DRnR_["NormRes_mean_y_Inner_PXLayer_" + layer]->Fill(me2_y->getBinContent(j, i));
325  DRnR_["DRnR_x_Inner_PXLayer_" + layer]->Fill(me2_x->getBinError(j, i));
326  DRnR_["DRnR_y_Inner_PXLayer_" + layer]->Fill(me2_y->getBinError(j, i));
327  }
328  } else {
329  for (int j : {1, 2, 3, 4, 6, 7, 8, 9}) {
330  if (me_x->getBinEntries(j, i) < minHits_) //Fill only if number of hits is above threshold
331  continue;
332  residuals_["residual_mean_x_Outer_PXLayer_" + layer]->Fill(me_x->getBinContent(j, i) * 1e4);
333  residuals_["residual_mean_y_Outer_PXLayer_" + layer]->Fill(me_y->getBinContent(j, i) * 1e4);
334  residuals_["residual_rms_x_Outer_PXLayer_" + layer]->Fill(me_x->getBinError(j, i) * 1e4);
335  residuals_["residual_rms_y_Outer_PXLayer_" + layer]->Fill(me_y->getBinError(j, i) * 1e4);
336  DRnR_["NormRes_mean_x_Outer_PXLayer_" + layer]->Fill(me2_x->getBinContent(j, i));
337  DRnR_["NormRes_mean_y_Outer_PXLayer_" + layer]->Fill(me2_y->getBinContent(j, i));
338  DRnR_["DRnR_x_Outer_PXLayer_" + layer]->Fill(me2_x->getBinError(j, i));
339  DRnR_["DRnR_y_Outer_PXLayer_" + layer]->Fill(me2_y->getBinError(j, i));
340  }
341  }
342  } else {
343  bool iAmInner = (i % 2 == 1); //Check whether current ladder is inner or outer ladder
344  if (iAmInner) {
345  for (int j : {1, 2, 3, 4, 6, 7, 8, 9}) {
346  if (me_x->getBinEntries(j, i) < minHits_) //Fill only if number of hits is above threshold
347  continue;
348  residuals_["residual_mean_x_Inner_PXLayer_" + layer]->Fill(me_x->getBinContent(j, i) * 1e4);
349  residuals_["residual_mean_y_Inner_PXLayer_" + layer]->Fill(me_y->getBinContent(j, i) * 1e4);
350  residuals_["residual_rms_x_Inner_PXLayer_" + layer]->Fill(me_x->getBinError(j, i) * 1e4);
351  residuals_["residual_rms_y_Inner_PXLayer_" + layer]->Fill(me_y->getBinError(j, i) * 1e4);
352  DRnR_["NormRes_mean_x_Inner_PXLayer_" + layer]->Fill(me2_x->getBinContent(j, i));
353  DRnR_["NormRes_mean_y_Inner_PXLayer_" + layer]->Fill(me2_y->getBinContent(j, i));
354  DRnR_["DRnR_x_Inner_PXLayer_" + layer]->Fill(me2_x->getBinError(j, i));
355  DRnR_["DRnR_y_Inner_PXLayer_" + layer]->Fill(me2_y->getBinError(j, i));
356  }
357  } else {
358  for (int j : {1, 2, 3, 4, 6, 7, 8, 9}) {
359  if (me_x->getBinEntries(j, i) < minHits_) //Fill only if number of hits is above threshold
360  continue;
361  residuals_["residual_mean_x_Outer_PXLayer_" + layer]->Fill(me_x->getBinContent(j, i) * 1e4);
362  residuals_["residual_mean_y_Outer_PXLayer_" + layer]->Fill(me_y->getBinContent(j, i) * 1e4);
363  residuals_["residual_rms_x_Outer_PXLayer_" + layer]->Fill(me_x->getBinError(j, i) * 1e4);
364  residuals_["residual_rms_y_Outer_PXLayer_" + layer]->Fill(me_y->getBinError(j, i) * 1e4);
365  DRnR_["NormRes_mean_x_Outer_PXLayer_" + layer]->Fill(me2_x->getBinContent(j, i));
366  DRnR_["NormRes_mean_y_Outer_PXLayer_" + layer]->Fill(me2_y->getBinContent(j, i));
367  DRnR_["DRnR_x_Outer_PXLayer_" + layer]->Fill(me2_x->getBinError(j, i));
368  DRnR_["DRnR_y_Outer_PXLayer_" + layer]->Fill(me2_y->getBinError(j, i));
369  }
370  }
371  }
372  for (int j : {1, 2, 3, 4, 6, 7, 8, 9}) {
373  if (me_x->getBinEntries(j, i) < minHits_) {
374  me2_x->setBinContent(j, i, 0);
375  me2_y->setBinContent(j, i, 0);
376  me2_x->setBinEntries(me2_x->getBin(j, i), 0);
377  me2_y->setBinEntries(me2_y->getBin(j, i), 0);
378  } else {
379  me2_x->setBinContent(j, i, me2_x->getBinError(j, i));
380  me2_y->setBinContent(j, i, me2_y->getBinError(j, i));
381  me2_x->setBinEntries(me2_x->getBin(j, i), 1);
382  me2_y->setBinEntries(me2_y->getBin(j, i), 1);
383  }
384  }
385  }
386  }
387 
388  //PXForward separating outer and inner modules as well as positive and negative side
389  for (std::string ring : {"1", "2"}) {
390  MonitorElement* me_x =
391  iGetter.get("PixelPhase1/Tracks/PXForward/residual_x_per_PXDisk_per_SignedBladePanel_PXRing_" + ring);
392  MonitorElement* me_y =
393  iGetter.get("PixelPhase1/Tracks/PXForward/residual_y_per_PXDisk_per_SignedBladePanel_PXRing_" + ring);
394  MonitorElement* me2_x = iGetter.get(
395  "PixelPhase1/Tracks/ResidualsExtra/PXForward/DRnR_x_per_PXDisk_per_SignedBladePanel_PXRing_" + ring);
396  MonitorElement* me2_y = iGetter.get(
397  "PixelPhase1/Tracks/ResidualsExtra/PXForward/DRnR_y_per_PXDisk_per_SignedBladePanel_PXRing_" + ring);
398 
399  if (me_x == nullptr || me_y == nullptr || me2_x == nullptr || me2_y == nullptr) {
400  edm::LogWarning("SiPixelPhase1ResidualsExtra")
401  << "Residuals plots for Pixel FPIX Ring" << ring << " not found. Skipping ResidualsExtra plots generation.";
402  continue;
403  }
404 
405  bool posSide = false;
406  for (int j = 1; j <= me_x->getNbinsX(); j++) {
407  if (j == 4)
408  continue; //fourth x-bin in profile plots is empty
409 
410  if (j == 5)
411  posSide = true; //change to postive side
412 
413  for (int i = 1; i <= me_x->getNbinsY(); i++) {
414  if (i == me_x->getNbinsY() / 2)
415  continue; //Middle bins of y axis is empty
416  if (i == (me_x->getNbinsY() / 2) + 1)
417  continue;
418  if (me_x->getBinEntries(j, i) >= minHits_) { //Fill only if number of hits is above threshold
419 
420  bool iAmInner = (i % 2 == 0); //separate inner and outer modules
421  if (iAmInner) {
422  residuals_["residual_mean_x_Inner"]->Fill(me_x->getBinContent(j, i) * 1e4);
423  residuals_["residual_mean_y_Inner"]->Fill(me_y->getBinContent(j, i) * 1e4);
424  residuals_["residual_rms_x_Inner"]->Fill(me_x->getBinError(j, i) * 1e4);
425  residuals_["residual_rms_y_Inner"]->Fill(me_y->getBinError(j, i) * 1e4);
426  DRnR_["NormRes_mean_x_Inner"]->Fill(me2_x->getBinContent(j, i));
427  DRnR_["NormRes_mean_y_Inner"]->Fill(me2_y->getBinContent(j, i));
428  DRnR_["DRnR_x_Inner"]->Fill(me2_x->getBinError(j, i));
429  DRnR_["DRnR_y_Inner"]->Fill(me2_y->getBinError(j, i));
430  } else {
431  residuals_["residual_mean_x_Outer"]->Fill(me_x->getBinContent(j, i) * 1e4);
432  residuals_["residual_mean_y_Outer"]->Fill(me_y->getBinContent(j, i) * 1e4);
433  residuals_["residual_rms_x_Outer"]->Fill(me_x->getBinError(j, i) * 1e4);
434  residuals_["residual_rms_y_Outer"]->Fill(me_y->getBinError(j, i) * 1e4);
435  DRnR_["NormRes_mean_x_Outer"]->Fill(me2_x->getBinContent(j, i));
436  DRnR_["NormRes_mean_y_Outer"]->Fill(me2_y->getBinContent(j, i));
437  DRnR_["DRnR_x_Outer"]->Fill(me2_x->getBinError(j, i));
438  DRnR_["DRnR_y_Outer"]->Fill(me2_y->getBinError(j, i));
439  }
440 
441  if (!posSide) { //separate postive and negative side
442  residuals_["residual_mean_x_neg"]->Fill(me_x->getBinContent(j, i) * 1e4);
443  residuals_["residual_mean_y_neg"]->Fill(me_y->getBinContent(j, i) * 1e4);
444  residuals_["residual_rms_x_neg"]->Fill(me_x->getBinError(j, i) * 1e4);
445  residuals_["residual_rms_y_neg"]->Fill(me_y->getBinError(j, i) * 1e4);
446  DRnR_["NormRes_mean_x_neg"]->Fill(me2_x->getBinContent(j, i));
447  DRnR_["NormRes_mean_y_neg"]->Fill(me2_y->getBinContent(j, i));
448  DRnR_["DRnR_x_neg"]->Fill(me2_x->getBinError(j, i));
449  DRnR_["DRnR_y_neg"]->Fill(me2_y->getBinError(j, i));
450  } else {
451  residuals_["residual_mean_x_pos"]->Fill(me_x->getBinContent(j, i) * 1e4);
452  residuals_["residual_mean_y_pos"]->Fill(me_y->getBinContent(j, i) * 1e4);
453  residuals_["residual_rms_x_pos"]->Fill(me_x->getBinError(j, i) * 1e4);
454  residuals_["residual_rms_y_pos"]->Fill(me_y->getBinError(j, i) * 1e4);
455  DRnR_["NormRes_mean_x_pos"]->Fill(me2_x->getBinContent(j, i));
456  DRnR_["NormRes_mean_y_pos"]->Fill(me2_y->getBinContent(j, i));
457  DRnR_["DRnR_x_pos"]->Fill(me2_x->getBinError(j, i));
458  DRnR_["DRnR_y_pos"]->Fill(me2_y->getBinError(j, i));
459  }
460  me2_x->setBinContent(j, i, me2_x->getBinError(j, i));
461  me2_y->setBinContent(j, i, me2_y->getBinError(j, i));
462  me2_x->setBinEntries(me2_x->getBin(j, i), 1);
463  me2_y->setBinEntries(me2_y->getBin(j, i), 1);
464  } else {
465  me2_x->setBinContent(j, i, 0);
466  me2_y->setBinContent(j, i, 0);
467  me2_x->setBinEntries(me2_x->getBin(j, i), 0);
468  me2_y->setBinEntries(me2_y->getBin(j, i), 0);
469  }
470  }
471  }
472  }
473 }
474 
475 //define this as a plug-in
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
virtual double getBinEntries(int bin) const
get # of bin entries (for profiles)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::map< std::string, MonitorElement * > DRnR_
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
void bookMEs(DQMStore::IBooker &iBooker)
std::map< std::string, MonitorElement * > residuals_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
SiPixelPhase1ResidualsExtra(const edm::ParameterSet &conf)
virtual int getNbinsY() const
get # of bins in Y-axis
Log< level::Info, false > LogInfo
virtual void setBinEntries(int bin, double nentries)
set # of bin entries (to be used for profiles)
void fillMEs(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
void dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
HLT enums.
virtual int getBin(int binx, int biny) const
get global bin number (for 2-D profiles)
virtual int getNbinsX() const
get # of bins in X-axis
virtual double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
Definition: Run.h:45
virtual double getBinContent(int binx) const
get content of bin (1-D)