2 void Summary(
const char *input_root_name =
"g4fwdtrack_fastsim_eval.root") {
4 TFile* in_file = TFile::Open(input_root_name,
"read");
6 TH2D* _h2d_Delta_mom_vs_truth_mom = (TH2D*) in_file->Get(
"_h2d_Delta_mom_vs_truth_mom");
7 TH2D* _h2d_Delta_mom_vs_truth_eta = (TH2D*) in_file->Get(
"_h2d_Delta_mom_vs_truth_eta");
10 TCanvas *c0 =
new TCanvas(
"c0",
"c0");
14 _h2d_Delta_mom_vs_truth_mom->FitSlicesY();
15 TH1D *h1d_mom_resolution_vs_truth_mom = (TH1D*) gDirectory->Get(
"_h2d_Delta_mom_vs_truth_mom_2");
17 h1d_mom_resolution_vs_truth_mom->SetTitle(
"#sigma_{p}/p; momentum [GeV/c]; #sigma_{p}/p");
18 h1d_mom_resolution_vs_truth_mom->SetMarkerStyle(20);
19 h1d_mom_resolution_vs_truth_mom->SetMarkerColor(kBlack);
20 h1d_mom_resolution_vs_truth_mom->SetLineColor(kBlack);
21 h1d_mom_resolution_vs_truth_mom->Draw(
"e");
22 h1d_mom_resolution_vs_truth_mom->GetYaxis()->SetTitleOffset(1.5);
24 TF1 *tf_pT_resolution =
new TF1(
"tf_pT_resolution",
25 "sqrt([0]*[0] + x*x*[1]*[1])", 0, 40);
26 h1d_mom_resolution_vs_truth_mom->Fit(tf_pT_resolution,
"s");
28 TH1D* h1d_mom_offset_vs_truth_mom = (TH1D*) gDirectory->Get(
"_h2d_Delta_mom_vs_truth_mom_1");
29 h1d_mom_offset_vs_truth_mom->Draw(
"e,same");
30 h1d_mom_offset_vs_truth_mom->SetMarkerStyle(20);
31 h1d_mom_offset_vs_truth_mom->SetMarkerColor(kGray);
32 h1d_mom_offset_vs_truth_mom->SetLineColor(kGray);
34 h1d_mom_offset_vs_truth_mom->Fit(
"pol0",
"s");
36 double y_max = h1d_mom_resolution_vs_truth_mom->GetMaximum();
37 double y_min = h1d_mom_offset_vs_truth_mom->GetMinimum();
39 h1d_mom_resolution_vs_truth_mom->GetYaxis()->SetRangeUser(y_min-0.01, y_max+0.01);
44 gStyle->SetOptStat(000000000);