test
CMS 3D CMS Logo

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