4 #include "TTreeReader.h"
5 #include "TTreeReaderValue.h"
6 #include "TTreeReaderArray.h"
16 gStyle->SetOptStat(0);
19 unsigned int minhits = 20;
20 bool verbose1 =
false;
21 bool verbose2 =
false;
23 double maxtracks = 200;
25 TChain *theTree =
new TChain(
"tracktree");
27 theTree->Add(
"/sphenix/user/frawley/new_oct23/macros/detectors/sPHENIX/G4sPHENIX_g4svtx_eval.root_acts.root");
39 hitr[0] =
new TH1D(
"hitr0",
"track number",100,1,maxtracks+1);
40 hitr[1] =
new TH1D(
"hitr1",
"track number",100,1,maxtracks+1);
42 TH1D *hpt =
new TH1D(
"hpt",
"truth_pt",100,0,ptmax);
43 TH1D *hpt_fit_seed =
new TH1D(
"hpt_fit_seed",
"fit p_{T} - seed p_{T}",100,-10.0, 10.0);
44 TH1D *hpt_flt_over_truth =
new TH1D(
"hpt_flt_over_truth",
"flt p_{T} / truth pT",200,0, 2.0);
45 TH1D *hpt_actsfit_over_truth =
new TH1D(
"hpt_actsfit_over_truth",
"actsfit p_{T} / truth pT",200,0, 2.0);
46 TH2D *hpt_seed_truth =
new TH2D(
"hpt_seed_truth",
"seed/fit p_{T} vs truth p_{T}",100, 0, ptmax, 100, 0, ptmax);
47 TH2D *hpt_flt_truth =
new TH2D(
"hpt_flt_truth",
"flt p_{T}/truth p_{T} vs truth p_{T}",100,0, ptmax, 500, 0.5, 1.5);
48 TH2D *hpt_actsfit_truth =
new TH2D(
"hpt_actsfit_truth",
"acts fit p_{T}/truth p_{T} vs truth p_{T}",100,0, ptmax, 500, 0.5, 1.5);
50 TH2D *hxdiff_KF_truth_xlocal =
new TH2D(
"hxdiff_KF_truth_xlocal",
"local KF x projection vs truth x (last layer, mm)",100, 0, ptmax, 100,-2.0,2.0);
51 TH2D *hxdiff_KF_truth_ylocal =
new TH2D(
"hxdiff_KF_truth_ylocal",
"local KF y projection vs truth y (last layer, mm)",100, 0, ptmax, 100,-2.0,2.0);
52 TH2D *hxdiff_KF_truth_xglobal =
new TH2D(
"hxdiff_KF_truth_xglobal",
"global KF x projection vs truth x (last layer, mm)",100, 0, ptmax, 100,-2.0,2.0);
53 TH2D *hxdiff_KF_truth_yglobal =
new TH2D(
"hxdiff_KF_truth_yglobal",
"global KF y projection vs truth y (last layer, mm)",100, 0, ptmax, 100,-2.0,2.0);
54 TH2D *hxdiff_KF_truth_zglobal =
new TH2D(
"hxdiff_KF_truth_zglobal",
"global KF z projection vs truth z (last_layer, mm)",100, 0, ptmax, 100,-2.0,2.0);
56 TH1D *hxerr_KF =
new TH1D(
"hxerr_KF",
" err_eLOC0_flt", 100, -3, 3);
57 TH1D *hxpull_KF =
new TH1D(
"hxpull_KF",
" pull_eLOC0_flt outermost", 100, -5, 5);
58 TH1D *hypull_KF =
new TH1D(
"hypull_KF",
" pull_eLOC1_flt outermost", 100, -5, 5);
59 TH2D *hxpull_KF_radius =
new TH2D(
"hxpull_KF_radius",
" pull_eLOC0_flt vs radius", 860, 0, 860, 100, -5, 5);
60 TH2D *hzpull_KF_radius =
new TH2D(
"hzpull_KF_radius",
" pull_eLOC1_flt vs radius", 860, 0, 860, 100, -5, 5);
62 TH1D *hpt_smt =
new TH1D(
"hpt_smt",
"state/truth p_{T}",100,0, ptmax);
63 TH2D *htxy =
new TH2D(
"htxy",
"y vs x truth",4000,-860,860,4000,-860,860);
64 TH2D *hxy_flt =
new TH2D(
"hxy_flt",
"hxy_flt",4000,-860,860,4000,-860,860);
65 TH2D *hxy_smt =
new TH2D(
"hxy_smt",
"hxy_smt",4000,-860,860,4000,-860,860);
66 TH2D *hxy_prt =
new TH2D(
"hxy_prt",
"hxy_prt",4000,-860,860,4000,-860,860);
70 hdcaxy[0] =
new TH1D(
"hdcaxy0",
"DCA xy", 500, -2.0, 2);
71 hdcaxy[0]->GetXaxis()->SetTitle(
"DCA (mm)");
72 hdcaxy[1] =
new TH1D(
"hdcaxy1",
"DCA xy", 500, -2.0, 2);
73 hdcaz[0] =
new TH1D(
"hdcaz0",
"DCA z", 500, -2.0, 2.0);
74 hdcaz[1] =
new TH1D(
"hdcaz1",
"DCA z", 500, -2.0, 2.0);
81 hprotox[0] =
new TH1D(
"hprotox0",
"proto x - vertex x", 100, -range, range);
82 hprotox[1] =
new TH1D(
"hprotox1",
"proto x - vertex x", 100, -range, range);
83 hprotoy[0] =
new TH1D(
"hprotoy0",
"proto y - vertex y", 100, -range, range);
84 hprotoy[1] =
new TH1D(
"hprotoy1",
"proto y - vertex y", 100, -range, range);
85 hprotoz[0] =
new TH1D(
"hprotoz0",
"proto z - vertex z", 100, -range, range);
86 hprotoz[1] =
new TH1D(
"hprotoz1",
"proto z - vertex z", 100, -range, range);
89 hhit[0] =
new TH1D(
"hhitx_global",
"global x hit - truth hit (last layer, mm)", 200, -0.5,0.5);
90 hhit[1] =
new TH1D(
"hhity_global",
"global y hit - truth (last layer, mm)", 200, -0.5,0.5);
91 hhit[2] =
new TH1D(
"hhitz_global",
"global z hit - truth (last layer, mm)", 200, -3,3);
92 hhit[3] =
new TH1D(
"hhitx_local",
"local x hit - truth (last layer, mm)", 200, -0.6,0.6);
93 hhit[4] =
new TH1D(
"hhity_local",
"local y hit - truth (last_layer, mm)", 200, -3,3);
99 TTreeReader theReader(theTree);
101 TTreeReaderValue<int>
event(theReader,
"event_nr");
104 TTreeReaderArray<float> t_x(theReader,
"t_x");
105 TTreeReaderArray<float> t_y(theReader,
"t_y");
106 TTreeReaderArray<float> t_z(theReader,
"t_z");
107 TTreeReaderValue<float> t_pT(theReader,
"t_pT");
108 TTreeReaderValue<float> t_vx(theReader,
"t_vx");
109 TTreeReaderValue<float> t_vy(theReader,
"t_vy");
110 TTreeReaderValue<float> t_vz(theReader,
"t_vz");
111 TTreeReaderValue<unsigned long long> t_barcode(theReader,
"t_barcode");
112 TTreeReaderArray<float> t_eLOC0(theReader,
"t_eLOC0");
113 TTreeReaderArray<float> t_eLOC1(theReader,
"t_eLOC1");
117 TTreeReaderValue<float> x_proto(theReader,
"g_protoTrackX");
118 TTreeReaderValue<float> y_proto(theReader,
"g_protoTrackY");
119 TTreeReaderValue<float> z_proto(theReader,
"g_protoTrackZ");
120 TTreeReaderValue<float> px_proto(theReader,
"g_protoTrackPx");
121 TTreeReaderValue<float> py_proto(theReader,
"g_protoTrackPy");
122 TTreeReaderValue<float> pz_proto(theReader,
"g_protoTrackPz");
125 TTreeReaderArray<float> pT_prt(theReader,
"pT_prt");
126 TTreeReaderArray<float> g_x_prt(theReader,
"g_x_prt");
127 TTreeReaderArray<float> g_y_prt(theReader,
"g_y_prt");
128 TTreeReaderArray<float> g_z_prt(theReader,
"g_z_prt");
129 TTreeReaderArray<float> eLOC0_prt(theReader,
"eLOC0_prt");
130 TTreeReaderArray<float> eLOC1_prt(theReader,
"eLOC1_prt");
131 TTreeReaderArray<float> pull_eLOC0_prt(theReader,
"pull_eLOC0_prt");
132 TTreeReaderArray<float> pull_eLOC1_prt(theReader,
"pull_eLOC1_prt");
133 TTreeReaderArray<float> err_eLOC0_prt(theReader,
"err_eLOC0_prt");
134 TTreeReaderArray<float> err_eLOC1_prt(theReader,
"err_eLOC1_prt");
135 TTreeReaderArray<float> res_eLOC0_prt(theReader,
"res_eLOC0_prt");
136 TTreeReaderArray<float> res_eLOC1_prt(theReader,
"res_eLOC1_prt");
137 TTreeReaderArray<float> px_prt(theReader,
"px_prt");
138 TTreeReaderArray<float> py_prt(theReader,
"py_prt");
139 TTreeReaderArray<float> pz_prt(theReader,
"pz_prt");
142 TTreeReaderArray<float> g_x_flt(theReader,
"g_x_flt");
143 TTreeReaderArray<float> g_y_flt(theReader,
"g_y_flt");
144 TTreeReaderArray<float> g_z_flt(theReader,
"g_z_flt");
145 TTreeReaderArray<float> eLOC0_flt(theReader,
"eLOC0_flt");
146 TTreeReaderArray<float> eLOC1_flt(theReader,
"eLOC1_flt");
147 TTreeReaderArray<float> pull_eLOC0_flt(theReader,
"pull_eLOC0_flt");
148 TTreeReaderArray<float> pull_eLOC1_flt(theReader,
"pull_eLOC1_flt");
149 TTreeReaderArray<float> err_eLOC0_flt(theReader,
"err_eLOC0_flt");
150 TTreeReaderArray<float> err_eLOC1_flt(theReader,
"err_eLOC1_flt");
151 TTreeReaderArray<float> res_eLOC0_flt(theReader,
"res_eLOC0_flt");
152 TTreeReaderArray<float> res_eLOC1_flt(theReader,
"res_eLOC1_flt");
153 TTreeReaderArray<float> pT_flt(theReader,
"pT_flt");
154 TTreeReaderArray<float> px_flt(theReader,
"px_flt");
155 TTreeReaderArray<float> py_flt(theReader,
"py_flt");
156 TTreeReaderArray<float> pz_flt(theReader,
"pz_flt");
159 TTreeReaderArray<float> g_x_smt(theReader,
"g_x_smt");
160 TTreeReaderArray<float> g_y_smt(theReader,
"g_y_smt");
161 TTreeReaderArray<float> g_z_smt(theReader,
"g_z_smt");
162 TTreeReaderArray<float> eLOC0_smt(theReader,
"eLOC0_smt");
163 TTreeReaderArray<float> eLOC1_smt(theReader,
"eLOC1_smt");
164 TTreeReaderArray<float> pull_eLOC0_smt(theReader,
"pull_eLOC0_smt");
165 TTreeReaderArray<float> pull_eLOC1_smt(theReader,
"pull_eLOC1_smt");
166 TTreeReaderArray<float> err_eLOC0_smt(theReader,
"err_eLOC0_smt");
167 TTreeReaderArray<float> err_eLOC1_smt(theReader,
"err_eLOC1_smt");
168 TTreeReaderArray<float> res_eLOC0_smt(theReader,
"res_eLOC0_smt");
169 TTreeReaderArray<float> res_eLOC1_smt(theReader,
"res_eLOC1_smt");
170 TTreeReaderArray<float> pT_smt(theReader,
"pT_smt");
171 TTreeReaderArray<float> px_smt(theReader,
"px_smt");
172 TTreeReaderArray<float> py_smt(theReader,
"py_smt");
173 TTreeReaderArray<float> pz_smt(theReader,
"pz_smt");
176 TTreeReaderValue<float> dcaxy_fit(theReader,
"g_dca3Dxy_fit");
177 TTreeReaderValue<float> dcaz_fit(theReader,
"g_dca3Dz_fit");
178 TTreeReaderValue<float> x_fit(theReader,
"g_x_fit");
179 TTreeReaderValue<float> y_fit(theReader,
"g_y_fit");
180 TTreeReaderValue<float> z_fit(theReader,
"g_z_fit");
181 TTreeReaderValue<float> px_fit(theReader,
"g_px_fit");
182 TTreeReaderValue<float> py_fit(theReader,
"g_py_fit");
183 TTreeReaderValue<float> pz_fit(theReader,
"g_pz_fit");
187 TTreeReaderArray<float> g_x_hit(theReader,
"g_x_hit");
188 TTreeReaderArray<float> g_y_hit(theReader,
"g_y_hit");
189 TTreeReaderArray<float> g_z_hit(theReader,
"g_z_hit");
190 TTreeReaderArray<float> l_x_hit(theReader,
"l_x_hit");
191 TTreeReaderArray<float> l_y_hit(theReader,
"l_y_hit");
192 TTreeReaderArray<float> err_x_hit(theReader,
"err_x_hit");
193 TTreeReaderArray<float> err_y_hit(theReader,
"err_y_hit");
194 TTreeReaderArray<float> res_x_hit(theReader,
"res_x_hit");
195 TTreeReaderArray<float> res_y_hit(theReader,
"res_y_hit");
196 TTreeReaderArray<float> pull_x_hit(theReader,
"pull_x_hit");
197 TTreeReaderArray<float> pull_y_hit(theReader,
"pull_y_hit");
200 while(theReader.Next()){
204 if(pT_flt.GetSize() < 1)
206 cout <<
" pT_smt not found " << endl;
210 if(pT_flt.GetSize() < minhits)
continue;
212 double inner_radius = sqrt(pow(t_x[pT_smt.GetSize()-1], 2) + pow(t_y[pT_smt.GetSize()-1], 2));
215 if(pT_smt.GetSize() != pT_flt.GetSize())
216 cout <<
" *********** smt size " << pT_smt.GetSize() <<
" flt size " << pT_flt.GetSize() << endl;
225 float pT_fit =sqrt(pow(*px_fit,2) + pow(*py_fit,2));
226 float pT_proto =sqrt(pow(*px_proto,2) + pow(*py_proto,2));
229 double xdiff_global_last = g_x_flt[0] - t_x[0];
230 double ydiff_global_last = g_y_flt[0] - t_y[0];
231 double zdiff_global_last = g_z_flt[0] - t_z[0];
232 double xdiff_local_last = eLOC0_flt[0] - t_eLOC0[0];
233 double ydiff_local_last = eLOC1_flt[0] - t_eLOC1[0];
238 cout <<
" new track: " << itr <<
" truth Z vertex " << *t_vz <<
" inner radius " << inner_radius <<
" nhits " << pT_flt.GetSize() << endl;
240 cout <<
" track " << itr <<
" truth barcode " << *t_barcode<<
" Truth pT " << *t_pT <<
" seed pT " << pT_prt[pT_flt.GetSize() - 1] <<
" fit pT " << pT_fit <<
" inner radius " << inner_radius <<
" nhits " << pT_smt.GetSize();
241 if(pT_fit / *t_pT < 0.8 || pT_fit/ *t_pT > 1.2)
242 cout <<
" ---- bad pT " << endl;
244 cout <<
" ---- good pT " << endl;
246 cout <<
" px_proto " << *px_proto <<
" py_proto " << *py_proto <<
" pz_proto " << *pz_proto <<
" pT_proto " << pT_proto << endl;
252 cout <<
" px_fit " << *px_fit <<
" py_fit " << *py_fit <<
" pz_fit " << *pz_fit <<
" pT_fit " << pT_fit << endl;
253 cout <<
" x_proto " << *x_proto <<
" y_proto " << *y_proto <<
" z_proto " << *z_proto << endl;
254 cout <<
" x_fit " << *x_fit <<
" y_fit " << *y_fit <<
" z_fit " << *z_fit << endl;
257 double pT_truth = *t_pT;
258 double pT_fitted = pT_flt[0];
259 double pT_actsfit = pT_fit;
260 double pT_seed = pT_prt[pT_prt.GetSize() - 1];
262 hpt_seed_truth->Fill(pT_truth, pT_fitted);
263 hpt_flt_truth->Fill(pT_truth, pT_fitted / pT_truth);
264 hpt_actsfit_truth->Fill(pT_truth, pT_actsfit / pT_truth);
265 hpt_fit_seed->Fill(pT_fitted - pT_seed);
266 hpt_flt_over_truth->Fill(pT_fitted / pT_truth);
267 hpt_actsfit_over_truth->Fill(pT_actsfit / pT_truth);
268 hxdiff_KF_truth_xlocal->Fill(pT_truth, xdiff_local_last);
269 hxdiff_KF_truth_ylocal->Fill(pT_truth, ydiff_local_last);
270 hxdiff_KF_truth_xglobal->Fill(pT_truth, xdiff_global_last);
271 hxdiff_KF_truth_yglobal->Fill(pT_truth, ydiff_global_last);
272 hxdiff_KF_truth_zglobal->Fill(pT_truth, zdiff_global_last);
273 hhit[0]->Fill(g_x_hit[0] - t_x[0]);
274 hhit[1]->Fill(g_y_hit[0] - t_y[0]);
275 hhit[2]->Fill(g_z_hit[0] - t_z[0]);
276 hhit[3]->Fill(l_x_hit[0] - t_eLOC0[0]);
277 hhit[4]->Fill(l_y_hit[0] - t_eLOC1[0]);
279 hxerr_KF->Fill( err_eLOC0_flt[0]);
280 hxpull_KF->Fill( pull_eLOC0_flt[0]);
281 hypull_KF->Fill( pull_eLOC1_flt[0]);
282 if(inner_radius < 80)
284 hitr[0]->Fill(*t_barcode);
285 hdcaxy[0]->Fill(*dcaxy_fit);
287 hdcaz[0]->Fill(*dcaz_fit);
289 hprotox[0]->Fill(*x_proto - *t_vx);
290 hprotoy[0]->Fill(*y_proto - *t_vy);
291 hprotoz[0]->Fill(*z_proto - *t_vz);
295 hitr[1]->Fill(*t_barcode);
296 hdcaxy[1]->Fill(*dcaxy_fit);
298 hdcaz[1]->Fill(*dcaz_fit);
300 hprotox[1]->Fill(*x_proto - *t_vx);
301 hprotoy[1]->Fill(*y_proto - *t_vy);
302 hprotoz[1]->Fill(*z_proto - *t_vz);
306 for(
unsigned int i = 0;
i < pT_smt.GetSize(); ++
i)
308 htxy->Fill(t_x[
i], t_y[i]);
309 hxy_flt->Fill(g_x_flt[i], g_y_flt[i]);
310 hxy_smt->Fill(g_x_smt[i], g_y_smt[i]);
311 hxy_prt->Fill(g_x_prt[i], g_y_prt[i]);
313 hpt_smt->Fill(pT_smt[i]);
316 double radius = sqrt(pow(t_x[i], 2) + pow(t_y[i], 2));
317 hxpull_KF_radius->Fill(radius, pull_eLOC0_flt[i]);
318 hzpull_KF_radius->Fill( radius, pull_eLOC1_flt[i]);
323 cout <<
" hit " << i <<
" rad " << radius
324 <<
" flt rphi pull " << pull_eLOC0_flt[
i]
325 <<
" smt rphi pull " << pull_eLOC0_smt[
i]
327 cout <<
" pT_truth " << pT_truth <<
" pT_prt " << pT_prt[
i] <<
" pT_flt " << pT_flt[
i] <<
" pT_smt " << pT_smt[
i] << endl;
330 cout <<
" truth global hit : " <<
"t_x " << t_x[
i] <<
" t_y " << t_y[
i] <<
" t_z " << t_z[
i] << endl;
331 cout <<
" Global hit: g_x_hit " << g_x_hit[
i] <<
" g_y_hit " << g_y_hit[
i] <<
" g_z_hit " << g_z_hit[
i]
332 <<
" dx " << g_x_hit[
i] - t_x[
i]
333 <<
" dy " << g_y_hit[
i] - t_y[
i]
334 <<
" dz " << g_z_hit[
i] - t_z[
i]
348 cout <<
" Global smoothed: g_x_smt " << g_x_smt[
i] <<
" g_y_smt " << g_y_smt[
i] <<
" g_z_smt " << g_z_smt[
i]
349 <<
" dx " << g_x_smt[
i] - t_x[
i]
350 <<
" dy " << g_y_smt[
i] - t_y[
i]
351 <<
" dy " << g_z_smt[
i] - t_z[
i]
386 cout <<
" track " << itr
387 <<
" truth pT = " << *t_pT
390 cout <<
" dcaxy_fit " << *dcaxy_fit <<
" dcaz_fit " << *dcaz_fit << endl;
399 TCanvas *
c =
new TCanvas(
"c",
"c",5,5,800,800);
401 TH2D *hvxy =
new TH2D(
"hvxy",
"y vs x track vertex",4000,-860,860,4000,-860,860);
402 hvxy->Fill(*t_vx, *t_vy);
427 hvxy->SetMarkerStyle(20);
428 hvxy->SetMarkerSize(1.0);
429 hvxy->SetMarkerColor(kCyan);
432 htxy->SetMarkerStyle(20);
433 htxy->SetMarkerSize(0.5);
435 hxy_prt->SetMarkerColor(kRed);
436 hxy_prt->SetMarkerStyle(20);
437 hxy_prt->SetMarkerSize(0.5);
438 hxy_prt->Draw(
"same");
439 hxy_flt->SetMarkerColor(kGreen+2);
440 hxy_flt->SetMarkerStyle(20);
441 hxy_flt->SetMarkerSize(0.5);
442 hxy_flt->Draw(
"same");
443 hxy_smt->SetMarkerColor(kBlue);
444 hxy_smt->SetMarkerStyle(20);
445 hxy_smt->SetMarkerSize(0.5);
449 TCanvas *ctruth =
new TCanvas(
"ctruth",
"ctruth",5,5,1500,800);
453 gPad->SetLeftMargin(0.12);
454 hpt_seed_truth->GetXaxis()->SetTitle(
"Truth p_{T}");
455 hpt_seed_truth->GetYaxis()->SetTitle(
"Seed or fit p_{T}");
456 hpt_seed_truth->SetMarkerStyle(20);
457 hpt_seed_truth->SetMarkerSize(0.4);
458 hpt_seed_truth->GetYaxis()->SetTitleSize(0.05);
459 hpt_seed_truth->GetXaxis()->SetTitleSize(0.05);
460 hpt_seed_truth->GetYaxis()->SetLabelSize(0.05);
461 hpt_seed_truth->GetXaxis()->SetLabelSize(0.05);
462 hpt_seed_truth->GetXaxis()->SetNdivisions(505);
465 TLegend *trleg =
new TLegend(0.2, 0.75, 0.55, 0.85,
"",
"NDC");
466 trleg->AddEntry(hpt_actsfit_truth,
"seed",
"p");
467 trleg->AddEntry(hpt_flt_truth,
"fit ",
"p");
468 trleg->SetTextSize(0.05);
471 cout <<
"get truth plots" << endl;
473 hpt_flt_truth->SetMarkerStyle(20);
474 hpt_flt_truth->SetMarkerSize(0.4);
475 hpt_flt_truth->SetMarkerColor(kRed);
476 hpt_flt_truth->Draw(
"colz");
479 gPad->SetLeftMargin(0.12);
480 hpt_actsfit_over_truth->GetXaxis()->SetTitle(
"actsfit p_{T} / truth p_{T}");
481 hpt_actsfit_over_truth->SetTitleSize(0.05);
482 hpt_actsfit_over_truth->GetYaxis()->SetLabelSize(0.05);
483 hpt_actsfit_over_truth->GetXaxis()->SetLabelSize(0.05);
484 hpt_actsfit_over_truth->GetXaxis()->SetNdivisions(505);
485 hpt_actsfit_over_truth->Draw();
487 TLegend *tkleg =
new TLegend(0.15, 0.79, 0.48, 0.85,
"",
"NDC");
488 tkleg->AddEntry(hpt_actsfit_over_truth,
"actsfit/truth",
"l");
489 tkleg->SetTextSize(0.05);
493 gPad->SetLeftMargin(0.12);
494 hpt_flt_over_truth->SetMarkerStyle(20);
495 hpt_flt_over_truth->SetMarkerSize(0.2);
496 hpt_flt_over_truth->SetLineColor(kRed);
497 hpt_flt_over_truth->GetXaxis()->SetTitle(
"flt p_{T} / truth p_{T}");
498 hpt_flt_over_truth->GetYaxis()->SetTitleSize(0.05);
499 hpt_flt_over_truth->GetXaxis()->SetTitleSize(0.05);
500 hpt_flt_over_truth->GetYaxis()->SetLabelSize(0.05);
501 hpt_flt_over_truth->GetXaxis()->SetLabelSize(0.05);
502 hpt_flt_over_truth->GetXaxis()->SetNdivisions(505);
503 hpt_flt_over_truth->Draw();
505 int binlo = hpt_flt_over_truth->GetXaxis()->FindBin(0.8);
506 int binhi = hpt_flt_over_truth->GetXaxis()->FindBin(1.2);
507 cout <<
" binlo " << binlo <<
" binhi " << binhi << endl;
508 cout <<
" hpt_flt_over_truth integral 0.8 to 1.2 " << hpt_flt_over_truth->Integral(binlo, binhi) << endl;;
509 cout <<
" hpt_flt_over_truth integral 0 to 0.8 " << hpt_flt_over_truth->Integral(1, binlo) << endl;;
510 cout <<
" hpt_actsfit_over_truth integral 0.8 to 1.2 " << hpt_actsfit_over_truth->Integral(binlo, binhi) << endl;;
513 TLegend *tfleg =
new TLegend(0.15, 0.79, 0.48, 0.85,
"",
"NDC");
514 tfleg->AddEntry(hpt_flt_over_truth,
"flt/truth p_{T}",
"l");
515 tfleg->SetTextSize(0.05);
518 cout <<
"get pT res plots" << endl;
520 hpt_flt_truth->FitSlicesY();
521 TH1D*hptres = (TH1D*)gDirectory->Get(
"hpt_flt_truth_2");
522 hptres->GetYaxis()->SetRangeUser(0.0, 0.15);
523 TH1D*hptcent = (TH1D*)gDirectory->Get(
"hpt_flt_truth_1");
524 hptcent->GetYaxis()->SetRangeUser(0.8, 1.2);
526 cout <<
"plot pT res plots" << endl;
528 TCanvas *cptres =
new TCanvas(
"cptres",
"cptres", 8,8,1200,800);
531 cout <<
"plot res plot" << endl;
534 cout <<
"plot cent plot" << endl;
537 TCanvas *cdiff =
new TCanvas(
"cdiff",
"cdiff",5,5,1600,800);
542 hxdiff[0] = hxdiff_KF_truth_xglobal->ProjectionY();
543 hxdiff[0]->SetTitle(
"global KF filt x - truth x");
544 hxdiff[0]->GetXaxis()->SetTitle(
"global KF filt x - truth x (mm)");
546 hxdiff[1] = hxdiff_KF_truth_yglobal->ProjectionY();
547 hxdiff[1]->SetTitle(
"global KF filt y - truth y");
548 hxdiff[1]->GetXaxis()->SetTitle(
"global KF filt y - truth y (mm)");
550 hxdiff[2] = hxdiff_KF_truth_zglobal->ProjectionY();
551 hxdiff[2]->SetTitle(
"global KF filt z - truth z");
552 hxdiff[2]->GetXaxis()->SetTitle(
"global KF filt z - truth z (mm)");
554 hxdiff[3] = hxdiff_KF_truth_xlocal->ProjectionY();
555 hxdiff[3]->SetTitle(
"local KF filt x - truth x");
556 hxdiff[3]->GetXaxis()->SetTitle(
"local KF filt x - truth x (mm)");
558 hxdiff[4] = hxdiff_KF_truth_ylocal->ProjectionY();
559 hxdiff[4]->SetTitle(
"local KF filt y - truth y");
560 hxdiff[4]->GetXaxis()->SetTitle(
"local KF filt y - truth y (mm)");
567 hxdiff[
i]->SetTitleSize(0.05);
568 hxdiff[
i]->GetYaxis()->SetTitleSize(0.05);
569 hxdiff[
i]->GetXaxis()->SetTitleSize(0.05);
570 hxdiff[
i]->GetYaxis()->SetLabelSize(0.05);
571 hxdiff[
i]->GetXaxis()->SetLabelSize(0.05);
572 hxdiff[
i]->GetXaxis()->SetNdivisions(505);
573 hxdiff[
i]->DrawCopy();
574 cout <<
" hxdiff " <<
i <<
" RMS = " << hxdiff[
i]->GetRMS() << endl;
578 TLegend *txleg =
new TLegend(0.15, 0.75, 0.85, 0.85,
"",
"NDC");
579 txleg->AddEntry(hxdiff[0],
"KF - truth outer",
"l");
581 txleg->SetTextSize(0.05);
584 TCanvas *chit =
new TCanvas(
"chit",
"chit",5,5,1600,800);
594 TCanvas *cpull =
new TCanvas(
"cpull",
"local X/Y Pull",5,5,1600,800);
602 TCanvas *cdca =
new TCanvas(
"cdca",
"DCA",5,5,1200,800);
605 TLegend *dcaleg =
new TLegend(0.15, 0.75, 0.45, 0.85,
"",
"NDC");
606 dcaleg->AddEntry(hdcaxy[0],
"MVTX match",
"l");
607 dcaleg->AddEntry(hdcaxy[1],
"no MVTX match",
"l");
608 dcaleg->SetTextSize(0.03);
612 hdcaxy[1]->SetLineColor(kRed);
613 hdcaxy[1]->Draw(
"same");
617 hdcaz[1]->SetLineColor(kRed);
618 hdcaz[1]->Draw(
"same");
621 TCanvas *cproto =
new TCanvas(
"cproto",
"proto pos - truth pos",5,5,1200,800);
624 hprotox[0]->GetXaxis()->SetTitle(
"mm");
626 hprotox[1]->SetLineColor(kRed);
627 hprotox[1]->Draw(
"same");
631 hprotoy[0]->GetXaxis()->SetTitle(
"mm");
633 hprotoy[1]->SetLineColor(kRed);
634 hprotoy[1]->Draw(
"same");
638 hprotoz[0]->GetXaxis()->SetTitle(
"mm");
640 hprotoz[1]->SetLineColor(kRed);
641 hprotoz[1]->Draw(
"same");
644 TCanvas *citr =
new TCanvas(
"citr",
"track number",5,5,1200,800);
645 hitr[1]->SetMinimum(0);
647 hitr[0]->SetLineColor(kRed);
648 hitr[0]->Draw(
"same");