7 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
10 TFile *
ff =
new TFile(
"simulation.root");
11 TTree *
cbmsim = ff->Get(
"cbmsim");
12 cbmsim->AddFriend(
"cbmsim",
"reconstruction.root");
15 TClonesArray *rctrk =
new TClonesArray(
"PndPidCandidate");
16 cbmsim->SetBranchAddress(
"PidChargedCand",&rctrk);
17 unsigned nEvt = cbmsim->GetEntries(), ndfMax = 0;
18 unsigned arr[1000]; memset(arr, 0x00,
sizeof(arr));
19 for (
unsigned evt = 0; evt<nEvt; evt++) {
20 cbmsim->GetEntry(evt);
22 if (rctrk->GetEntriesFast()) {
26 if (ndf > ndfMax) ndfMax = ndf;
30 unsigned ndfMostPopular = 0, ndfMostPopularStat = 0;
32 if (arr[iq] > ndfMostPopularStat) {
34 ndfMostPopularStat = arr[iq];
37 char *expression =
"100.*(PidChargedCand.GetMomentum().Mag()-MCTrack.GetMomentum().Mag())/MCTrack.GetMomentum().Mag()";
42 sprintf(cut,
"EicIdealGenTrack.fNDF>=%d&&EicIdealGenTrack.fChiSquareCCDF>.001", ndfMostPopular-2);
44 double par[100]; memset(par, 0x00,
sizeof(par));
46 TH1D *dp1 =
new TH1D(
"dp1",
"dp1", 100, -20.0, 20.0);
47 cbmsim->Project(
"dp1", expression, cut);
48 TF1 *fq1 =
new TF1(
"fq1",
"gaus(0)", -20.0, 20.0);
49 par[0] = 100.0; par[1] = 0.0; par[2] = 1.0;
50 fq1->SetParameters(par);
52 fq1->GetParameters(par);
54 double sigma2 = fabs(par[2]), min2 = -5*sigma2, max2 = 5*sigma2;
56 TH1D *dp2 =
new TH1D(
"dp2",
"dp2", 100, min2, max2);
57 cbmsim->Project(
"dp2", expression, cut);
58 TF1 *fq2 =
new TF1(
"fq2",
"gaus(0)", min2, max2);
59 fq2->SetParameters(par);
61 fq2->GetParameters(par);
63 double sigma3 = fabs(par[2]), min3 = -5*sigma3, max3 = 5*sigma3;
65 TH1D *dp3 =
new TH1D(
"dp3",
"dp3", 100, min3, max3);
66 cbmsim->Project(
"dp3", expression, cut);
67 TF1 *fq3 =
new TF1(
"fq3",
"gaus(0)", min3, max3);
68 fq3->SetParameters(par);