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);
19 TH1D *dp =
new TH1D(
"dp",
"dp", 100, -5., 5.);
24 int nEvents = cbmsim->GetEntries();
25 for(
unsigned ev=0; ev<
nEvents; ev++) {
29 for(
unsigned rc=0; rc<rcTrackArray->GetEntriesFast(); rc++) {
33 for(
unsigned iq=0; iq<rctrack->GetSmoothedValuesCount(); iq++) {
34 const TVector3 &
pos = rctrack->GetSmoothedPosition(iq);
35 const TVector3 &
mom = rctrack->GetSmoothedMomentum(iq);
37 if (rctrack->GetSmoothedValuesCount() != 10)
38 printf(
"%10.4f %10.4f %10.4f -> %10.4f %10.4f %10.4f\n",
39 pos.X(), pos.Y(), pos.Z(), mom.X(), mom.Y(), mom.Z());
44 TVector3 plxx(0.0, 0.0, 111.0), plnx(0.0, 0.0, 1.0);
48 if (param.IsValid()) {
49 const TVector3 &
pos = param.GetPosition();
50 const TVector3 &
mom = param.GetMomentum();
53 printf(
" %10.4f %10.4f %10.4f -> %10.4f %10.4f %10.4f -> %10.4f\n",
54 pos.X(), pos.Y(), pos.Z(), mom.X(), mom.Y(), mom.Z(),
55 param.DistanceToPlane(plxx, plnx));
59 printf(
" ---> No hits!\n");
66 if (mcTrackId < 0 || mcTrackId >= mcTrackArray->GetEntriesFast())
continue;
69 PndMCTrack *mctrack = mcTrackArray->At(mcTrackId);
77 gStyle->SetOptStat(0);
79 dp->SetTitle(
"Momentum resolution");
81 dp->GetXaxis()->SetTitle(
"(P_{rec} - P_{sim})/P_{sim}, [%]");
82 dp->GetXaxis()->SetTitleOffset(0.9);
83 dp->GetXaxis()->SetLabelFont(52);
84 dp->GetXaxis()->SetLabelSize(0.040);
85 dp->GetXaxis()->SetTitleFont(52);
86 dp->GetXaxis()->SetTitleSize(0.050);
88 dp->GetYaxis()->SetTitle(
"Events");
89 dp->GetYaxis()->SetTitleOffset(0.7);
90 dp->GetYaxis()->SetLabelFont(52);
91 dp->GetYaxis()->SetLabelSize(0.040);
92 dp->GetYaxis()->SetTitleFont(52);
93 dp->GetYaxis()->SetTitleSize(0.050);