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