CMS 3D CMS Logo

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