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