3 #include "TInterpreter.h"
5 #include "TApplication.h"
30 TString
dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName());
31 dir.ReplaceAll(
"fragmentAngularDistribution.C",
"");
32 dir.ReplaceAll(
"/./",
"/");
35 TString pDepth, fragment, Znum, normToOneAtZeroAngle;
36 cout <<
"Enter phantom depth (eg. 27.9, see experimentalData directory for choices): ";
39 TString simulationDataPath =
"IAEA_" + pDepth +
".root";
43 TFile *MCData = TFile::Open(simulationDataPath);
44 TNtuple *fragments = (TNtuple*) MCData->Get(
"fragmentNtuple");
47 TNtuple *metadata = (TNtuple*) MCData->Get(
"metaData");
48 Float_t events, detectorDistance,waterThickness,beamEnergy,energyError,phantomCenterDistance;
49 metadata->SetBranchAddress(
"events",&events);
50 metadata->SetBranchAddress(
"waterThickness",&waterThickness);
51 metadata->SetBranchAddress(
"detectorDistance",&detectorDistance);
52 metadata->SetBranchAddress(
"beamEnergy",&beamEnergy);
53 metadata->SetBranchAddress(
"energyError",&energyError);
54 metadata->SetBranchAddress(
"phantomCenterDistance",&phantomCenterDistance);
55 metadata->GetEntry(0);
61 Double_t scatteringDistance = detectorDistance - phantomCenterDistance;
71 rMaxString = Form(
"%f", scatteringDistance*
TMath::ATan(degrees*TMath::DegToRad()));
72 std::cout <<
"Computes comparable figures to E.haettners yield calculations for zero to ten degree angles." << endl;
73 std::cout <<
"Firsta value is yield of Z=1 per C12 incident paritcle second is for Z=2 etc." << endl;
74 std::cout <<
"verboseness has been limited to make pasting easyer." << endl;
75 for(
int i = 1; i <= 6; i++){
76 int numEntries = fragments->GetEntries(
"(Z == " + TString::Format(
"%i",i) +
" && sqrt(posY^2 + posZ^2) < " + rMaxString +
"&& sqrt(posY*posY + posZ*posZ) > " + rMinString +
")");
77 std::cout << numEntries / (events * .999) << endl;