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