5 auto ff =
new TFile(
"simulation.root");
6 auto cbmsim =
dynamic_cast<TTree *
>(
ff->Get(
"cbmsim"));
7 cbmsim->AddFriend(
"cbmsim",
"reconstruction.root");
12 auto kfTrackArray =
new TClonesArray(
"PndTrack");
13 cbmsim->SetBranchAddress(
"EicIdealGenTrack", &kfTrackArray);
14 auto rcTrackArray =
new TClonesArray(
"PndPidCandidate");
15 cbmsim->SetBranchAddress(
"PidChargedCand", &rcTrackArray);
18 auto dp =
new TH1D(
"dp",
"dp", 100, -20., 20.);
19 auto dfi =
new TH1D(
"dfi",
"dfi", 100, -20., 20.);
20 auto dth =
new TH1D(
"dth",
"dth", 100, -20., 20.);
27 for(
unsigned ev=0; ev<
nEvents; ev++) {
30 for(
unsigned rc=0; rc<kfTrackArray->GetEntriesFast(); rc++) {
31 auto rctrack =
dynamic_cast<PndTrack *
>(kfTrackArray->At(rc));
36 int mcTrackId = rctrack->GetTrackCandPtr()->getMcTrackId();
39 if (mcTrackId < 0 || mcTrackId >=
mcTrackArray->GetEntriesFast())
continue;
45 if (mctrack->GetPdgCode() == 211 && mctrack->GetMotherID() == -1) {
48 printf(
"%7.3f %7.3f -> %7.3f\n", vtxpar.
GetMomentum().Theta(), mctrack->GetMomentum().Theta(),
49 1000*(vtxpar.
GetMomentum().Theta() - mctrack->GetMomentum().Theta()));
52 dp->Fill(100.*(vtxpar.
GetMomentum().Mag() - mctrack->GetMomentum().Mag())/mctrack->GetMomentum().Mag());
58 gStyle->SetOptStat(0);
60 dp->SetTitle(
"Momentum resolution");
62 dp->GetXaxis()->SetTitle(
"(P_{rec} - P_{sim})/P_{sim}, [%]");
63 dp->GetXaxis()->SetTitleOffset(0.9);
64 dp->GetXaxis()->SetLabelFont(52);
65 dp->GetXaxis()->SetLabelSize(0.040);
66 dp->GetXaxis()->SetTitleFont(52);
67 dp->GetXaxis()->SetTitleSize(0.050);
69 dp->GetYaxis()->SetTitle(
"Events");
70 dp->GetYaxis()->SetTitleOffset(0.7);
71 dp->GetYaxis()->SetLabelFont(52);
72 dp->GetYaxis()->SetLabelSize(0.040);
73 dp->GetYaxis()->SetTitleFont(52);
74 dp->GetYaxis()->SetTitleSize(0.050);