CMS 3D CMS Logo

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