CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelTrackResidualModule.cc
Go to the documentation of this file.
1 // Package: SiPixelMonitorTrack
2 // Class: SiPixelTrackResidualModule
3 //
4 // class SiPixelTrackResidualModule SiPixelTrackResidualModule.cc
5 // DQM/SiPixelMonitorTrack/src/SiPixelTrackResidualModule.cc
6 //
7 // Description: SiPixel hit-to-track residual data quality monitoring modules
8 // Implementation: prototype -> improved -> never final - end of the 1st step
9 //
10 // Original Author: Shan-Huei Chuang
11 // Created: Fri Mar 23 18:41:42 CET 2007
12 // $Id: SiPixelTrackResidualModule.cc,v 1.10 2012/09/11 09:37:41 clseitz Exp $
13 
14 
15 #include <string>
16 #include <iostream>
17 
24 
25 // Data Formats
30 
31 
32 using namespace std;
33 
34 
36  bBookTracks = true;
37 }
38 
39 
41  bBookTracks = true;
42 }
43 
44 
46 
47 }
48 
49 
50 void SiPixelTrackResidualModule::book(const edm::ParameterSet& iConfig, bool reducedSet, int type) {
52 
53  bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
54  bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
55  bool isHalfModule = false;
56  if(barrel){
57  isHalfModule = PixelBarrelName(DetId(id_)).isHalfModule();
58  }
59 
60  edm::InputTag src = iConfig.getParameter<edm::InputTag>("src");
61  std::string hisID;
62 
63  if(type==0){
64  SiPixelHistogramId* theHistogramId = new SiPixelHistogramId(src.label());
65  hisID = theHistogramId->setHistoId("residualX",id_);
66  meResidualX_ = dbe->book1D(hisID,"Hit-to-Track Residual in r-phi",100,-150,150);
67  meResidualX_->setAxisTitle("hit-to-track residual in r-phi (um)",1);
68  hisID = theHistogramId->setHistoId("residualY",id_);
69  meResidualY_ = dbe->book1D(hisID,"Hit-to-Track Residual in Z",100,-300,300);
70  meResidualY_->setAxisTitle("hit-to-track residual in z (um)",1);
71  // Number of clusters
72  hisID = theHistogramId->setHistoId("nclusters_OnTrack",id_);
73  meNClusters_onTrack_ = dbe->book1D(hisID,"Number of Clusters (on Track)",10,0.,10.);
74  meNClusters_onTrack_->setAxisTitle("Number of Clusters on Track",1);
75  // Total cluster charge in ke
76  hisID = theHistogramId->setHistoId("charge_OnTrack",id_);
77  meCharge_onTrack_ = dbe->book1D(hisID,"Normalized Cluster charge (on Track)",100,0.,200.);
78  meCharge_onTrack_->setAxisTitle("Charge [kilo electrons]",1);
79  // Total cluster size (in pixels)
80  hisID = theHistogramId->setHistoId("size_OnTrack",id_);
81  meSize_onTrack_ = dbe->book1D(hisID,"Total cluster size (on Track)",30,0.,30.);
82  meSize_onTrack_->setAxisTitle("Cluster size [number of pixels]",1);
83  // Number of clusters
84  hisID = theHistogramId->setHistoId("nclusters_OffTrack",id_);
85  meNClusters_offTrack_ = dbe->book1D(hisID,"Number of Clusters (off Track)",35,0.,35.);
86  meNClusters_offTrack_->setAxisTitle("Number of Clusters off Track",1);
87  // Total cluster charge in ke
88  hisID = theHistogramId->setHistoId("charge_OffTrack",id_);
89  meCharge_offTrack_ = dbe->book1D(hisID,"Cluster charge (off Track)",100,0.,200.);
90  meCharge_offTrack_->setAxisTitle("Charge [kilo electrons]",1);
91  // Total cluster size (in pixels)
92  hisID = theHistogramId->setHistoId("size_OffTrack",id_);
93  meSize_offTrack_ = dbe->book1D(hisID,"Total cluster size (off Track)",30,0.,30.);
94  meSize_offTrack_->setAxisTitle("Cluster size [number of pixels]",1);
95  if(!reducedSet){
96  // Cluster width on the x-axis
97  hisID = theHistogramId->setHistoId("sizeX_OnTrack",id_);
98  meSizeX_onTrack_ = dbe->book1D(hisID,"Cluster x-width (rows) (on Track)",10,0.,10.);
99  meSizeX_onTrack_->setAxisTitle("Cluster x-size [rows]",1);
100  // Cluster width on the y-axis
101  hisID = theHistogramId->setHistoId("sizeY_OnTrack",id_);
102  meSizeY_onTrack_ = dbe->book1D(hisID,"Cluster y-width (columns) (on Track)",15,0.,15.);
103  meSizeY_onTrack_->setAxisTitle("Cluster y-size [columns]",1);
104  // Cluster width on the x-axis
105  hisID = theHistogramId->setHistoId("sizeX_OffTrack",id_);
106  meSizeX_offTrack_ = dbe->book1D(hisID,"Cluster x-width (rows) (off Track)",10,0.,10.);
107  meSizeX_offTrack_->setAxisTitle("Cluster x-size [rows]",1);
108  // Cluster width on the y-axis
109  hisID = theHistogramId->setHistoId("sizeY_OffTrack",id_);
110  meSizeY_offTrack_ = dbe->book1D(hisID,"Cluster y-width (columns) (off Track)",15,0.,15.);
111  meSizeY_offTrack_->setAxisTitle("Cluster y-size [columns]",1);
112  }
113  delete theHistogramId;
114  }
115 
116  if(type==1 && barrel){
117  uint32_t DBladder = PixelBarrelName(DetId(id_)).ladderName();
118  char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
119  hisID = src.label() + "_" + sladder;
120  if(isHalfModule) hisID += "H";
121  else hisID += "F";
122  meResidualXLad_ = dbe->book1D("residualX_"+hisID,"Hit-to-Track Residual in r-phi",100,-150,150);
123  meResidualXLad_->setAxisTitle("hit-to-track residual in r-phi (um)",1);
124  meResidualYLad_ = dbe->book1D("residualY_"+hisID,"Hit-to-Track Residual in Z",100,-300,300);
125  meResidualYLad_->setAxisTitle("hit-to-track residual in z (um)",1);
126  // Number of clusters
127  meNClusters_onTrackLad_ = dbe->book1D("nclusters_OnTrack_" + hisID,"Number of Clusters (on Track)",10,0.,10.);
128  meNClusters_onTrackLad_->setAxisTitle("Number of Clusters on Track",1);
129  // Total cluster charge in MeV
130  meCharge_onTrackLad_ = dbe->book1D("charge_OnTrack_" + hisID,"Normalized Cluster charge (on Track)",100,0.,200.);
131  meCharge_onTrackLad_->setAxisTitle("Charge [kilo electrons]",1);
132  // Total cluster size (in pixels)
133  meSize_onTrackLad_ = dbe->book1D("size_OnTrack_" + hisID,"Total cluster size (on Track)",30,0.,30.);
134  meSize_onTrackLad_->setAxisTitle("Cluster size [number of pixels]",1);
135  // Number of clusters
136  meNClusters_offTrackLad_ = dbe->book1D("nclusters_OffTrack_" + hisID,"Number of Clusters (off Track)",35,0.,35.);
137  meNClusters_offTrackLad_->setAxisTitle("Number of Clusters off Track",1);
138  // Total cluster charge in MeV
139  meCharge_offTrackLad_ = dbe->book1D("charge_OffTrack_" + hisID,"Cluster charge (off Track)",100,0.,200.);
140  meCharge_offTrackLad_->setAxisTitle("Charge [kilo electrons]",1);
141  // Total cluster size (in pixels)
142  meSize_offTrackLad_ = dbe->book1D("size_OffTrack_" + hisID,"Total cluster size (off Track)",30,0.,30.);
143  meSize_offTrackLad_->setAxisTitle("Cluster size [number of pixels]",1);
144  if(!reducedSet){
145  // Cluster width on the x-axis
146  meSizeX_offTrackLad_ = dbe->book1D("sizeX_OffTrack_" + hisID,"Cluster x-width (rows) (off Track)",10,0.,10.);
147  meSizeX_offTrackLad_->setAxisTitle("Cluster x-size [rows]",1);
148  // Cluster width on the y-axis
149  meSizeY_offTrackLad_ = dbe->book1D("sizeY_OffTrack_" + hisID,"Cluster y-width (columns) (off Track)",15,0.,15.);
150  meSizeY_offTrackLad_->setAxisTitle("Cluster y-size [columns]",1);
151  // Cluster width on the x-axis
152  meSizeX_onTrackLad_ = dbe->book1D("sizeX_OnTrack_" + hisID,"Cluster x-width (rows) (on Track)",10,0.,10.);
153  meSizeX_onTrackLad_->setAxisTitle("Cluster x-size [rows]",1);
154  // Cluster width on the y-axis
155  meSizeY_onTrackLad_ = dbe->book1D("sizeY_OnTrack_" + hisID,"Cluster y-width (columns) (on Track)",15,0.,15.);
156  meSizeY_onTrackLad_->setAxisTitle("Cluster y-size [columns]",1);
157  }
158  }
159 
160  if(type==2 && barrel){
161  uint32_t DBlayer = PixelBarrelName(DetId(id_)).layerName();
162  char slayer[80]; sprintf(slayer,"Layer_%i",DBlayer);
163  hisID = src.label() + "_" + slayer;
164  meResidualXLay_ = dbe->book1D("residualX_"+hisID,"Hit-to-Track Residual in r-phi",100,-150,150);
165  meResidualXLay_->setAxisTitle("hit-to-track residual in r-phi (um)",1);
166  meResidualYLay_ = dbe->book1D("residualY_"+hisID,"Hit-to-Track Residual in Z",100,-300,300);
167  meResidualYLay_->setAxisTitle("hit-to-track residual in z (um)",1);
168  // Number of clusters
169  meNClusters_onTrackLay_ = dbe->book1D("nclusters_OnTrack_" + hisID,"Number of Clusters (on Track)",10,0.,10.);
170  meNClusters_onTrackLay_->setAxisTitle("Number of Clusters on Track",1);
171  // Total cluster charge in MeV
172  meCharge_onTrackLay_ = dbe->book1D("charge_OnTrack_" + hisID,"Normalized Cluster charge (on Track)",100,0.,200.);
173  meCharge_onTrackLay_->setAxisTitle("Charge [kilo electrons]",1);
174  // Total cluster size (in pixels)
175  meSize_onTrackLay_ = dbe->book1D("size_OnTrack_" + hisID,"Total cluster size (on Track)",30,0.,30.);
176  meSize_onTrackLay_->setAxisTitle("Cluster size [number of pixels]",1);
177  // Number of clusters
178  meNClusters_offTrackLay_ = dbe->book1D("nclusters_OffTrack_" + hisID,"Number of Clusters (off Track)",35,0.,35.);
179  meNClusters_offTrackLay_->setAxisTitle("Number of Clusters off Track",1);
180  // Total cluster charge in MeV
181  meCharge_offTrackLay_ = dbe->book1D("charge_OffTrack_" + hisID,"Cluster charge (off Track)",100,0.,200.);
182  meCharge_offTrackLay_->setAxisTitle("Charge [kilo electrons]",1);
183  // Total cluster size (in pixels)
184  meSize_offTrackLay_ = dbe->book1D("size_OffTrack_" + hisID,"Total cluster size (off Track)",30,0.,30.);
185  meSize_offTrackLay_->setAxisTitle("Cluster size [number of pixels]",1);
186  if(!reducedSet){
187  // Cluster width on the x-axis
188  meSizeX_onTrackLay_ = dbe->book1D("sizeX_OnTrack_" + hisID,"Cluster x-width (rows) (on Track)",10,0.,10.);
189  meSizeX_onTrackLay_->setAxisTitle("Cluster x-size [rows]",1);
190  // Cluster width on the y-axis
191  meSizeY_onTrackLay_ = dbe->book1D("sizeY_OnTrack_" + hisID,"Cluster y-width (columns) (on Track)",15,0.,15.);
192  meSizeY_onTrackLay_->setAxisTitle("Cluster y-size [columns]",1);
193  // Cluster width on the x-axis
194  meSizeX_offTrackLay_ = dbe->book1D("sizeX_OffTrack_" + hisID,"Cluster x-width (rows) (off Track)",10,0.,10.);
195  meSizeX_offTrackLay_->setAxisTitle("Cluster x-size [rows]",1);
196  // Cluster width on the y-axis
197  meSizeY_offTrackLay_ = dbe->book1D("sizeY_OffTrack_" + hisID,"Cluster y-width (columns) (off Track)",15,0.,15.);
198  meSizeY_offTrackLay_->setAxisTitle("Cluster y-size [columns]",1);
199  }
200  }
201 
202  if(type==3 && barrel){
203  uint32_t DBmodule = PixelBarrelName(DetId(id_)).moduleName();
204  char smodule[80]; sprintf(smodule,"Ring_%i",DBmodule);
205  hisID = src.label() + "_" + smodule;
206  meResidualXPhi_ = dbe->book1D("residualX_"+hisID,"Hit-to-Track Residual in r-phi",100,-150,150);
207  meResidualXPhi_->setAxisTitle("hit-to-track residual in r-phi (um)",1);
208  meResidualYPhi_ = dbe->book1D("residualY_"+hisID,"Hit-to-Track Residual in Z",100,-300,300);
209  meResidualYPhi_->setAxisTitle("hit-to-track residual in z (um)",1);
210  // Number of clusters
211  meNClusters_onTrackPhi_ = dbe->book1D("nclusters_OnTrack_" + hisID,"Number of Clusters (on Track)",10,0.,10.);
212  meNClusters_onTrackPhi_->setAxisTitle("Number of Clusters on Track",1);
213  // Total cluster charge in MeV
214  meCharge_onTrackPhi_ = dbe->book1D("charge_OnTrack_" + hisID,"Normalized Cluster charge (on Track)",100,0.,200.);
215  meCharge_onTrackPhi_->setAxisTitle("Charge [kilo electrons]",1);
216  // Total cluster size (in pixels)
217  meSize_onTrackPhi_ = dbe->book1D("size_OnTrack_" + hisID,"Total cluster size (on Track)",30,0.,30.);
218  meSize_onTrackPhi_->setAxisTitle("Cluster size [number of pixels]",1);
219  // Number of clusters
220  meNClusters_offTrackPhi_ = dbe->book1D("nclusters_OffTrack_" + hisID,"Number of Clusters (off Track)",35,0.,35.);
221  meNClusters_offTrackPhi_->setAxisTitle("Number of Clusters off Track",1);
222  // Total cluster charge in MeV
223  meCharge_offTrackPhi_ = dbe->book1D("charge_OffTrack_" + hisID,"Cluster charge (off Track)",100,0.,200.);
224  meCharge_offTrackPhi_->setAxisTitle("Charge [kilo electrons]",1);
225  // Total cluster size (in pixels)
226  meSize_offTrackPhi_ = dbe->book1D("size_OffTrack_" + hisID,"Total cluster size (off Track)",30,0.,30.);
227  meSize_offTrackPhi_->setAxisTitle("Cluster size [number of pixels]",1);
228  if(!reducedSet){
229  // Cluster width on the x-axis
230  meSizeX_onTrackPhi_ = dbe->book1D("sizeX_OnTrack_" + hisID,"Cluster x-width (rows) (on Track)",10,0.,10.);
231  meSizeX_onTrackPhi_->setAxisTitle("Cluster x-size [rows]",1);
232  // Cluster width on the y-axis
233  meSizeY_onTrackPhi_ = dbe->book1D("sizeY_OnTrack_" + hisID,"Cluster y-width (columns) (on Track)",15,0.,15.);
234  meSizeY_onTrackPhi_->setAxisTitle("Cluster y-size [columns]",1);
235  // Cluster width on the x-axis
236  meSizeX_offTrackPhi_ = dbe->book1D("sizeX_OffTrack_" + hisID,"Cluster x-width (rows) (off Track)",10,0.,10.);
237  meSizeX_offTrackPhi_->setAxisTitle("Cluster x-size [rows]",1);
238  // Cluster width on the y-axis
239  meSizeY_offTrackPhi_ = dbe->book1D("sizeY_OffTrack_" + hisID,"Cluster y-width (columns) (off Track)",15,0.,15.);
240  meSizeY_offTrackPhi_->setAxisTitle("Cluster y-size [columns]",1);
241  }
242  }
243 
244  if(type==4 && endcap){
245  uint32_t blade= PixelEndcapName(DetId(id_)).bladeName();
246  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
247  hisID = src.label() + "_" + sblade;
248  meResidualXBlade_ = dbe->book1D("residualX_"+hisID,"Hit-to-Track Residual in r-phi",100,-150,150);
249  meResidualXBlade_->setAxisTitle("hit-to-track residual in r-phi (um)",1);
250  meResidualYBlade_ = dbe->book1D("residualY_"+hisID,"Hit-to-Track Residual in Z",100,-300,300);
251  meResidualYBlade_->setAxisTitle("hit-to-track residual in z (um)",1);
252  // Number of clusters
253  meNClusters_onTrackBlade_ = dbe->book1D("nclusters_OnTrack_" + hisID,"Number of Clusters (on Track)",10,0.,10.);
254  meNClusters_onTrackBlade_->setAxisTitle("Number of Clusters on Track",1);
255  // Total cluster charge in MeV
256  meCharge_onTrackBlade_ = dbe->book1D("charge_OnTrack_" + hisID,"Normalized Cluster charge (on Track)",100,0.,200.);
257  meCharge_onTrackBlade_->setAxisTitle("Charge [kilo electrons]",1);
258  // Total cluster size (in pixels)
259  meSize_onTrackBlade_ = dbe->book1D("size_OnTrack_" + hisID,"Total cluster size (on Track)",30,0.,30.);
260  meSize_onTrackBlade_->setAxisTitle("Cluster size [number of pixels]",1);
261  // Number of clusters
262  meNClusters_offTrackBlade_ = dbe->book1D("nclusters_OffTrack_" + hisID,"Number of Clusters (off Track)",35,0.,35.);
263  meNClusters_offTrackBlade_->setAxisTitle("Number of Clusters off Track",1);
264  // Total cluster charge in MeV
265  meCharge_offTrackBlade_ = dbe->book1D("charge_OffTrack_" + hisID,"Cluster charge (off Track)",100,0.,200.);
266  meCharge_offTrackBlade_->setAxisTitle("Charge [kilo electrons]",1);
267  // Total cluster size (in pixels)
268  meSize_offTrackBlade_ = dbe->book1D("size_OffTrack_" + hisID,"Total cluster size (off Track)",30,0.,30.);
269  meSize_offTrackBlade_->setAxisTitle("Cluster size [number of pixels]",1);
270  if(!reducedSet){
271  // Cluster width on the x-axis
272  meSizeX_onTrackBlade_ = dbe->book1D("sizeX_OnTrack_" + hisID,"Cluster x-width (rows) (on Track)",10,0.,10.);
273  meSizeX_onTrackBlade_->setAxisTitle("Cluster x-size [rows]",1);
274  // Cluster width on the y-axis
275  meSizeY_onTrackBlade_ = dbe->book1D("sizeY_OnTrack_" + hisID,"Cluster y-width (columns) (on Track)",15,0.,15.);
276  meSizeY_onTrackBlade_->setAxisTitle("Cluster y-size [columns]",1);
277  // Cluster width on the x-axis
278  meSizeX_offTrackBlade_ = dbe->book1D("sizeX_OffTrack_" + hisID,"Cluster x-width (rows) (off Track)",10,0.,10.);
279  meSizeX_offTrackBlade_->setAxisTitle("Cluster x-size [rows]",1);
280  // Cluster width on the y-axis
281  meSizeY_offTrackBlade_ = dbe->book1D("sizeY_OffTrack_" + hisID,"Cluster y-width (columns) (off Track)",15,0.,15.);
282  meSizeY_offTrackBlade_->setAxisTitle("Cluster y-size [columns]",1);
283  }
284  }
285 
286  if(type==5 && endcap){
287  uint32_t disk = PixelEndcapName(DetId(id_)).diskName();
288  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
289  hisID = src.label() + "_" + sdisk;
290  meResidualXDisk_ = dbe->book1D("residualX_"+hisID,"Hit-to-Track Residual in r-phi",100,-150,150);
291  meResidualXDisk_->setAxisTitle("hit-to-track residual in r-phi (um)",1);
292  meResidualYDisk_ = dbe->book1D("residualY_"+hisID,"Hit-to-Track Residual in Z",100,-300,300);
293  meResidualYDisk_->setAxisTitle("hit-to-track residual in z (um)",1);
294  // Number of clusters
295  meNClusters_onTrackDisk_ = dbe->book1D("nclusters_OnTrack_" + hisID,"Number of Clusters (on Track)",10,0.,10.);
296  meNClusters_onTrackDisk_->setAxisTitle("Number of Clusters on Track",1);
297  // Total cluster charge in MeV
298  meCharge_onTrackDisk_ = dbe->book1D("charge_OnTrack_" + hisID,"Normalized Cluster charge (on Track)",100,0.,200.);
299  meCharge_onTrackDisk_->setAxisTitle("Charge [kilo electrons]",1);
300  // Total cluster size (in pixels)
301  meSize_onTrackDisk_ = dbe->book1D("size_OnTrack_" + hisID,"Total cluster size (on Track)",30,0.,30.);
302  meSize_onTrackDisk_->setAxisTitle("Cluster size [number of pixels]",1);
303  // Number of clusters
304  meNClusters_offTrackDisk_ = dbe->book1D("nclusters_OffTrack_" + hisID,"Number of Clusters (off Track)",35,0.,35.);
305  meNClusters_offTrackDisk_->setAxisTitle("Number of Clusters off Track",1);
306  // Total cluster charge in MeV
307  meCharge_offTrackDisk_ = dbe->book1D("charge_OffTrack_" + hisID,"Cluster charge (off Track)",100,0.,200.);
308  meCharge_offTrackDisk_->setAxisTitle("Charge [kilo electrons]",1);
309  // Total cluster size (in pixels)
310  meSize_offTrackDisk_ = dbe->book1D("size_OffTrack_" + hisID,"Total cluster size (off Track)",30,0.,30.);
311  meSize_offTrackDisk_->setAxisTitle("Cluster size [number of pixels]",1);
312  if(!reducedSet){
313  // Cluster width on the x-axis
314  meSizeX_onTrackDisk_ = dbe->book1D("sizeX_OnTrack_" + hisID,"Cluster x-width (rows) (on Track)",10,0.,10.);
315  meSizeX_onTrackDisk_->setAxisTitle("Cluster x-size [rows]",1);
316  // Cluster width on the y-axis
317  meSizeY_onTrackDisk_ = dbe->book1D("sizeY_OnTrack_" + hisID,"Cluster y-width (columns) (on Track)",15,0.,15.);
318  meSizeY_onTrackDisk_->setAxisTitle("Cluster y-size [columns]",1);
319  // Cluster width on the x-axis
320  meSizeX_offTrackDisk_ = dbe->book1D("sizeX_OffTrack_" + hisID,"Cluster x-width (rows) (off Track)",10,0.,10.);
321  meSizeX_offTrackDisk_->setAxisTitle("Cluster x-size [rows]",1);
322  // Cluster width on the y-axis
323  meSizeY_offTrackDisk_ = dbe->book1D("sizeY_OffTrack_" + hisID,"Cluster y-width (columns) (off Track)",15,0.,15.);
324  meSizeY_offTrackDisk_->setAxisTitle("Cluster y-size [columns]",1);
325  }
326  }
327 
328  if(type==6 && endcap){
329  uint32_t panel= PixelEndcapName(DetId(id_)).pannelName();
331  char slab[80]; sprintf(slab, "Panel_%i_Ring_%i",panel, module);
332  hisID = src.label() + "_" + slab;
333  meResidualXRing_ = dbe->book1D("residualX_"+hisID,"Hit-to-Track Residual in r-phi",100,-150,150);
334  meResidualXRing_->setAxisTitle("hit-to-track residual in r-phi (um)",1);
335  meResidualYRing_ = dbe->book1D("residualY_"+hisID,"Hit-to-Track Residual in Z",100,-300,300);
336  meResidualYRing_->setAxisTitle("hit-to-track residual in z (um)",1);
337  // Number of clusters
338  meNClusters_onTrackRing_ = dbe->book1D("nclusters_OnTrack_" + hisID,"Number of Clusters (on Track)",10,0.,10.);
339  meNClusters_onTrackRing_->setAxisTitle("Number of Clusters on Track",1);
340  // Total cluster charge in MeV
341  meCharge_onTrackRing_ = dbe->book1D("charge_OnTrack_" + hisID,"Normalized Cluster charge (on Track)",100,0.,200.);
342  meCharge_onTrackRing_->setAxisTitle("Charge [kilo electrons]",1);
343  // Total cluster size (in pixels)
344  meSize_onTrackRing_ = dbe->book1D("size_OnTrack_" + hisID,"Total cluster size (on Track)",30,0.,30.);
345  meSize_onTrackRing_->setAxisTitle("Cluster size [number of pixels]",1);
346  // Number of clusters
347  meNClusters_offTrackRing_ = dbe->book1D("nclusters_OffTrack_" + hisID,"Number of Clusters (off Track)",35,0.,35.);
348  meNClusters_offTrackRing_->setAxisTitle("Number of Clusters off Track",1);
349  // Total cluster charge in MeV
350  meCharge_offTrackRing_ = dbe->book1D("charge_OffTrack_" + hisID,"Cluster charge (off Track)",100,0.,200.);
351  meCharge_offTrackRing_->setAxisTitle("Charge [kilo electrons]",1);
352  // Total cluster size (in pixels)
353  meSize_offTrackRing_ = dbe->book1D("size_OffTrack_" + hisID,"Total cluster size (off Track)",30,0.,30.);
354  meSize_offTrackRing_->setAxisTitle("Cluster size [number of pixels]",1);
355  if(!reducedSet){
356  // Cluster width on the x-axis
357  meSizeX_onTrackRing_ = dbe->book1D("sizeX_OnTrack_" + hisID,"Cluster x-width (rows) (on Track)",10,0.,10.);
358  meSizeX_onTrackRing_->setAxisTitle("Cluster x-size [rows]",1);
359  // Cluster width on the y-axis
360  meSizeY_onTrackRing_ = dbe->book1D("sizeY_OnTrack_" + hisID,"Cluster y-width (columns) (on Track)",15,0.,15.);
361  meSizeY_onTrackRing_->setAxisTitle("Cluster y-size [columns]",1);
362  // Cluster width on the x-axis
363  meSizeX_offTrackRing_ = dbe->book1D("sizeX_OffTrack_" + hisID,"Cluster x-width (rows) (off Track)",10,0.,10.);
364  meSizeX_offTrackRing_->setAxisTitle("Cluster x-size [rows]",1);
365  // Cluster width on the y-axis
366  meSizeY_offTrackRing_ = dbe->book1D("sizeY_OffTrack_" + hisID,"Cluster y-width (columns) (off Track)",15,0.,15.);
367  meSizeY_offTrackRing_->setAxisTitle("Cluster y-size [columns]",1);
368  }
369  }
370 }
371 
372 
373 void SiPixelTrackResidualModule::fill(const Measurement2DVector& residual, bool reducedSet, bool modon, bool ladon, bool layon, bool phion, bool bladeon, bool diskon, bool ringon) {
374 
375  bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
376  bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
377 
378  if(modon){
379  (meResidualX_)->Fill(residual.x());
380  (meResidualY_)->Fill(residual.y());
381  }
382 
383  if(ladon && barrel){
384  (meResidualXLad_)->Fill(residual.x());
385  (meResidualYLad_)->Fill(residual.y());
386  }
387 
388  if(layon && barrel){
389  (meResidualXLay_)->Fill(residual.x());
390  (meResidualYLay_)->Fill(residual.y());
391  }
392  if(phion && barrel){
393  (meResidualXPhi_)->Fill(residual.x());
394  (meResidualYPhi_)->Fill(residual.y());
395  }
396 
397  if(bladeon && endcap){
398  (meResidualXBlade_)->Fill(residual.x());
399  (meResidualYBlade_)->Fill(residual.y());
400  }
401 
402  if(diskon && endcap){
403  (meResidualXDisk_)->Fill(residual.x());
404  (meResidualYDisk_)->Fill(residual.y());
405  }
406 
407  if(ringon && endcap){
408  (meResidualXRing_)->Fill(residual.x());
409  (meResidualYRing_)->Fill(residual.y());
410  }
411 }
412 
413 
414 void SiPixelTrackResidualModule::fill(const SiPixelCluster &clust, bool onTrack, double corrCharge, bool reducedSet, bool modon, bool ladon, bool layon, bool phion, bool bladeon, bool diskon, bool ringon){
415 
416  bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
417  bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
418 
419  float charge = 0.001*(clust.charge()); // total charge of cluster
420  if(onTrack) charge = corrCharge; // corrected cluster charge
421  int size = clust.size(); // total size of cluster (in pixels)
422  int sizeX = clust.sizeX(); // size of cluster in x-clustrection
423  int sizeY = clust.sizeY(); // size of cluster in y-direction
424 
425  if(onTrack){
426  if(modon){
427  (meCharge_onTrack_)->Fill((float)charge);
428  (meSize_onTrack_)->Fill((int)size);
429  if(!reducedSet){
430  (meSizeX_onTrack_)->Fill((int)sizeX);
431  (meSizeY_onTrack_)->Fill((int)sizeY);
432  }
433  }
434  if(barrel && ladon){
435  (meCharge_onTrackLad_)->Fill((float)charge);
436  (meSize_onTrackLad_)->Fill((int)size);
437  if(!reducedSet){
438  (meSizeX_onTrackLad_)->Fill((int)sizeX);
439  (meSizeY_onTrackLad_)->Fill((int)sizeY);
440  }
441  }
442  if(barrel && layon){
443  (meCharge_onTrackLay_)->Fill((float)charge);
444  (meSize_onTrackLay_)->Fill((int)size);
445  if(!reducedSet){
446  (meSizeX_onTrackLay_)->Fill((int)sizeX);
447  (meSizeY_onTrackLay_)->Fill((int)sizeY);
448  }
449  }
450  if(barrel && phion){
451  (meCharge_onTrackPhi_)->Fill((float)charge);
452  (meSize_onTrackPhi_)->Fill((int)size);
453  if(!reducedSet){
454  (meSizeX_onTrackPhi_)->Fill((int)sizeX);
455  (meSizeY_onTrackPhi_)->Fill((int)sizeY);
456  }
457  }
458  if(endcap && bladeon){
460  (meSize_onTrackBlade_)->Fill((int)size);
461  if(!reducedSet){
462  (meSizeX_onTrackBlade_)->Fill((int)sizeX);
463  (meSizeY_onTrackBlade_)->Fill((int)sizeY);
464  }
465  }
466  if(endcap && diskon){
467  (meCharge_onTrackDisk_)->Fill((float)charge);
468  (meSize_onTrackDisk_)->Fill((int)size);
469  if(!reducedSet){
470  (meSizeX_onTrackDisk_)->Fill((int)sizeX);
471  (meSizeY_onTrackDisk_)->Fill((int)sizeY);
472  }
473  }
474  if(endcap && ringon){
475  (meCharge_onTrackRing_)->Fill((float)charge);
476  (meSize_onTrackRing_)->Fill((int)size);
477  if(!reducedSet){
478  (meSizeX_onTrackRing_)->Fill((int)sizeX);
479  (meSizeY_onTrackRing_)->Fill((int)sizeY);
480  }
481  }
482  }
483 
484  if(!onTrack){
485  if(modon){
486  (meCharge_offTrack_)->Fill((float)charge);
487  (meSize_offTrack_)->Fill((int)size);
488  if(!reducedSet){
489  (meSizeX_offTrack_)->Fill((int)sizeX);
490  (meSizeY_offTrack_)->Fill((int)sizeY);
491  }
492  }
493  if(barrel && ladon){
494  (meCharge_offTrackLad_)->Fill((float)charge);
495  (meSize_offTrackLad_)->Fill((int)size);
496  if(!reducedSet){
497  (meSizeX_offTrackLad_)->Fill((int)sizeX);
498  (meSizeY_offTrackLad_)->Fill((int)sizeY);
499  }
500  }
501  if(barrel && layon){
502  (meCharge_offTrackLay_)->Fill((float)charge);
503  (meSize_offTrackLay_)->Fill((int)size);
504  if(!reducedSet){
505  (meSizeX_offTrackLay_)->Fill((int)sizeX);
506  (meSizeY_offTrackLay_)->Fill((int)sizeY);
507  }
508  }
509  if(barrel && phion){
510  (meCharge_offTrackPhi_)->Fill((float)charge);
511  (meSize_offTrackPhi_)->Fill((int)size);
512  if(!reducedSet){
513  (meSizeX_offTrackPhi_)->Fill((int)sizeX);
514  (meSizeY_offTrackPhi_)->Fill((int)sizeY);
515  }
516  }
517  if(endcap && bladeon){
520  if(!reducedSet){
521  (meSizeX_offTrackBlade_)->Fill((int)sizeX);
522  (meSizeY_offTrackBlade_)->Fill((int)sizeY);
523  }
524  }
525  if(endcap && diskon){
527  (meSize_offTrackDisk_)->Fill((int)size);
528  if(!reducedSet){
529  (meSizeX_offTrackDisk_)->Fill((int)sizeX);
530  (meSizeY_offTrackDisk_)->Fill((int)sizeY);
531  }
532  }
533  if(endcap && ringon){
535  (meSize_offTrackRing_)->Fill((int)size);
536  if(!reducedSet){
537  (meSizeX_offTrackRing_)->Fill((int)sizeX);
538  (meSizeY_offTrackRing_)->Fill((int)sizeY);
539  }
540  }
541  }
542 
543 
544 
545 }
546 
547 void SiPixelTrackResidualModule::nfill(int onTrack, int offTrack, bool reducedSet, bool modon, bool ladon, bool layon, bool phion, bool bladeon, bool diskon, bool ringon){
548 
549  bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
550  bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
551  bool fillOn = false; if(onTrack>0) fillOn = true;
552  bool fillOff = false; if(offTrack>0) fillOff = true;
553 
554  if(modon){
555  if(fillOn) meNClusters_onTrack_->Fill(onTrack);
556  if(fillOff) meNClusters_offTrack_->Fill(offTrack);
557  }
558  if(ladon && barrel){
559  if(fillOn) meNClusters_onTrackLad_->Fill(onTrack);
560  if(fillOff) meNClusters_offTrackLad_->Fill(offTrack);
561  }
562 
563  if(layon && barrel){
564  if(fillOn) meNClusters_onTrackLay_->Fill(onTrack);
565  if(fillOff) meNClusters_offTrackLay_->Fill(offTrack);
566  }
567  if(phion && barrel){
568  if(fillOn) meNClusters_onTrackPhi_->Fill(onTrack);
569  if(fillOff) meNClusters_offTrackPhi_->Fill(offTrack);
570  }
571  if(bladeon && endcap){
572  if(fillOn) meNClusters_onTrackBlade_->Fill(onTrack);
573  if(fillOff) meNClusters_offTrackBlade_->Fill(offTrack);
574  }
575  if(diskon && endcap){
576  if(fillOn) meNClusters_onTrackDisk_->Fill(onTrack);
577  if(fillOff) meNClusters_offTrackDisk_->Fill(offTrack);
578  }
579  if(ringon && endcap){
580  if(fillOn) meNClusters_onTrackRing_->Fill(onTrack);
581  if(fillOff) meNClusters_offTrackRing_->Fill(offTrack);
582  }
583 }
int plaquetteName() const
plaquetteId (in pannel)
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
float charge() const
T y() const
Definition: PV2DBase.h:46
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
int moduleName() const
module id (index in z)
double charge(const std::vector< uint8_t > &Ampls)
void Fill(long long x)
int bladeName() const
blade id
void nfill(int onTrack, int offTrack, bool reducedSet, bool modon, bool ladon, bool layon, bool phion, bool bladeon, bool diskon, bool ringon)
bool isHalfModule() const
full or half module
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
void fill(const Measurement2DVector &, bool reducedSet=true, bool modon=true, bool ladon=true, bool layon=true, bool phion=true, bool bladeon=true, bool diskon=true, bool ringon=true)
std::string setHistoId(std::string variable, uint32_t &rawId)
Set Histogram Id.
Definition: DetId.h:20
int ladderName() const
ladder id (index in phi)
int layerName() const
layer id
std::string const & label() const
Definition: InputTag.h:42
int sizeY() const
Pixel cluster – collection of neighboring pixels above threshold.
void book(const edm::ParameterSet &, bool reducedSet=true, int type=0)
int pannelName() const
pannel id
int diskName() const
disk id
T x() const
Definition: PV2DBase.h:45
int sizeX() const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: vlib.h:209
tuple size
Write out results.
int size() const