5 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
8 TFile *
ff =
new TFile(
"simulation.root");
9 TTree *
cbmsim = ff->Get(
"cbmsim");
10 cbmsim->AddFriend(
"cbmsim",
"reconstruction.root");
13 TClonesArray *
mcTrackArray =
new TClonesArray(
"PndMCTrack");
14 cbmsim->SetBranchAddress(
"MCTrack", &mcTrackArray);
15 TClonesArray *rcTrackArray =
new TClonesArray(
"PndPidCandidate");
16 cbmsim->SetBranchAddress(
"PidChargedCand", &rcTrackArray);
20 TH1D *dp =
new TH1D(
"dp",
"dp", 200, -1., 1.);
25 int nEvents = cbmsim->GetEntries();
26 for(
unsigned ev=0; ev<
nEvents; ev++) {
30 for(
unsigned rc=0; rc<rcTrackArray->GetEntriesFast(); rc++) {
35 if (mcTrackId < 0 || mcTrackId >= mcTrackArray->GetEntriesFast())
continue;
38 PndMCTrack *mctrack = mcTrackArray->At(mcTrackId);
50 dp->SetTitle(
"Momentum resolution");
53 dp->GetXaxis()->SetTitle(
"Pt_{rec} - Pt_{sim}, [GeV/c]");
54 dp->GetXaxis()->SetTitleOffset(0.9);
55 dp->GetXaxis()->SetLabelFont(52);
56 dp->GetXaxis()->SetLabelSize(0.040);
57 dp->GetXaxis()->SetTitleFont(52);
58 dp->GetXaxis()->SetTitleSize(0.050);
60 dp->GetYaxis()->SetTitle(
"Events");
61 dp->GetYaxis()->SetTitleOffset(0.7);
62 dp->GetYaxis()->SetLabelFont(52);
63 dp->GetYaxis()->SetLabelSize(0.040);
64 dp->GetYaxis()->SetTitleFont(52);
65 dp->GetYaxis()->SetTitleSize(0.050);