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