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