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