Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SDeltaPtCutStudy.sys.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SDeltaPtCutStudy.sys.h
1 // ----------------------------------------------------------------------------
2 // 'SDeltaPtCutStudy.sys.h'
3 // Derek Anderson
4 // 07.06.2023
5 //
6 // Reads in the 'ntp_track' Ntuple
7 // generated by the SVtxEvaluator
8 // class and studies how deltapt/pt
9 // varies with quality cuts.
10 // ----------------------------------------------------------------------------
11 
12 #pragma once
13 
14 using namespace std;
15 
16 
17 
18 // system methods -------------------------------------------------------------
19 
21 
22  // initialize projection-related vectors
23  for (size_t iProj = 0; iProj < nProj; iProj++) {
24 
25  // initialize variables for sigma calculation
26  muProj.push_back(0.);
27  sigProj.push_back(0.);
28 
29  // initialize histograms, functions, and strings
30  hPtDeltaProj.push_back(NULL);
31  fPtDeltaProj.push_back(NULL);
32  sPtProj.push_back("");
33  } // end projection loop
34 
35  // initialize flat delta-pt cut-related vectors
36  for (size_t iCut = 0; iCut < nDPtCuts; iCut++) {
37 
38  // initialize variables for rejection calculation
39  nNormCut.push_back(0.);
40  nWeirdCut.push_back(0.);
41  rejCut.push_back(0.);
42 
43  // initialize histograms
44  hPtDeltaProj.push_back(NULL);
45  hPtDeltaCut.push_back(NULL);
46  hPtTrackCut.push_back(NULL);
47  hPtFracCut.push_back(NULL);
48  hPtTrkTruCut.push_back(NULL);
49  hEffCut.push_back(NULL);
50  hPtDeltaVsFracCut.push_back(NULL);
51  hPtDeltaVsTrueCut.push_back(NULL);
52  hPtDeltaVsTrackCut.push_back(NULL);
53  hPtTrueVsTrackCut.push_back(NULL);
54  }
55 
56  // initialize pt-dependent delta-pt cut-related vectors
57  for (size_t iSig = 0; iSig < nSigCuts; iSig++) {
58 
59  // initialize variables for rejection calculation
60  nNormSig.push_back(0.);
61  nWeirdSig.push_back(0.);
62  rejSig.push_back(0.);
63 
64  // initialize variables for sigma calculation
65  vector<double> vecHiProj(nProj, 0.);
66  vector<double> vecLoProj(nProj, 0.);
67  muHiProj.push_back(vecHiProj);
68  muLoProj.push_back(vecLoProj);
69 
70  // initialize histograms
71  hPtDeltaSig.push_back(NULL);
72  hPtTrackSig.push_back(NULL);
73  hPtFracSig.push_back(NULL);
74  hPtTrkTruSig.push_back(NULL);
75  hEffSig.push_back(NULL);
76  hPtDeltaVsFracSig.push_back(NULL);
77  hPtDeltaVsTrueSig.push_back(NULL);
78  hPtDeltaVsTrackSig.push_back(NULL);
79  hPtTrueVsTrackSig.push_back(NULL);
80 
81  // initialze functions and graphs
82  fPtDeltaProj.push_back(NULL);
83  fMuHiProj.push_back(NULL);
84  fMuLoProj.push_back(NULL);
85  grMuHiProj.push_back(NULL);
86  grMuLoProj.push_back(NULL);
87  }
88 
89  cout << " Initialized vectors." << endl;
90  return;
91 
92 } // end 'InitVectors()'
93 
94 
96 
97  // set track branch addresses
98  ntTrack -> SetBranchAddress("event", &trk_event);
99  ntTrack -> SetBranchAddress("seed", &trk_seed);
100  ntTrack -> SetBranchAddress("trackID", &trk_trackID);
101  ntTrack -> SetBranchAddress("crossing", &trk_crossing);
102  ntTrack -> SetBranchAddress("px", &trk_px);
103  ntTrack -> SetBranchAddress("py", &trk_py);
104  ntTrack -> SetBranchAddress("pz", &trk_pz);
105  ntTrack -> SetBranchAddress("pt", &trk_pt);
106  ntTrack -> SetBranchAddress("eta", &trk_eta);
107  ntTrack -> SetBranchAddress("phi", &trk_phi);
108  ntTrack -> SetBranchAddress("deltapt", &trk_deltapt);
109  ntTrack -> SetBranchAddress("deltaeta", &trk_deltaeta);
110  ntTrack -> SetBranchAddress("deltaphi", &trk_deltaphi);
111  ntTrack -> SetBranchAddress("charge", &trk_charge);
112  ntTrack -> SetBranchAddress("quality", &trk_quality);
113  ntTrack -> SetBranchAddress("chisq", &trk_chisq);
114  ntTrack -> SetBranchAddress("ndf", &trk_ndf);
115  ntTrack -> SetBranchAddress("nhits", &trk_nhits);
116  ntTrack -> SetBranchAddress("nmaps", &trk_nmaps);
117  ntTrack -> SetBranchAddress("nintt", &trk_nintt);
118  ntTrack -> SetBranchAddress("ntpc", &trk_ntpc);
119  ntTrack -> SetBranchAddress("nmms", &trk_nmms);
120  ntTrack -> SetBranchAddress("ntpc1", &trk_ntpc1);
121  ntTrack -> SetBranchAddress("ntpc11", &trk_ntpc11);
122  ntTrack -> SetBranchAddress("ntpc2", &trk_ntpc2);
123  ntTrack -> SetBranchAddress("ntpc3", &trk_ntpc3);
124  ntTrack -> SetBranchAddress("nlmaps", &trk_nlmaps);
125  ntTrack -> SetBranchAddress("nlintt", &trk_nlintt);
126  ntTrack -> SetBranchAddress("nltpc", &trk_nltpc);
127  ntTrack -> SetBranchAddress("nlmms", &trk_nlmms);
128  ntTrack -> SetBranchAddress("layers", &trk_layers);
129  ntTrack -> SetBranchAddress("vertexID", &trk_vertexID);
130  ntTrack -> SetBranchAddress("vx", &trk_vx);
131  ntTrack -> SetBranchAddress("vy", &trk_vy);
132  ntTrack -> SetBranchAddress("vz", &trk_vz);
133  ntTrack -> SetBranchAddress("dca2d", &trk_dca2d);
134  ntTrack -> SetBranchAddress("dca2dsigma", &trk_dca2dsigma);
135  ntTrack -> SetBranchAddress("dca3dxy", &trk_dca3dxy);
136  ntTrack -> SetBranchAddress("dca3dxysigma", &trk_dca3dxysigma);
137  ntTrack -> SetBranchAddress("dca3dz", &trk_dca3dz);
138  ntTrack -> SetBranchAddress("dca3dzsigma", &trk_dca3dzsigma);
139  ntTrack -> SetBranchAddress("pcax", &trk_pcax);
140  ntTrack -> SetBranchAddress("pcay", &trk_pcay);
141  ntTrack -> SetBranchAddress("pcaz", &trk_pcaz);
142  ntTrack -> SetBranchAddress("gtrackID", &trk_gtrackID);
143  ntTrack -> SetBranchAddress("gflavor", &trk_gflavor);
144  ntTrack -> SetBranchAddress("gnhits", &trk_gnhits);
145  ntTrack -> SetBranchAddress("gnmaps", &trk_gnmaps);
146  ntTrack -> SetBranchAddress("gnintt", &trk_gnintt);
147  ntTrack -> SetBranchAddress("gntpc", &trk_gntpc);
148  ntTrack -> SetBranchAddress("gnmms", &trk_gnmms);
149  ntTrack -> SetBranchAddress("gnlmaps", &trk_gnlmaps);
150  ntTrack -> SetBranchAddress("gnlintt", &trk_gnlintt);
151  ntTrack -> SetBranchAddress("gnltpc", &trk_gnltpc);
152  ntTrack -> SetBranchAddress("gnlmms", &trk_gnlmms);
153  ntTrack -> SetBranchAddress("gpx", &trk_gpx);
154  ntTrack -> SetBranchAddress("gpy", &trk_gpy);
155  ntTrack -> SetBranchAddress("gpz", &trk_gpz);
156  ntTrack -> SetBranchAddress("gpt", &trk_gpt);
157  ntTrack -> SetBranchAddress("geta", &trk_geta);
158  ntTrack -> SetBranchAddress("gphi", &trk_gphi);
159  ntTrack -> SetBranchAddress("gvx", &trk_gvx);
160  ntTrack -> SetBranchAddress("gvy", &trk_gvy);
161  ntTrack -> SetBranchAddress("gvz", &trk_gvz);
162  ntTrack -> SetBranchAddress("gvt", &trk_gvt);
163  ntTrack -> SetBranchAddress("gfpx", &trk_gfpx);
164  ntTrack -> SetBranchAddress("gfpy", &trk_gfpy);
165  ntTrack -> SetBranchAddress("gfpz", &trk_gfpz);
166  ntTrack -> SetBranchAddress("gfx", &trk_gfx);
167  ntTrack -> SetBranchAddress("gfy", &trk_gfy);
168  ntTrack -> SetBranchAddress("gfz", &trk_gfz);
169  ntTrack -> SetBranchAddress("gembed", &trk_gembed);
170  ntTrack -> SetBranchAddress("gprimary", &trk_gprimary);
171  ntTrack -> SetBranchAddress("nfromtruth", &trk_nfromtruth);
172  ntTrack -> SetBranchAddress("nwrong", &trk_nwrong);
173  ntTrack -> SetBranchAddress("ntrumaps", &trk_ntrumaps);
174  ntTrack -> SetBranchAddress("ntruintt", &trk_ntruintt);
175  ntTrack -> SetBranchAddress("ntrutpc", &trk_ntrutpc);
176  ntTrack -> SetBranchAddress("ntrumms", &trk_ntrumms);
177  ntTrack -> SetBranchAddress("ntrutpc1", &trk_ntrutpc1);
178  ntTrack -> SetBranchAddress("ntrutpc11", &trk_ntrutpc11);
179  ntTrack -> SetBranchAddress("ntrutpc2", &trk_ntrutpc2);
180  ntTrack -> SetBranchAddress("ntrutpc3", &trk_ntrutpc3);
181  ntTrack -> SetBranchAddress("layersfromtruth", &trk_layersfromtruth);
182  ntTrack -> SetBranchAddress("nhittpcall", &trk_nhittpcall);
183  ntTrack -> SetBranchAddress("nhittpcin", &trk_nhittpcin);
184  ntTrack -> SetBranchAddress("nhittpcmid", &trk_nhittpcmid);
185  ntTrack -> SetBranchAddress("nhittpcout", &trk_nhittpcout);
186  ntTrack -> SetBranchAddress("nclusall", &trk_nclusall);
187  ntTrack -> SetBranchAddress("nclustpc", &trk_nclustpc);
188  ntTrack -> SetBranchAddress("nclusintt", &trk_nclusintt);
189  ntTrack -> SetBranchAddress("nclusmaps", &trk_nclusmaps);
190  ntTrack -> SetBranchAddress("nclusmms", &trk_nclusmms);
191 
192  // Set branch addresses.
193  ntTruth -> SetBranchAddress("event", &tru_event);
194  ntTruth -> SetBranchAddress("seed", &tru_seed);
195  ntTruth -> SetBranchAddress("gntracks", &tru_gntracks);
196  ntTruth -> SetBranchAddress("gtrackID", &tru_gtrackID);
197  ntTruth -> SetBranchAddress("gflavor", &tru_gflavor);
198  ntTruth -> SetBranchAddress("gnhits", &tru_gnhits);
199  ntTruth -> SetBranchAddress("gnmaps", &tru_gnmaps);
200  ntTruth -> SetBranchAddress("gnintt", &tru_gnintt);
201  ntTruth -> SetBranchAddress("gnmms", &tru_gnmms);
202  ntTruth -> SetBranchAddress("gnintt1", &tru_gnintt1);
203  ntTruth -> SetBranchAddress("gnintt2", &tru_gnintt2);
204  ntTruth -> SetBranchAddress("gnintt3", &tru_gnintt3);
205  ntTruth -> SetBranchAddress("gnintt4", &tru_gnintt4);
206  ntTruth -> SetBranchAddress("gnintt5", &tru_gnintt5);
207  ntTruth -> SetBranchAddress("gnintt6", &tru_gnintt6);
208  ntTruth -> SetBranchAddress("gnintt7", &tru_gnintt7);
209  ntTruth -> SetBranchAddress("gnintt8", &tru_gnintt8);
210  ntTruth -> SetBranchAddress("gntpc", &tru_gntpc);
211  ntTruth -> SetBranchAddress("gnlmaps", &tru_gnlmaps);
212  ntTruth -> SetBranchAddress("gnlintt", &tru_gnlintt);
213  ntTruth -> SetBranchAddress("gnltpc", &tru_gnltpc);
214  ntTruth -> SetBranchAddress("gnlmms", &tru_gnlmms);
215  ntTruth -> SetBranchAddress("gpx", &tru_gpx);
216  ntTruth -> SetBranchAddress("gpy", &tru_gpy);
217  ntTruth -> SetBranchAddress("gpz", &tru_gpz);
218  ntTruth -> SetBranchAddress("gpt", &tru_gpt);
219  ntTruth -> SetBranchAddress("geta", &tru_geta);
220  ntTruth -> SetBranchAddress("gphi", &tru_gphi);
221  ntTruth -> SetBranchAddress("gvx", &tru_gvx);
222  ntTruth -> SetBranchAddress("gvy", &tru_gvy);
223  ntTruth -> SetBranchAddress("gvz", &tru_gvz);
224  ntTruth -> SetBranchAddress("gvt", &tru_gvt);
225  ntTruth -> SetBranchAddress("gfpx", &tru_gfpx);
226  ntTruth -> SetBranchAddress("gfpy", &tru_gfpy);
227  ntTruth -> SetBranchAddress("gfpz", &tru_gfpz);
228  ntTruth -> SetBranchAddress("gfx", &tru_gfx);
229  ntTruth -> SetBranchAddress("gfy", &tru_gfy);
230  ntTruth -> SetBranchAddress("gfz", &tru_gfz);
231  ntTruth -> SetBranchAddress("gembed", &tru_gembed);
232  ntTruth -> SetBranchAddress("gprimary", &tru_gprimary);
233  ntTruth -> SetBranchAddress("trackID", &tru_trackID);
234  ntTruth -> SetBranchAddress("px", &tru_px);
235  ntTruth -> SetBranchAddress("py", &tru_py);
236  ntTruth -> SetBranchAddress("pz", &tru_pz);
237  ntTruth -> SetBranchAddress("pt", &tru_pt);
238  ntTruth -> SetBranchAddress("eta", &tru_eta);
239  ntTruth -> SetBranchAddress("phi", &tru_phi);
240  ntTruth -> SetBranchAddress("deltapt", &tru_deltapt);
241  ntTruth -> SetBranchAddress("deltaeta", &tru_deltaeta);
242  ntTruth -> SetBranchAddress("deltaphi", &tru_deltaphi);
243  ntTruth -> SetBranchAddress("charge", &tru_charge);
244  ntTruth -> SetBranchAddress("quality", &tru_quality);
245  ntTruth -> SetBranchAddress("chisq", &tru_chisq);
246  ntTruth -> SetBranchAddress("ndf", &tru_ndf);
247  ntTruth -> SetBranchAddress("nhits", &tru_nhits);
248  ntTruth -> SetBranchAddress("layers", &tru_layers);
249  ntTruth -> SetBranchAddress("nmaps", &tru_nmaps);
250  ntTruth -> SetBranchAddress("nintt", &tru_nintt);
251  ntTruth -> SetBranchAddress("ntpc", &tru_ntpc);
252  ntTruth -> SetBranchAddress("nmms", &tru_nmms);
253  ntTruth -> SetBranchAddress("ntpc1", &tru_ntpc1);
254  ntTruth -> SetBranchAddress("ntpc11", &tru_ntpc11);
255  ntTruth -> SetBranchAddress("ntpc2", &tru_ntpc2);
256  ntTruth -> SetBranchAddress("ntpc3", &tru_ntpc3);
257  ntTruth -> SetBranchAddress("nlmaps", &tru_nlmaps);
258  ntTruth -> SetBranchAddress("nlintt", &tru_nlintt);
259  ntTruth -> SetBranchAddress("nltpc", &tru_nltpc);
260  ntTruth -> SetBranchAddress("nlmms", &tru_nlmms);
261  ntTruth -> SetBranchAddress("vertexID", &tru_vertexID);
262  ntTruth -> SetBranchAddress("vx", &tru_vx);
263  ntTruth -> SetBranchAddress("vy", &tru_vy);
264  ntTruth -> SetBranchAddress("vz", &tru_vz);
265  ntTruth -> SetBranchAddress("dca2d", &tru_dca2d);
266  ntTruth -> SetBranchAddress("dca2dsigma", &tru_dca2dsigma);
267  ntTruth -> SetBranchAddress("dca3dxy", &tru_dca3dxy);
268  ntTruth -> SetBranchAddress("dca3dxysigma", &tru_dca3dxysigma);
269  ntTruth -> SetBranchAddress("dca3dz", &tru_dca3dz);
270  ntTruth -> SetBranchAddress("dca3dzsigma", &tru_dca3dzsigma);
271  ntTruth -> SetBranchAddress("pcax", &tru_pcax);
272  ntTruth -> SetBranchAddress("pcay", &tru_pcay);
273  ntTruth -> SetBranchAddress("pcaz", &tru_pcaz);
274  ntTruth -> SetBranchAddress("nfromtruth", &tru_nfromtruth);
275  ntTruth -> SetBranchAddress("nwrong", &tru_nwrong);
276  ntTruth -> SetBranchAddress("ntrumaps", &tru_ntrumaps);
277  ntTruth -> SetBranchAddress("ntruintt", &tru_ntruintt);
278  ntTruth -> SetBranchAddress("ntrutpc", &tru_ntrutpc);
279  ntTruth -> SetBranchAddress("ntrumms", &tru_ntrumms);
280  ntTruth -> SetBranchAddress("ntrutpc1", &tru_ntrutpc1);
281  ntTruth -> SetBranchAddress("ntrutpc11", &tru_ntrutpc11);
282  ntTruth -> SetBranchAddress("ntrutpc2", &tru_ntrutpc2);
283  ntTruth -> SetBranchAddress("ntrutpc3", &tru_ntrutpc3);
284  ntTruth -> SetBranchAddress("layersfromtruth", &tru_layersfromtruth);
285  ntTruth -> SetBranchAddress("nhittpcall", &tru_nhittpcall);
286  ntTruth -> SetBranchAddress("nhittpcin", &tru_nhittpcin);
287  ntTruth -> SetBranchAddress("nhittpcmid", &tru_nhittpcmid);
288  ntTruth -> SetBranchAddress("nhittpcout", &tru_nhittpcout);
289  ntTruth -> SetBranchAddress("nclusall", &tru_nclusall);
290  ntTruth -> SetBranchAddress("nclustpc", &tru_nclustpc);
291  ntTruth -> SetBranchAddress("nclusintt", &tru_nclusintt);
292  ntTruth -> SetBranchAddress("nclusmaps", &tru_nclusmaps);
293  ntTruth -> SetBranchAddress("nclusmms", &tru_nclusmms);
294 
295  cout << " Initialized input tuples." << endl;
296  return;
297 
298 } // end 'InitTuples()'
299 
300 
301 
303 
304  // histogram binning
305  const uint64_t nPtBins(1000);
306  const uint64_t nFracBins(1000);
307  const uint64_t nDeltaBins(5000);
308  const float rPtBins[Const::NRange] = {0., 100.};
309  const float rFracBins[Const::NRange] = {0., 10.};
310  const float rDeltaBins[Const::NRange] = {0., 5.};
311 
312  // create names
313  TString sPtTruth("h");
314  TString sPtDelta("h");
315  TString sPtTrack("h");
316  TString sPtFrac("h");
317  TString sPtTrkTru("h");
318  sPtTruth.Append(sPtTrueBase.Data());
319  sPtDelta.Append(sPtDeltaBase.Data());
320  sPtTrack.Append(sPtRecoBase.Data());
321  sPtFrac.Append(sPtFracBase.Data());
322  sPtTrkTru.Append(sPtTrkTruBase.Data());
323 
324  TString sPtDeltaVsFrac("h");
325  TString sPtDeltaVsTrue("h");
326  TString sPtDeltaVsTrack("h");
327  TString sPtTrueVsTrack("h");
328  sPtDeltaVsFrac.Append(sPtDeltaBase.Data());
329  sPtDeltaVsTrue.Append(sPtDeltaBase.Data());
330  sPtDeltaVsTrack.Append(sPtDeltaBase.Data());
331  sPtTrueVsTrack.Append(sPtTrueBase.Data());
332  sPtDeltaVsFrac.Append("Vs");
333  sPtDeltaVsTrue.Append("Vs");
334  sPtDeltaVsTrack.Append("Vs");
335  sPtTrueVsTrack.Append("Vs");
336  sPtDeltaVsFrac.Append(sPtFracBase.Data());
337  sPtDeltaVsTrue.Append(sPtTrueBase.Data());
338  sPtDeltaVsTrack.Append(sPtRecoBase.Data());
339  sPtTrueVsTrack.Append(sPtRecoBase.Data());
340 
341  // delta-pt projection names
342  for (size_t iProj = 0; iProj < nProj; iProj++) {
343  sPtProj[iProj] = "h";
344  sPtProj[iProj].Append(sPtProjBase.Data());
345  sPtProj[iProj].Append(sProjSuffix[iProj].Data());
346  }
347 
348  // flat delta-pt cut names
349  vector<TString> sPtDeltaCut(nDPtCuts);
350  vector<TString> sPtTrackCut(nDPtCuts);
351  vector<TString> sPtFracCut(nDPtCuts);
352  vector<TString> sPtTrkTruCut(nDPtCuts);
353  vector<TString> sPtDeltaVsFracCut(nDPtCuts);
354  vector<TString> sPtDeltaVsTrueCut(nDPtCuts);
355  vector<TString> sPtDeltaVsTrackCut(nDPtCuts);
356  vector<TString> sPtTrueVsTrackCut(nDPtCuts);
357  for (size_t iCut = 0; iCut < nDPtCuts; iCut++) {
358  sPtDeltaCut[iCut] = "h";
359  sPtTrackCut[iCut] = "h";
360  sPtFracCut[iCut] = "h";
361  sPtTrkTruCut[iCut] = "h";
362  sPtDeltaCut[iCut].Append(sPtDeltaBase.Data());
363  sPtTrackCut[iCut].Append(sPtRecoBase.Data());
364  sPtFracCut[iCut].Append(sPtFracBase.Data());
365  sPtTrkTruCut[iCut].Append(sPtTrkTruBase.Data());
366  sPtDeltaCut[iCut].Append(sDPtSuffix[iCut].Data());
367  sPtTrackCut[iCut].Append(sDPtSuffix[iCut].Data());
368  sPtFracCut[iCut].Append(sDPtSuffix[iCut].Data());
369  sPtTrkTruCut[iCut].Append(sDPtSuffix[iCut].Data());
370 
371  sPtDeltaVsFracCut[iCut] = "h";
372  sPtDeltaVsTrueCut[iCut] = "h";
373  sPtDeltaVsTrackCut[iCut] = "h";
374  sPtTrueVsTrackCut[iCut] = "h";
375  sPtDeltaVsFracCut[iCut].Append(sPtDeltaBase.Data());
376  sPtDeltaVsFracCut[iCut].Append(sPtDeltaBase.Data());
377  sPtDeltaVsTrueCut[iCut].Append(sPtDeltaBase.Data());
378  sPtDeltaVsTrackCut[iCut].Append(sPtDeltaBase.Data());
379  sPtTrueVsTrackCut[iCut].Append(sPtTrueBase.Data());
380  sPtDeltaVsFracCut[iCut].Append("Vs");
381  sPtDeltaVsTrueCut[iCut].Append("Vs");
382  sPtDeltaVsTrackCut[iCut].Append("Vs");
383  sPtTrueVsTrackCut[iCut].Append("Vs");
384  sPtDeltaVsFracCut[iCut].Append(sPtFracBase.Data());
385  sPtDeltaVsTrueCut[iCut].Append(sPtTrueBase.Data());
386  sPtDeltaVsTrackCut[iCut].Append(sPtRecoBase.Data());
387  sPtTrueVsTrackCut[iCut].Append(sPtRecoBase.Data());
388  sPtDeltaVsFracCut[iCut].Append(sDPtSuffix[iCut].Data());
389  sPtDeltaVsTrueCut[iCut].Append(sDPtSuffix[iCut].Data());
390  sPtDeltaVsTrackCut[iCut].Append(sDPtSuffix[iCut].Data());
391  sPtTrueVsTrackCut[iCut].Append(sDPtSuffix[iCut].Data());
392  }
393 
394  // pt-dependent delta-pt cut names
395  vector<TString> sPtDeltaSig(nSigCuts);
396  vector<TString> sPtTrackSig(nSigCuts);
397  vector<TString> sPtFracSig(nSigCuts);
398  vector<TString> sPtTrkTruSig(nSigCuts);
399  vector<TString> sPtDeltaVsFracSig(nSigCuts);
400  vector<TString> sPtDeltaVsTrueSig(nSigCuts);
401  vector<TString> sPtDeltaVsTrackSig(nSigCuts);
402  vector<TString> sPtTrueVsTrackSig(nSigCuts);
403  for (size_t iSig = 0; iSig < nSigCuts; iSig++) {
404  sPtDeltaSig[iSig] = "h";
405  sPtTrackSig[iSig] = "h";
406  sPtFracSig[iSig] = "h";
407  sPtTrkTruSig[iSig] = "h";
408  sPtDeltaSig[iSig].Append(sPtDeltaBase.Data());
409  sPtTrackSig[iSig].Append(sPtRecoBase.Data());
410  sPtFracSig[iSig].Append(sPtFracBase.Data());
411  sPtTrkTruSig[iSig].Append(sPtTrkTruBase.Data());
412  sPtDeltaSig[iSig].Append(sSigSuffix[iSig].Data());
413  sPtTrackSig[iSig].Append(sSigSuffix[iSig].Data());
414  sPtFracSig[iSig].Append(sSigSuffix[iSig].Data());
415  sPtTrkTruSig[iSig].Append(sSigSuffix[iSig].Data());
416 
417  sPtDeltaVsFracSig[iSig] = "h";
418  sPtDeltaVsTrueSig[iSig] = "h";
419  sPtDeltaVsTrackSig[iSig] = "h";
420  sPtTrueVsTrackSig[iSig] = "h";
421  sPtDeltaVsFracSig[iSig].Append(sPtDeltaBase.Data());
422  sPtDeltaVsFracSig[iSig].Append(sPtDeltaBase.Data());
423  sPtDeltaVsTrueSig[iSig].Append(sPtDeltaBase.Data());
424  sPtDeltaVsTrackSig[iSig].Append(sPtDeltaBase.Data());
425  sPtTrueVsTrackSig[iSig].Append(sPtTrueBase.Data());
426  sPtDeltaVsFracSig[iSig].Append("Vs");
427  sPtDeltaVsTrueSig[iSig].Append("Vs");
428  sPtDeltaVsTrackSig[iSig].Append("Vs");
429  sPtTrueVsTrackSig[iSig].Append("Vs");
430  sPtDeltaVsFracSig[iSig].Append(sPtFracBase.Data());
431  sPtDeltaVsTrueSig[iSig].Append(sPtTrueBase.Data());
432  sPtDeltaVsTrackSig[iSig].Append(sPtRecoBase.Data());
433  sPtTrueVsTrackSig[iSig].Append(sPtRecoBase.Data());
434  sPtDeltaVsFracSig[iSig].Append(sSigSuffix[iSig].Data());
435  sPtDeltaVsTrueSig[iSig].Append(sSigSuffix[iSig].Data());
436  sPtDeltaVsTrackSig[iSig].Append(sSigSuffix[iSig].Data());
437  sPtTrueVsTrackSig[iSig].Append(sSigSuffix[iSig].Data());
438  }
439 
440  // initialize histograms
441  hPtTruth = new TH1D(sPtTruth.Data(), "", nPtBins, rPtBins[0], rPtBins[1]);
442  hPtDelta = new TH1D(sPtDelta.Data(), "", nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
443  hPtTrack = new TH1D(sPtTrack.Data(), "", nPtBins, rPtBins[0], rPtBins[1]);
444  hPtFrac = new TH1D(sPtFrac.Data(), "", nFracBins, rFracBins[0], rFracBins[1]);
445  hPtTrkTru = new TH1D(sPtTrkTru.Data(), "", nPtBins, rPtBins[0], rPtBins[1]);
446  hPtTruth -> Sumw2();
447  hPtDelta -> Sumw2();
448  hPtTrack -> Sumw2();
449  hPtFrac -> Sumw2();
450  hPtTrkTru -> Sumw2();
451 
452  hPtDeltaVsFrac = new TH2D(sPtDeltaVsFrac.Data(), "", nFracBins, rFracBins[0], rFracBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
453  hPtDeltaVsTrue = new TH2D(sPtDeltaVsTrue.Data(), "", nPtBins, rPtBins[0], rPtBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
454  hPtDeltaVsTrack = new TH2D(sPtDeltaVsTrack.Data(), "", nPtBins, rPtBins[0], rPtBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
455  hPtTrueVsTrack = new TH2D(sPtTrueVsTrack.Data(), "", nPtBins, rPtBins[0], rPtBins[1], nPtBins, rPtBins[0], rPtBins[1]);
456  hPtDeltaVsFrac -> Sumw2();
457  hPtDeltaVsTrue -> Sumw2();
458  hPtDeltaVsTrack -> Sumw2();
459  hPtTrueVsTrack -> Sumw2();
460 
461  // delta-pt projection histograms
462  for (size_t iProj = 0; iProj < nProj; iProj++) {
463  hPtDeltaProj[iProj] = new TH1D(sPtProj[iProj].Data(), "", nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
464  hPtDeltaProj[iProj] -> Sumw2();
465  }
466 
467  // flat delta-pt cut histograms
468  for (size_t iCut = 0; iCut < nDPtCuts; iCut++) {
469  hPtDeltaCut[iCut] = new TH1D(sPtDeltaCut[iCut].Data(), "", nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
470  hPtTrackCut[iCut] = new TH1D(sPtTrackCut[iCut].Data(), "", nPtBins, rPtBins[0], rPtBins[1]);
471  hPtFracCut[iCut] = new TH1D(sPtFracCut[iCut].Data(), "", nFracBins, rFracBins[0], rFracBins[1]);
472  hPtTrkTruCut[iCut] = new TH1D(sPtTrkTruCut[iCut].Data(), "", nPtBins, rPtBins[0], rPtBins[1]);
473  hPtDeltaCut[iCut] -> Sumw2();
474  hPtTrackCut[iCut] -> Sumw2();
475  hPtFracCut[iCut] -> Sumw2();
476  hPtTrkTruCut[iCut] -> Sumw2();
477 
478  hPtDeltaVsFracCut[iCut] = new TH2D(sPtDeltaVsFracCut[iCut].Data(), "", nFracBins, rFracBins[0], rFracBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
479  hPtDeltaVsTrueCut[iCut] = new TH2D(sPtDeltaVsTrueCut[iCut].Data(), "", nPtBins, rPtBins[0], rPtBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
480  hPtDeltaVsTrackCut[iCut] = new TH2D(sPtDeltaVsTrackCut[iCut].Data(), "", nPtBins, rPtBins[0], rPtBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
481  hPtTrueVsTrackCut[iCut] = new TH2D(sPtTrueVsTrackCut[iCut].Data(), "", nPtBins, rPtBins[0], rPtBins[1], nPtBins, rPtBins[0], rPtBins[1]);
482  hPtDeltaVsFracCut[iCut] -> Sumw2();
483  hPtDeltaVsTrueCut[iCut] -> Sumw2();
484  hPtDeltaVsTrackCut[iCut] -> Sumw2();
485  hPtTrueVsTrackCut[iCut] -> Sumw2();
486  }
487 
488  // pt-dependent delta-pt cut histograms
489  for (size_t iSig = 0; iSig < nSigCuts; iSig++) {
490  hPtDeltaSig[iSig] = new TH1D(sPtDeltaSig[iSig].Data(), "", nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
491  hPtTrackSig[iSig] = new TH1D(sPtTrackSig[iSig].Data(), "", nPtBins, rPtBins[0], rPtBins[1]);
492  hPtFracSig[iSig] = new TH1D(sPtFracSig[iSig].Data(), "", nFracBins, rFracBins[0], rFracBins[1]);
493  hPtTrkTruSig[iSig] = new TH1D(sPtTrkTruSig[iSig].Data(), "", nPtBins, rPtBins[0], rPtBins[1]);
494  hPtDeltaSig[iSig] -> Sumw2();
495  hPtTrackSig[iSig] -> Sumw2();
496  hPtFracSig[iSig] -> Sumw2();
497  hPtTrkTruSig[iSig] -> Sumw2();
498 
499  hPtDeltaVsFracSig[iSig] = new TH2D(sPtDeltaVsFracSig[iSig].Data(), "", nFracBins, rFracBins[0], rFracBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
500  hPtDeltaVsTrueSig[iSig] = new TH2D(sPtDeltaVsTrueSig[iSig].Data(), "", nPtBins, rPtBins[0], rPtBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
501  hPtDeltaVsTrackSig[iSig] = new TH2D(sPtDeltaVsTrackSig[iSig].Data(), "", nPtBins, rPtBins[0], rPtBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
502  hPtTrueVsTrackSig[iSig] = new TH2D(sPtTrueVsTrackSig[iSig].Data(), "", nPtBins, rPtBins[0], rPtBins[1], nPtBins, rPtBins[0], rPtBins[1]);
503  hPtDeltaVsFracSig[iSig] -> Sumw2();
504  hPtDeltaVsTrueSig[iSig] -> Sumw2();
505  hPtDeltaVsTrackSig[iSig] -> Sumw2();
506  hPtTrueVsTrackSig[iSig] -> Sumw2();
507  }
508 
509  cout << " Initialized output histograms." << endl;
510  return;
511 
512 } // end 'InitHists()'
513 
514 // end ------------------------------------------------------------------------