CMS 3D CMS Logo

SiPixelClusterModule.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelMonitorCluster
4 // Class: SiPixelClusterSource
5 //
15 //
16 // Original Author: Vincenzo Chiochia & Andrew York
17 // Created:
18 //
19 //
20 // Updated by: Lukas Wehrli
21 // for pixel offline DQM
27 // STL
28 #include <cstdlib>
29 #include <iostream>
30 #include <memory>
31 #include <string>
32 #include <vector>
33 
34 // Data Formats
42 //
43 // Constructors
44 //
45 SiPixelClusterModule::SiPixelClusterModule() : id_(0), ncols_(416), nrows_(160) {}
47 SiPixelClusterModule::SiPixelClusterModule(const uint32_t &id) : id_(id), ncols_(416), nrows_(160) {}
49 SiPixelClusterModule::SiPixelClusterModule(const uint32_t &id, const int &ncols, const int &nrows)
50  : id_(id), ncols_(ncols), nrows_(nrows) {}
51 //
52 // Destructor
53 //
55 //
56 // Book histograms
57 //
59  const edm::EventSetup &iSetup,
60  DQMStore::IBooker &iBooker,
61  int type,
62  bool twoD,
63  bool reducedSet,
64  bool isUpgrade) {
66  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
67  pTT = tTopoHandle.product();
68 
69  bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
70  bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
71  bool isHalfModule = false;
72  if (barrel) {
73  isHalfModule = PixelBarrelName(DetId(id_), pTT, isUpgrade).isHalfModule();
74  }
75  int nbinx = ncols_ / 2;
76  int nbiny = nrows_ / 2;
77 
78  std::string hid;
79  // Get collection name and instantiate Histo Id builder
80  edm::InputTag src = iConfig.getParameter<edm::InputTag>("src");
81  if (type == 0) {
82  SiPixelHistogramId *theHistogramId = new SiPixelHistogramId(src.label());
83  // Number of clusters
84  hid = theHistogramId->setHistoId("nclusters", id_);
85  meNClusters_ = iBooker.book1D(hid, "Number of Clusters", 8, 0., 8.);
86  meNClusters_->setAxisTitle("Number of Clusters", 1);
87  // Total cluster charge in MeV
88  hid = theHistogramId->setHistoId("charge", id_);
89  meCharge_ = iBooker.book1D(hid, "Cluster charge", 100, 0., 200.);
90  meCharge_->setAxisTitle("Charge [kilo electrons]", 1);
91  // Total cluster size (in pixels)
92  hid = theHistogramId->setHistoId("size", id_);
93  meSize_ = iBooker.book1D(hid, "Total cluster size", 30, 0., 30.);
94  meSize_->setAxisTitle("Cluster size [number of pixels]", 1);
95  if (!reducedSet) {
96  // Lowest cluster row
97  hid = theHistogramId->setHistoId("minrow", id_);
98  meMinRow_ = iBooker.book1D(hid, "Lowest cluster row", 200, 0., 200.);
99  meMinRow_->setAxisTitle("Lowest cluster row", 1);
100  // Highest cluster row
101  hid = theHistogramId->setHistoId("maxrow", id_);
102  meMaxRow_ = iBooker.book1D(hid, "Highest cluster row", 200, 0., 200.);
103  meMaxRow_->setAxisTitle("Highest cluster row", 1);
104  // Lowest cluster column
105  hid = theHistogramId->setHistoId("mincol", id_);
106  meMinCol_ = iBooker.book1D(hid, "Lowest cluster column", 500, 0., 500.);
107  meMinCol_->setAxisTitle("Lowest cluster column", 1);
108  // Highest cluster column
109  hid = theHistogramId->setHistoId("maxcol", id_);
110  meMaxCol_ = iBooker.book1D(hid, "Highest cluster column", 500, 0., 500.);
111  meMaxCol_->setAxisTitle("Highest cluster column", 1);
112  // Cluster barycenter X position
113  hid = theHistogramId->setHistoId("x", id_);
114  meX_ = iBooker.book1D(hid, "Cluster barycenter X (row #)", 200, 0., 200.);
115  meX_->setAxisTitle("Barycenter x-position [row #]", 1);
116  // Cluster barycenter Y position
117  hid = theHistogramId->setHistoId("y", id_);
118  meY_ = iBooker.book1D(hid, "Cluster barycenter Y (column #)", 500, 0., 500.);
119  meY_->setAxisTitle("Barycenter y-position [column #]", 1);
120  // Cluster width on the x-axis
121  hid = theHistogramId->setHistoId("sizeX", id_);
122  meSizeX_ = iBooker.book1D(hid, "Cluster x-width (rows)", 10, 0., 10.);
123  meSizeX_->setAxisTitle("Cluster x-size [rows]", 1);
124  // Cluster width on the y-axis
125  hid = theHistogramId->setHistoId("sizeY", id_);
126  meSizeY_ = iBooker.book1D(hid, "Cluster y-width (columns)", 15, 0., 15.);
127  meSizeY_->setAxisTitle("Cluster y-size [columns]", 1);
128  int nbinx = ncols_ / 2;
129  int nbiny = nrows_ / 2;
130  hid = theHistogramId->setHistoId("hitmap", id_);
131  if (twoD) {
132  // 2D hit map
133  mePixClusters_ = iBooker.book2D(
134  hid, "Number of Clusters (1bin=four pixels)", nbinx, 0., float(ncols_), nbiny, 0., float(nrows_));
135  mePixClusters_->setAxisTitle("Columns", 1);
136  mePixClusters_->setAxisTitle("Rows", 2);
137  } else {
138  // projections of hitmap
140  iBooker.book1D(hid + "_px", "Number of Clusters (1bin=two columns)", nbinx, 0., float(ncols_));
141  mePixClusters_py_ = iBooker.book1D(hid + "_py", "Number of Clusters (1bin=two rows)", nbiny, 0., float(nrows_));
142  mePixClusters_px_->setAxisTitle("Columns", 1);
143  mePixClusters_py_->setAxisTitle("Rows", 1);
144  }
145  }
146  delete theHistogramId;
147  }
148 
149  //**
150  if (barrel && type == 7) {
151  hid = src.label() + "_Barrel";
152  meSizeYvsEtaBarrel_ = iBooker.book2D(
153  "sizeYvsEta_" + hid, "Cluster size along beamline vs. Cluster position #eta", 60, -3., 3., 40, 0., 40.);
154  meSizeYvsEtaBarrel_->setAxisTitle("Cluster #eta", 1);
155  meSizeYvsEtaBarrel_->setAxisTitle("Cluster size along beamline [number of pixels]", 2);
156  }
157  if (type == 1 && barrel) {
158  uint32_t DBladder;
159  DBladder = PixelBarrelName(DetId(id_), pTT, isUpgrade).ladderName();
160  char sladder[80];
161  sprintf(sladder, "Ladder_%02i", DBladder);
162  hid = src.label() + "_" + sladder;
163  if (isHalfModule)
164  hid += "H";
165  else
166  hid += "F";
167  // Number of clusters
168  meNClustersLad_ = iBooker.book1D("nclusters_" + hid, "Number of Clusters", 8, 0., 8.);
169  meNClustersLad_->setAxisTitle("Number of Clusters", 1);
170  // Total cluster charge in MeV
171  meChargeLad_ = iBooker.book1D("charge_" + hid, "Cluster charge", 100, 0., 200.);
172  meChargeLad_->setAxisTitle("Charge [kilo electrons]", 1);
173  // Total cluster size (in pixels)
174  meSizeLad_ = iBooker.book1D("size_" + hid, "Total cluster size", 30, 0., 30.);
175  meSizeLad_->setAxisTitle("Cluster size [number of pixels]", 1);
176  if (!reducedSet) {
177  // Lowest cluster row
178  meMinRowLad_ = iBooker.book1D("minrow_" + hid, "Lowest cluster row", 200, 0., 200.);
179  meMinRowLad_->setAxisTitle("Lowest cluster row", 1);
180  // Highest cluster row
181  meMaxRowLad_ = iBooker.book1D("maxrow_" + hid, "Highest cluster row", 200, 0., 200.);
182  meMaxRowLad_->setAxisTitle("Highest cluster row", 1);
183  // Lowest cluster column
184  meMinColLad_ = iBooker.book1D("mincol_" + hid, "Lowest cluster column", 500, 0., 500.);
185  meMinColLad_->setAxisTitle("Lowest cluster column", 1);
186  // Highest cluster column
187  meMaxColLad_ = iBooker.book1D("maxcol_" + hid, "Highest cluster column", 500, 0., 500.);
188  meMaxColLad_->setAxisTitle("Highest cluster column", 1);
189  // Cluster barycenter X position
190  meXLad_ = iBooker.book1D("x_" + hid, "Cluster barycenter X (row #)", 200, 0., 200.);
191  meXLad_->setAxisTitle("Barycenter x-position [row #]", 1);
192  // Cluster barycenter Y position
193  meYLad_ = iBooker.book1D("y_" + hid, "Cluster barycenter Y (column #)", 500, 0., 500.);
194  meYLad_->setAxisTitle("Barycenter y-position [column #]", 1);
195  // Cluster width on the x-axis
196  meSizeXLad_ = iBooker.book1D("sizeX_" + hid, "Cluster x-width (rows)", 10, 0., 10.);
197  meSizeXLad_->setAxisTitle("Cluster x-size [rows]", 1);
198  // Cluster width on the y-axis
199  meSizeYLad_ = iBooker.book1D("sizeY_" + hid, "Cluster y-width (columns)", 15, 0., 15.);
200  meSizeYLad_->setAxisTitle("Cluster y-size [columns]", 1);
201  if (twoD) {
202  // 2D hit map
203  mePixClustersLad_ = iBooker.book2D("hitmap_" + hid,
204  "Number of Clusters (1bin=four pixels)",
205  nbinx,
206  0.,
207  float(ncols_),
208  nbiny,
209  0.,
210  float(nrows_));
211  mePixClustersLad_->setAxisTitle("Columns", 1);
212  mePixClustersLad_->setAxisTitle("Rows", 2);
213  } else {
214  // projections of hitmap
216  iBooker.book1D("hitmap_" + hid + "_px", "Number of Clusters (1bin=two columns)", nbinx, 0., float(ncols_));
218  iBooker.book1D("hitmap_" + hid + "_py", "Number of Clusters (1bin=two rows)", nbiny, 0., float(nrows_));
219  mePixClustersLad_px_->setAxisTitle("Columns", 1);
221  }
222  }
223  }
224 
225  if (type == 2 && barrel) {
226  uint32_t DBlayer;
227  DBlayer = PixelBarrelName(DetId(id_), pTT, isUpgrade).layerName();
228  char slayer[80];
229  sprintf(slayer, "Layer_%i", DBlayer);
230  hid = src.label() + "_" + slayer;
231  // Number of clusters
232  meNClustersLay_ = iBooker.book1D("nclusters_" + hid, "Number of Clusters", 8, 0., 8.);
233  meNClustersLay_->setAxisTitle("Number of Clusters", 1);
234  // Total cluster charge in MeV
235  meChargeLay_ = iBooker.book1D("charge_" + hid, "Cluster charge", 100, 0., 200.);
236  meChargeLay_->setAxisTitle("Charge [kilo electrons]", 1);
237  // Total cluster size (in pixels)
238  meSizeLay_ = iBooker.book1D("size_" + hid, "Total cluster size", 30, 0., 30.);
239  meSizeLay_->setAxisTitle("Cluster size [in pixels]", 1);
240  if (!reducedSet) {
241  // Lowest cluster row
242  meMinRowLay_ = iBooker.book1D("minrow_" + hid, "Lowest cluster row", 200, 0., 200.);
243  meMinRowLay_->setAxisTitle("Lowest cluster row", 1);
244  // Highest cluster row
245  meMaxRowLay_ = iBooker.book1D("maxrow_" + hid, "Highest cluster row", 200, 0., 200.);
246  meMaxRowLay_->setAxisTitle("Highest cluster row", 1);
247  // Lowest cluster column
248  meMinColLay_ = iBooker.book1D("mincol_" + hid, "Lowest cluster column", 500, 0., 500.);
249  meMinColLay_->setAxisTitle("Lowest cluster column", 1);
250  // Highest cluster column
251  meMaxColLay_ = iBooker.book1D("maxcol_" + hid, "Highest cluster column", 500, 0., 500.);
252  meMaxColLay_->setAxisTitle("Highest cluster column", 1);
253  // Cluster barycenter X position
254  meXLay_ = iBooker.book1D("x_" + hid, "Cluster barycenter X (row #)", 200, 0., 200.);
255  meXLay_->setAxisTitle("Barycenter x-position [row #]", 1);
256  // Cluster barycenter Y position
257  meYLay_ = iBooker.book1D("y_" + hid, "Cluster barycenter Y (column #)", 500, 0., 500.);
258  meYLay_->setAxisTitle("Barycenter y-position [column #]", 1);
259  // Cluster width on the x-axis
260  meSizeXLay_ = iBooker.book1D("sizeX_" + hid, "Cluster x-width (rows)", 10, 0., 10.);
261  meSizeXLay_->setAxisTitle("Cluster x-size [rows]", 1);
262  // Cluster width on the y-axis
263  meSizeYLay_ = iBooker.book1D("sizeY_" + hid, "Cluster y-width (columns)", 15, 0., 15.);
264  meSizeYLay_->setAxisTitle("Cluster y-size [columns]", 1);
265  if (twoD) {
266  // 2D hit map
267  if (isHalfModule) {
268  mePixClustersLay_ = iBooker.book2D("hitmap_" + hid,
269  "Number of Clusters (1bin=four pixels)",
270  nbinx,
271  0.,
272  float(ncols_),
273  2 * nbiny,
274  0.,
275  float(2 * nrows_));
276  } else {
277  mePixClustersLay_ = iBooker.book2D("hitmap_" + hid,
278  "Number of Clusters (1bin=four pixels)",
279  nbinx,
280  0.,
281  float(ncols_),
282  nbiny,
283  0.,
284  float(nrows_));
285  }
286  mePixClustersLay_->setAxisTitle("Columns", 1);
287  mePixClustersLay_->setAxisTitle("Rows", 2);
288  } else {
289  // projections of hitmap
291  iBooker.book1D("hitmap_" + hid + "_px", "Number of Clusters (1bin=two columns)", nbinx, 0., float(ncols_));
292  if (isHalfModule) {
293  mePixClustersLay_py_ = iBooker.book1D(
294  "hitmap_" + hid + "_py", "Number of Clusters (1bin=two rows)", 2 * nbiny, 0., float(2 * nrows_));
295  } else {
297  iBooker.book1D("hitmap_" + hid + "_py", "Number of Clusters (1bin=two rows)", nbiny, 0., float(nrows_));
298  }
299  mePixClustersLay_px_->setAxisTitle("Columns", 1);
301  }
302  }
303  }
304  if (type == 3 && barrel) {
305  uint32_t DBmodule;
306  DBmodule = PixelBarrelName(DetId(id_), pTT, isUpgrade).moduleName();
307  char smodule[80];
308  sprintf(smodule, "Ring_%i", DBmodule);
309  hid = src.label() + "_" + smodule;
310  // Number of clusters
311  meNClustersPhi_ = iBooker.book1D("nclusters_" + hid, "Number of Clusters", 8, 0., 8.);
312  meNClustersPhi_->setAxisTitle("Number of Clusters", 1);
313  // Total cluster charge in MeV
314  meChargePhi_ = iBooker.book1D("charge_" + hid, "Cluster charge", 100, 0., 200.);
315  meChargePhi_->setAxisTitle("Charge [kilo electrons]", 1);
316  // Total cluster size (in pixels)
317  meSizePhi_ = iBooker.book1D("size_" + hid, "Total cluster size", 30, 0., 30.);
318  meSizePhi_->setAxisTitle("Cluster size [number of pixels]", 1);
319  if (!reducedSet) {
320  // Lowest cluster row
321  meMinRowPhi_ = iBooker.book1D("minrow_" + hid, "Lowest cluster row", 200, 0., 200.);
322  meMinRowPhi_->setAxisTitle("Lowest cluster row", 1);
323  // Highest cluster row
324  meMaxRowPhi_ = iBooker.book1D("maxrow_" + hid, "Highest cluster row", 200, 0., 200.);
325  meMaxRowPhi_->setAxisTitle("Highest cluster row", 1);
326  // Lowest cluster column
327  meMinColPhi_ = iBooker.book1D("mincol_" + hid, "Lowest cluster column", 500, 0., 500.);
328  meMinColPhi_->setAxisTitle("Lowest cluster column", 1);
329  // Highest cluster column
330  meMaxColPhi_ = iBooker.book1D("maxcol_" + hid, "Highest cluster column", 500, 0., 500.);
331  meMaxColPhi_->setAxisTitle("Highest cluster column", 1);
332  // Cluster barycenter X position
333  meXPhi_ = iBooker.book1D("x_" + hid, "Cluster barycenter X (row #)", 200, 0., 200.);
334  meXPhi_->setAxisTitle("Barycenter x-position [row #]", 1);
335  // Cluster barycenter Y position
336  meYPhi_ = iBooker.book1D("y_" + hid, "Cluster barycenter Y (column #)", 500, 0., 500.);
337  meYPhi_->setAxisTitle("Barycenter y-position [column #]", 1);
338  // Cluster width on the x-axis
339  meSizeXPhi_ = iBooker.book1D("sizeX_" + hid, "Cluster x-width (rows)", 10, 0., 10.);
340  meSizeXPhi_->setAxisTitle("Cluster x-size [rows]", 1);
341  // Cluster width on the y-axis
342  meSizeYPhi_ = iBooker.book1D("sizeY_" + hid, "Cluster y-width (columns)", 15, 0., 15.);
343  meSizeYPhi_->setAxisTitle("Cluster y-size [columns]", 1);
344  if (twoD) {
345  // 2D hit map
346  if (isHalfModule) {
347  mePixClustersPhi_ = iBooker.book2D("hitmap_" + hid,
348  "Number of Clusters (1bin=four pixels)",
349  nbinx,
350  0.,
351  float(ncols_),
352  2 * nbiny,
353  0.,
354  float(2 * nrows_));
355  } else {
356  mePixClustersPhi_ = iBooker.book2D("hitmap_" + hid,
357  "Number of Clusters (1bin=four pixels)",
358  nbinx,
359  0.,
360  float(ncols_),
361  nbiny,
362  0.,
363  float(nrows_));
364  }
365  mePixClustersPhi_->setAxisTitle("Columns", 1);
366  mePixClustersPhi_->setAxisTitle("Rows", 2);
367  } else {
368  // projections of hitmap
370  iBooker.book1D("hitmap_" + hid + "_px", "Number of Clusters (1bin=two columns)", nbinx, 0., float(ncols_));
371  if (isHalfModule) {
372  mePixClustersPhi_py_ = iBooker.book1D(
373  "hitmap_" + hid + "_py", "Number of Clusters (1bin=two rows)", 2 * nbiny, 0., float(2 * nrows_));
374  } else {
376  iBooker.book1D("hitmap_" + hid + "_py", "Number of Clusters (1bin=two rows)", nbiny, 0., float(nrows_));
377  }
378  mePixClustersPhi_px_->setAxisTitle("Columns", 1);
380  }
381  }
382  }
383 
384  if (type == 4 && endcap) {
385  uint32_t blade;
386  blade = PixelEndcapName(DetId(id_), pTT, isUpgrade).bladeName();
387 
388  char sblade[80];
389  sprintf(sblade, "Blade_%02i", blade);
390  hid = src.label() + "_" + sblade;
391  // Number of clusters
392  meNClustersBlade_ = iBooker.book1D("nclusters_" + hid, "Number of Clusters", 8, 0., 8.);
393  meNClustersBlade_->setAxisTitle("Number of Clusters", 1);
394  // Total cluster charge in MeV
395  meChargeBlade_ = iBooker.book1D("charge_" + hid, "Cluster charge", 100, 0., 200.);
396  meChargeBlade_->setAxisTitle("Charge [kilo electrons]", 1);
397  // Total cluster size (in pixels)
398  meSizeBlade_ = iBooker.book1D("size_" + hid, "Total cluster size", 30, 0., 30.);
399  meSizeBlade_->setAxisTitle("Cluster size [number of pixels]", 1);
400  if (!reducedSet) {
401  // Lowest cluster row
402  meMinRowBlade_ = iBooker.book1D("minrow_" + hid, "Lowest cluster row", 200, 0., 200.);
403  meMinRowBlade_->setAxisTitle("Lowest cluster row", 1);
404  // Highest cluster row
405  meMaxRowBlade_ = iBooker.book1D("maxrow_" + hid, "Highest cluster row", 200, 0., 200.);
406  meMaxRowBlade_->setAxisTitle("Highest cluster row", 1);
407  // Lowest cluster column
408  meMinColBlade_ = iBooker.book1D("mincol_" + hid, "Lowest cluster column", 500, 0., 500.);
409  meMinColBlade_->setAxisTitle("Lowest cluster column", 1);
410  // Highest cluster column
411  meMaxColBlade_ = iBooker.book1D("maxcol_" + hid, "Highest cluster column", 500, 0., 500.);
412  meMaxColBlade_->setAxisTitle("Highest cluster column", 1);
413  // Cluster barycenter X position
414  meXBlade_ = iBooker.book1D("x_" + hid, "Cluster barycenter X (row #)", 200, 0., 200.);
415  meXBlade_->setAxisTitle("Barycenter x-position [row #]", 1);
416  // Cluster barycenter Y position
417  meYBlade_ = iBooker.book1D("y_" + hid, "Cluster barycenter Y (column #)", 500, 0., 500.);
418  meYBlade_->setAxisTitle("Barycenter y-position [column #]", 1);
419  // Cluster width on the x-axis
420  meSizeXBlade_ = iBooker.book1D("sizeX_" + hid, "Cluster x-width (rows)", 10, 0., 10.);
421  meSizeXBlade_->setAxisTitle("Cluster x-size [rows]", 1);
422  // Cluster width on the y-axis
423  meSizeYBlade_ = iBooker.book1D("sizeY_" + hid, "Cluster y-width (columns)", 15, 0., 15.);
424  meSizeYBlade_->setAxisTitle("Cluster y-size [columns]", 1);
425  }
426  }
427  if (type == 5 && endcap) {
428  uint32_t disk;
429  disk = PixelEndcapName(DetId(id_), pTT, isUpgrade).diskName();
430 
431  char sdisk[80];
432  sprintf(sdisk, "Disk_%i", disk);
433  hid = src.label() + "_" + sdisk;
434  // Number of clusters
435  meNClustersDisk_ = iBooker.book1D("nclusters_" + hid, "Number of Clusters", 8, 0., 8.);
436  meNClustersDisk_->setAxisTitle("Number of Clusters", 1);
437  // Total cluster charge in MeV
438  meChargeDisk_ = iBooker.book1D("charge_" + hid, "Cluster charge", 100, 0., 200.);
439  meChargeDisk_->setAxisTitle("Charge [kilo electrons]", 1);
440  // Total cluster size (in pixels)
441  meSizeDisk_ = iBooker.book1D("size_" + hid, "Total cluster size", 30, 0., 30.);
442  meSizeDisk_->setAxisTitle("Cluster size [number of pixels]", 1);
443  if (!reducedSet) {
444  // Lowest cluster row
445  meMinRowDisk_ = iBooker.book1D("minrow_" + hid, "Lowest cluster row", 200, 0., 200.);
446  meMinRowDisk_->setAxisTitle("Lowest cluster row", 1);
447  // Highest cluster row
448  meMaxRowDisk_ = iBooker.book1D("maxrow_" + hid, "Highest cluster row", 200, 0., 200.);
449  meMaxRowDisk_->setAxisTitle("Highest cluster row", 1);
450  // Lowest cluster column
451  meMinColDisk_ = iBooker.book1D("mincol_" + hid, "Lowest cluster column", 500, 0., 500.);
452  meMinColDisk_->setAxisTitle("Lowest cluster column", 1);
453  // Highest cluster column
454  meMaxColDisk_ = iBooker.book1D("maxcol_" + hid, "Highest cluster column", 500, 0., 500.);
455  meMaxColDisk_->setAxisTitle("Highest cluster column", 1);
456  // Cluster barycenter X position
457  meXDisk_ = iBooker.book1D("x_" + hid, "Cluster barycenter X (row #)", 200, 0., 200.);
458  meXDisk_->setAxisTitle("Barycenter x-position [row #]", 1);
459  // Cluster barycenter Y position
460  meYDisk_ = iBooker.book1D("y_" + hid, "Cluster barycenter Y (column #)", 500, 0., 500.);
461  meYDisk_->setAxisTitle("Barycenter y-position [column #]", 1);
462  // Cluster width on the x-axis
463  meSizeXDisk_ = iBooker.book1D("sizeX_" + hid, "Cluster x-width (rows)", 10, 0., 10.);
464  meSizeXDisk_->setAxisTitle("Cluster x-size [rows]", 1);
465  // Cluster width on the y-axis
466  meSizeYDisk_ = iBooker.book1D("sizeY_" + hid, "Cluster y-width (columns)", 15, 0., 15.);
467  meSizeYDisk_->setAxisTitle("Cluster y-size [columns]", 1);
468  }
469  }
470 
471  if (type == 6 && endcap) {
472  uint32_t panel;
473  uint32_t module;
474  panel = PixelEndcapName(DetId(id_), pTT, isUpgrade).pannelName();
475  module = PixelEndcapName(DetId(id_), pTT, isUpgrade).plaquetteName();
476 
477  char slab[80];
478  sprintf(slab, "Panel_%i_Ring_%i", panel, module);
479  hid = src.label() + "_" + slab;
480  // Number of clusters
481  meNClustersRing_ = iBooker.book1D("nclusters_" + hid, "Number of Clusters", 8, 0., 8.);
482  meNClustersRing_->setAxisTitle("Number of Clusters", 1);
483  // Total cluster charge in MeV
484  meChargeRing_ = iBooker.book1D("charge_" + hid, "Cluster charge", 100, 0., 200.);
485  meChargeRing_->setAxisTitle("Charge [kilo electrons]", 1);
486  // Total cluster size (in pixels)
487  meSizeRing_ = iBooker.book1D("size_" + hid, "Total cluster size", 30, 0., 30.);
488  meSizeRing_->setAxisTitle("Cluster size [number of pixels]", 1);
489  if (!reducedSet) {
490  // Lowest cluster row
491  meMinRowRing_ = iBooker.book1D("minrow_" + hid, "Lowest cluster row", 200, 0., 200.);
492  meMinRowRing_->setAxisTitle("Lowest cluster row", 1);
493  // Highest cluster row
494  meMaxRowRing_ = iBooker.book1D("maxrow_" + hid, "Highest cluster row", 200, 0., 200.);
495  meMaxRowRing_->setAxisTitle("Highest cluster row", 1);
496  // Lowest cluster column
497  meMinColRing_ = iBooker.book1D("mincol_" + hid, "Lowest cluster column", 500, 0., 500.);
498  meMinColRing_->setAxisTitle("Lowest cluster column", 1);
499  // Highest cluster column
500  meMaxColRing_ = iBooker.book1D("maxcol_" + hid, "Highest cluster column", 500, 0., 500.);
501  meMaxColRing_->setAxisTitle("Highest cluster column", 1);
502  // Cluster barycenter X position
503  meXRing_ = iBooker.book1D("x_" + hid, "Cluster barycenter X (row #)", 200, 0., 200.);
504  meXRing_->setAxisTitle("Barycenter x-position [row #]", 1);
505  // Cluster barycenter Y position
506  meYRing_ = iBooker.book1D("y_" + hid, "Cluster barycenter Y (column #)", 500, 0., 500.);
507  meYRing_->setAxisTitle("Barycenter y-position [column #]", 1);
508  // Cluster width on the x-axis
509  meSizeXRing_ = iBooker.book1D("sizeX_" + hid, "Cluster x-width (rows)", 10, 0., 10.);
510  meSizeXRing_->setAxisTitle("Cluster x-size [rows]", 1);
511  // Cluster width on the y-axis
512  meSizeYRing_ = iBooker.book1D("sizeY_" + hid, "Cluster y-width (columns)", 15, 0., 15.);
513  meSizeYRing_->setAxisTitle("Cluster y-size [columns]", 1);
514  if (twoD) {
515  // 2D hit map
516  mePixClustersRing_ = iBooker.book2D("hitmap_" + hid,
517  "Number of Clusters (1bin=four pixels)",
518  nbinx,
519  0.,
520  float(ncols_),
521  nbiny,
522  0.,
523  float(nrows_));
524  mePixClustersRing_->setAxisTitle("Columns", 1);
525  mePixClustersRing_->setAxisTitle("Rows", 2);
526  } else {
527  // projections of hitmap
529  iBooker.book1D("hitmap_" + hid + "_px", "Number of Clusters (1bin=two columns)", nbinx, 0., float(ncols_));
531  iBooker.book1D("hitmap_" + hid + "_py", "Number of Clusters (1bin=two rows)", nbiny, 0., float(nrows_));
532  mePixClustersRing_px_->setAxisTitle("Columns", 1);
534  }
535  }
536  }
537 }
538 //
539 // Fill histograms
540 //
542  const TrackerGeometry *tracker,
543  int *barrelClusterTotal,
544  int *fpixPClusterTotal,
545  int *fpixMClusterTotal,
546  std::vector<MonitorElement *> &layers,
547  std::vector<MonitorElement *> &diskspz,
548  std::vector<MonitorElement *> &disksmz,
549  bool modon,
550  bool ladon,
551  bool layon,
552  bool phion,
553  bool bladeon,
554  bool diskon,
555  bool ringon,
556  bool twoD,
557  bool reducedSet,
558  bool smileyon,
559  bool isUpgrade) {
560  bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
561  bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
562 
563  edmNew::DetSetVector<SiPixelCluster>::const_iterator isearch = input.find(id_); // search clusters of detid
564  unsigned int numberOfClusters = 0;
565  unsigned int numberOfFpixClusters = 0;
566 
567  if (isearch != input.end()) { // Not an empty iterator
568 
569  // Look at clusters now
571  for (di = isearch->begin(); di != isearch->end(); di++) {
572  numberOfClusters++;
573  if (endcap)
574  numberOfFpixClusters++;
575  if (barrel)
576  (*barrelClusterTotal)++;
577  float charge = 0.001 * (di->charge()); // total charge of cluster
578  float x = di->x(); // barycenter x position
579  float y = di->y(); // barycenter y position
580  int size = di->size(); // total size of cluster (in pixels)
581  int sizeX = di->sizeX(); // size of cluster in x-direction
582  int sizeY = di->sizeY(); // size of cluster in y-direction
583  int minPixelRow = di->minPixelRow(); // min x index
584  int maxPixelRow = di->maxPixelRow(); // max x index
585  int minPixelCol = di->minPixelCol(); // min y index
586  int maxPixelCol = di->maxPixelCol(); // max y index
587 
588  const PixelGeomDetUnit *theGeomDet = dynamic_cast<const PixelGeomDetUnit *>(tracker->idToDet(DetId(id_)));
589 
590  const PixelTopology *topol = &(theGeomDet->specificTopology());
591  LocalPoint clustlp = topol->localPosition(MeasurementPoint(x, y));
592  GlobalPoint clustgp = theGeomDet->surface().toGlobal(clustlp);
593  if (modon)
594  meCharge_->Fill((float)charge);
595  if (modon)
596  meSize_->Fill((float)size);
597 
598  if (barrel) {
599  uint32_t DBlayer = PixelBarrelName(DetId(id_), pTT, isUpgrade).layerName();
600  if (!(DBlayer > layers.size()) && (layers[DBlayer - 1]))
601  layers[DBlayer - 1]->Fill(clustgp.z(), clustgp.phi());
602  } else if (endcap) {
603  uint32_t DBdisk = PixelEndcapName(DetId(id_), pTT, isUpgrade).diskName();
604  if (clustgp.z() > 0) {
605  (*fpixPClusterTotal)++;
606  if (!(DBdisk > diskspz.size()) && (diskspz[DBdisk - 1]))
607  diskspz[DBdisk - 1]->Fill(clustgp.x(), clustgp.y());
608  } else {
609  (*fpixMClusterTotal)++;
610  if (!(DBdisk > disksmz.size()) && (disksmz[DBdisk - 1]))
611  disksmz[DBdisk - 1]->Fill(clustgp.x(), clustgp.y());
612  }
613  }
614  if (!reducedSet) {
615  (meMinRow_)->Fill((int)minPixelRow);
616  (meMaxRow_)->Fill((int)maxPixelRow);
617  (meMinCol_)->Fill((int)minPixelCol);
618  (meMaxCol_)->Fill((int)maxPixelCol);
619  (meSizeX_)->Fill((int)sizeX);
620  (meSizeY_)->Fill((int)sizeY);
621  (meX_)->Fill((float)x);
622  (meY_)->Fill((float)y);
623  if (twoD)
624  (mePixClusters_)->Fill((float)y, (float)x);
625  else {
626  (mePixClusters_px_)->Fill((float)y);
627  (mePixClusters_py_)->Fill((float)x);
628  }
629  }
630 
631  if (barrel && smileyon) {
632  (meSizeYvsEtaBarrel_)->Fill(clustgp.eta(), sizeY);
633  // std::cout << "Cluster Global x y z theta eta " << clustgp.x() << " "
634  // << clustgp.y() << " " << clustgp.z() << " " << clustgp.theta() << " "
635  // << clustgp.eta() << std::endl;
636  }
637  if (ladon && barrel) {
638  (meChargeLad_)->Fill((float)charge);
639  (meSizeLad_)->Fill((int)size);
640  if (!reducedSet) {
641  (meMinRowLad_)->Fill((int)minPixelRow);
642  (meMaxRowLad_)->Fill((int)maxPixelRow);
643  (meMinColLad_)->Fill((int)minPixelCol);
644  (meMaxColLad_)->Fill((int)maxPixelCol);
645  (meXLad_)->Fill((float)x);
646  (meYLad_)->Fill((float)y);
647  (meSizeXLad_)->Fill((int)sizeX);
648  (meSizeYLad_)->Fill((int)sizeY);
649  if (twoD)
650  (mePixClustersLad_)->Fill((float)y, (float)x);
651  else {
652  (mePixClustersLad_px_)->Fill((float)y);
653  (mePixClustersLad_py_)->Fill((float)x);
654  }
655  }
656  }
657  if (layon && barrel) {
658  (meChargeLay_)->Fill((float)charge);
659  (meSizeLay_)->Fill((int)size);
660  if (!reducedSet) {
661  (meMinRowLay_)->Fill((int)minPixelRow);
662  (meMaxRowLay_)->Fill((int)maxPixelRow);
663  (meMinColLay_)->Fill((int)minPixelCol);
664  (meMaxColLay_)->Fill((int)maxPixelCol);
665  (meXLay_)->Fill((float)x);
666  (meYLay_)->Fill((float)y);
667  (meSizeXLay_)->Fill((int)sizeX);
668  (meSizeYLay_)->Fill((int)sizeY);
669  if (twoD)
670  (mePixClustersLay_)->Fill((float)y, (float)x);
671  else {
672  (mePixClustersLay_px_)->Fill((float)y);
673  (mePixClustersLay_py_)->Fill((float)x);
674  }
675  }
676  }
677  if (phion && barrel) {
678  (meChargePhi_)->Fill((float)charge);
679  (meSizePhi_)->Fill((int)size);
680  if (!reducedSet) {
681  (meMinRowPhi_)->Fill((int)minPixelRow);
682  (meMaxRowPhi_)->Fill((int)maxPixelRow);
683  (meMinColPhi_)->Fill((int)minPixelCol);
684  (meMaxColPhi_)->Fill((int)maxPixelCol);
685  (meXPhi_)->Fill((float)x);
686  (meYPhi_)->Fill((float)y);
687  (meSizeXPhi_)->Fill((int)sizeX);
688  (meSizeYPhi_)->Fill((int)sizeY);
689  if (twoD)
690  (mePixClustersPhi_)->Fill((float)y, (float)x);
691  else {
692  (mePixClustersPhi_px_)->Fill((float)y);
693  (mePixClustersPhi_py_)->Fill((float)x);
694  }
695  }
696  }
697  if (bladeon && endcap) {
698  (meChargeBlade_)->Fill((float)charge);
699  (meSizeBlade_)->Fill((int)size);
700  if (!reducedSet) {
701  (meMinRowBlade_)->Fill((int)minPixelRow);
702  (meMaxRowBlade_)->Fill((int)maxPixelRow);
703  (meMinColBlade_)->Fill((int)minPixelCol);
704  (meMaxColBlade_)->Fill((int)maxPixelCol);
705  (meXBlade_)->Fill((float)x);
706  (meYBlade_)->Fill((float)y);
707  (meSizeXBlade_)->Fill((int)sizeX);
708  (meSizeYBlade_)->Fill((int)sizeY);
709  }
710  }
711  if (diskon && endcap) {
712  (meChargeDisk_)->Fill((float)charge);
713  (meSizeDisk_)->Fill((int)size);
714  if (!reducedSet) {
715  (meMinRowDisk_)->Fill((int)minPixelRow);
716  (meMaxRowDisk_)->Fill((int)maxPixelRow);
717  (meMinColDisk_)->Fill((int)minPixelCol);
718  (meMaxColDisk_)->Fill((int)maxPixelCol);
719  (meXDisk_)->Fill((float)x);
720  (meYDisk_)->Fill((float)y);
721  (meSizeXDisk_)->Fill((int)sizeX);
722  (meSizeYDisk_)->Fill((int)sizeY);
723  }
724  }
725 
726  if (ringon && endcap) {
727  (meChargeRing_)->Fill((float)charge);
728  (meSizeRing_)->Fill((int)size);
729  if (!reducedSet) {
730  (meMinRowRing_)->Fill((int)minPixelRow);
731  (meMaxRowRing_)->Fill((int)maxPixelRow);
732  (meMinColRing_)->Fill((int)minPixelCol);
733  (meMaxColRing_)->Fill((int)maxPixelCol);
734  (meXRing_)->Fill((float)x);
735  (meYRing_)->Fill((float)y);
736  (meSizeXRing_)->Fill((int)sizeX);
737  (meSizeYRing_)->Fill((int)sizeY);
738  if (twoD)
739  (mePixClustersRing_)->Fill((float)y, (float)x);
740  else {
741  (mePixClustersRing_px_)->Fill((float)y);
742  (mePixClustersRing_py_)->Fill((float)x);
743  }
744  }
745  }
746  }
747  if (modon)
748  (meNClusters_)->Fill((float)numberOfClusters);
749  if (ladon && barrel)
750  (meNClustersLad_)->Fill((float)numberOfClusters);
751  if (layon && barrel)
752  (meNClustersLay_)->Fill((float)numberOfClusters);
753  if (phion && barrel)
754  (meNClustersPhi_)->Fill((float)numberOfClusters);
755  if (bladeon && endcap)
756  (meNClustersBlade_)->Fill((float)numberOfClusters);
757  if (diskon && endcap)
758  (meNClustersDisk_)->Fill((float)numberOfClusters);
759  if (ringon && endcap)
760  (meNClustersRing_)->Fill((float)numberOfClusters);
761  }
762 
763  // std::cout<<"number of detector units="<<numberOfDetUnits<<std::endl;
764  return numberOfFpixClusters;
765 }
int plaquetteName() const
plaquetteId (in pannel)
size
Write out results.
MonitorElement * meMinColLay_
type
Definition: HCALResponse.h:21
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
T getParameter(std::string const &) const
MonitorElement * meMinRowRing_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
MonitorElement * meMaxColLad_
MonitorElement * meSizePhi_
MonitorElement * meCharge_
MonitorElement * mePixClustersLad_px_
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
MonitorElement * meMaxCol_
MonitorElement * meMaxColPhi_
MonitorElement * meNClustersLad_
MonitorElement * meYBlade_
int moduleName() const
module id (index in z)
MonitorElement * meMinRowLad_
MonitorElement * meSizeYLay_
const TrackerTopology * pTT
MonitorElement * meSize_
MonitorElement * meSizeYLad_
MonitorElement * meSizeXLad_
MonitorElement * meSizeXLay_
MonitorElement * meMinRow_
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
MonitorElement * meMaxRowRing_
MonitorElement * mePixClustersLay_
T y() const
Definition: PV3DBase.h:63
MonitorElement * meSizeYBlade_
SiPixelClusterModule()
Default constructor.
data_type const * const_iterator
Definition: DetSetNew.h:30
MonitorElement * meMinRowBlade_
MonitorElement * meNClustersPhi_
MonitorElement * meChargePhi_
MonitorElement * meMinColPhi_
MonitorElement * meNClustersBlade_
MonitorElement * mePixClustersPhi_py_
MonitorElement * meMinRowDisk_
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
MonitorElement * mePixClustersRing_px_
MonitorElement * meMaxRowLad_
static std::string const input
Definition: EdmProvDump.cc:48
MonitorElement * meMinRowLay_
void Fill(long long x)
MonitorElement * meMinColBlade_
void book(const edm::ParameterSet &iConfig, const edm::EventSetup &iSetup, DQMStore::IBooker &iBooker, int type=0, bool twoD=true, bool reducedSet=false, bool isUpgrade=false)
Book histograms.
MonitorElement * meSizeYDisk_
MonitorElement * meSizeDisk_
MonitorElement * meMaxColRing_
MonitorElement * meMinColLad_
int bladeName() const
blade id
MonitorElement * meMaxRowBlade_
MonitorElement * meChargeRing_
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
MonitorElement * mePixClustersLad_
bool isHalfModule() const
full or half module
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
~SiPixelClusterModule()
Destructor.
MonitorElement * meMaxRowPhi_
MonitorElement * meMinRowPhi_
MonitorElement * meMinColDisk_
MonitorElement * meMinCol_
MonitorElement * mePixClusters_py_
T z() const
Definition: PV3DBase.h:64
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * mePixClustersLay_px_
MonitorElement * meNClustersDisk_
MonitorElement * meSizeYRing_
int fill(const edmNew::DetSetVector< SiPixelCluster > &input, const TrackerGeometry *tracker, int *barrelClusterTotal, int *fpixPClusterTotal, int *fpixMClusterTotal, std::vector< MonitorElement * > &layers, std::vector< MonitorElement * > &diskspz, std::vector< MonitorElement * > &disksmz, bool modon=true, bool ladon=false, bool layon=false, bool phion=false, bool bladeon=false, bool diskon=false, bool ringon=false, bool twoD=true, bool reducedSet=false, bool smileyon=false, bool isUpgrade=false)
Fill histograms.
MonitorElement * mePixClustersRing_
MonitorElement * meSizeX_
MonitorElement * meSizeY_
MonitorElement * meMaxRowLay_
MonitorElement * meChargeDisk_
MonitorElement * meMaxColBlade_
MonitorElement * mePixClustersPhi_
MonitorElement * meChargeBlade_
MonitorElement * mePixClustersLay_py_
MonitorElement * meMinColRing_
MonitorElement * meNClustersLay_
MonitorElement * meMaxColLay_
std::string setHistoId(std::string variable, uint32_t &rawId)
Set Histogram Id.
MonitorElement * meMaxRowDisk_
Definition: DetId.h:18
int ladderName() const
ladder id (index in phi)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * meNClustersRing_
MonitorElement * meSizeYvsEtaBarrel_
MonitorElement * mePixClustersLad_py_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
int layerName() const
layer id
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
MonitorElement * meSizeRing_
MonitorElement * mePixClusters_px_
std::string const & label() const
Definition: InputTag.h:36
const_iterator find(id_type i, bool update=false) const
T eta() const
Definition: PV3DBase.h:76
MonitorElement * meSizeXPhi_
MonitorElement * meSizeXRing_
MonitorElement * mePixClusters_
MonitorElement * meSizeXBlade_
int pannelName() const
pannel id
T get() const
Definition: EventSetup.h:71
MonitorElement * meMaxRow_
const TrackerGeomDet * idToDet(DetId) const override
MonitorElement * meChargeLad_
MonitorElement * meSizeLad_
MonitorElement * meSizeBlade_
MonitorElement * mePixClustersRing_py_
int diskName() const
disk id
MonitorElement * meSizeXDisk_
size_type size() const
Definition: DetSetNew.h:87
MonitorElement * meSizeYPhi_
T x() const
Definition: PV3DBase.h:62
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * mePixClustersPhi_px_
T const * product() const
Definition: ESHandle.h:86
Definition: vlib.h:208
MonitorElement * meXBlade_
MonitorElement * meChargeLay_
const_iterator begin(bool update=false) const
MonitorElement * meNClusters_
MonitorElement * meSizeLay_
MonitorElement * meMaxColDisk_