9 TString
dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName());
10 dir.ReplaceAll(
"basic.C",
"");
11 dir.ReplaceAll(
"/./",
"/");
14 in.open(Form(
"experimentalData/fragmentEnergySpctra279mmWater0deg.dat",dir.Data()));
17 TFile *
f =
new TFile(
"basic.root",
"RECREATE");
18 TH1F *
h1 =
new TH1F(
"h1",
"x distribution",100,-4,4);
19 TNtuple *
ntuple =
new TNtuple(
"ntuple",
"data from ascii file",
"Energy:He:B:H:Li:Be");
23 Char_t n1[6], n2[2], n3[2], n4[2], n5[2], n6[2],;
24 in >> DATAFLAG >> NDATA ;
25 in >> n1 >> n2 >> n3 >> n4 >> n5 >> n6;
27 cout <<n1<<
" "<<n2<<
" "<<n3<<
" "<<n4<<
" "<<n5<<
" "<<n6<<
"\n";
29 in >> f1 >> f2 >> f3 >>f4 >> f5 >> f6;
30 if (!in.good())
break;
31 if (nlines < 500 )
printf(
"%i %0.2f %0.2f %0.2f %0.2f %0.2f \n",f1,f2,f3,f4,f5,f6);
33 ntuple->Fill(f1,f2,f3,f4,f5,f6);
36 ntuple->SetMarkerStyle(5);
37 ntuple->Draw(
"He:Energy",
"",
"l");
38 ntuple->Draw(
"B:Energy",
"",
"l,Same");
39 ntuple->Draw(
"H:Energy",
"",
"l,Same");
40 ntuple->Draw(
"Li:Energy",
"",
"l,Same");
41 ntuple->Draw(
"Be:Energy",
"",
"l,Same");
42 printf(
" found %d points\n",nlines);
45 TCanvas *mc =
new TCanvas(
"c2",
"Simulation");
46 TFile *MCData = TFile::Open(
"IAEA.root");
47 TH1F* MC_helium = (TH1F*)MCData->Get(
"heliumEnergyAfterPhantom");
48 TH1F* MC_hydrogen = (TH1F*)MCData->Get(
"hydrogenEnergyAfterPhantom");
50 TNtuple *fragments = (TNtuple*) MCData->Get(
"fragmentNtuple");
52 ScaleHelium = 1/(MC_helium->Integral());
53 ScaleHydrogen = 1/(MC_hydrogen->Integral());
56 MC_helium->Scale(ScaleHelium);
58 printf(
"Scaled helium by %.9f\n",ScaleHelium);
60 MC_hydrogen->Scale(ScaleHydrogen);
61 MC_hydrogen->SetLineColor(kRed);
62 MC_hydrogen->Draw(
"Same");
63 printf(
"Scaled hydrogen by %.9f\n",ScaleHydrogen);
65 TCanvas *fc =
new TCanvas(
"fc",
"Fragments");
66 fragments->Draw(
"energy");
printf("%d Experimental points found\n", nlines)