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