5 auto ff =
new TFile(
"simulation.root");
6 auto cbmsim =
dynamic_cast<TTree *
>(
ff->Get(
"cbmsim"));
7 cbmsim->AddFriend(
"cbmsim",
"reconstruction.root");
12 auto rcTrackArray =
new TClonesArray(
"PndPidCandidate");
13 cbmsim->SetBranchAddress(
"PidChargedCand", &rcTrackArray);
16 auto dp =
new TH1D(
"dp",
"dp", 100, -20., 20.);
23 for(
unsigned ev=0; ev<
nEvents; ev++) {
27 for(
unsigned rc=0; rc<rcTrackArray->GetEntriesFast(); rc++) {
32 if (mcTrackId < 0 || mcTrackId >=
mcTrackArray->GetEntriesFast())
continue;
38 if (mctrack->GetPdgCode() == 211 && mctrack->GetMotherID() == -1)
40 dp->Fill(100.*(rctrack->GetMomentum().Mag() - mctrack->GetMomentum().Mag())/mctrack->GetMomentum().Mag());
45 gStyle->SetOptStat(0);
47 dp->SetTitle(
"Momentum resolution");
49 dp->GetXaxis()->SetTitle(
"(P_{rec} - P_{sim})/P_{sim}, [%]");
50 dp->GetXaxis()->SetTitleOffset(0.9);
51 dp->GetXaxis()->SetLabelFont(52);
52 dp->GetXaxis()->SetLabelSize(0.040);
53 dp->GetXaxis()->SetTitleFont(52);
54 dp->GetXaxis()->SetTitleSize(0.050);
56 dp->GetYaxis()->SetTitle(
"Events");
57 dp->GetYaxis()->SetTitleOffset(0.7);
58 dp->GetYaxis()->SetLabelFont(52);
59 dp->GetYaxis()->SetLabelSize(0.040);
60 dp->GetYaxis()->SetTitleFont(52);
61 dp->GetYaxis()->SetTitleSize(0.050);