4 Double_t vXMin = fPar[1] - 3. * fPar[2];
5 Double_t vXMax = fPar[1] + 3. * fPar[2];
7 Int_t vBinMin = h1->FindBin(vXMin);
8 Int_t vBinMed = h1->FindBin(fPar[1]);
9 Int_t vBinMax = h1->FindBin(vXMax);
11 Double_t vEfficiency = h1->Integral(vBinMin+1,vBinMax-1);
12 vEfficiency += h1->GetBinContent(vBinMin)*(h1->GetBinLowEdge(vBinMin+1)-vXMin)/h1->GetBinWidth(vBinMin);
13 vEfficiency += h1->GetBinContent(vBinMax)*(-h1->GetBinLowEdge(vBinMax)+vXMax)/h1->GetBinWidth(vBinMax);
14 vEfficiency /= h1->Integral(0,-1);
23 TF1 *vChanneling =
new TF1(
"vChanneling",
"gaus",fChannelingMinimum,fChannelingMaximum);
24 vChanneling->SetParNames(
"Const",
"Mean",
"Sigma");
25 vChanneling->SetLineColor(4);
26 vChanneling->SetLineStyle(2);
28 TH2D *hChannelingPlot =
new TH2D(
"hChannelingPlot",
"Deflection Angle vs. Incoming Angle;Horizontal Incoming Angle [#murad];Horizontal Deflection Angle [#murad]",21,-10.5,10.5,256,-127.5,128.5);
30 TH1F *hChannelingEfficiency =
new TH1F(
"hChannelingEfficiency",
"G4Channeling;Horizontal Incoming Angle [#murad];Efficiency [%]",21,-10.5,10.5);
32 fTree->Draw(
"(angXout-angXin):angXin>>hChannelingPlot");
34 Double_t vNormalizationToAmorphous = 0.965;
36 for(
int i=2;i<=21;i++){
37 TH1D*
h1 = hChannelingPlot->ProjectionY(
"h1",i,i);
38 h1->Fit(vChanneling,
"QR");
40 vChannelingParameters = vChanneling->GetParameters();
41 hChannelingEfficiency->SetBinContent(i,
ComputeEfficiency(h1,vChannelingParameters)/vNormalizationToAmorphous);
44 hChannelingEfficiency->SetLineColor(3);
45 hChannelingEfficiency->SetLineStyle(4);
46 hChannelingEfficiency->SetMarkerColor(3);
47 hChannelingEfficiency->SetFillStyle(0);
48 hChannelingEfficiency->SetMarkerStyle(20);
49 hChannelingEfficiency->Draw(
"PL");
51 TGraph* gRoughExperimentalData =
new TGraph(11);
52 gRoughExperimentalData->SetPoint( 0 , -10 , 20 );
53 gRoughExperimentalData->SetPoint( 1 , -8 , 38 );
54 gRoughExperimentalData->SetPoint( 2 , -6 , 56 );
55 gRoughExperimentalData->SetPoint( 3 , -4 , 72 );
56 gRoughExperimentalData->SetPoint( 4 , -2 , 80 );
57 gRoughExperimentalData->SetPoint( 5 , 0 , 84 );
58 gRoughExperimentalData->SetPoint( 6 , 2 , 82 );
59 gRoughExperimentalData->SetPoint( 7 , 4 , 78 );
60 gRoughExperimentalData->SetPoint( 8 , 6 , 66 );
61 gRoughExperimentalData->SetPoint( 9 , 8 , 52 );
62 gRoughExperimentalData->SetPoint( 10 , 10 , 37 );
64 gRoughExperimentalData->SetLineColor(4);
65 gRoughExperimentalData->SetLineStyle(3);
66 gRoughExperimentalData->SetFillStyle(0);
67 gRoughExperimentalData->SetFillColor(0);
68 gRoughExperimentalData->SetMarkerColor(4);
69 gRoughExperimentalData->SetMarkerStyle(21);
70 gRoughExperimentalData->SetTitle(
"Phys. Lett. B 680, 129");
72 gRoughExperimentalData->Draw(
"sameCP");
74 TLegend *aLegend =
new TLegend(0.30,0.15,0.55,0.3);
75 aLegend->AddEntry(hChannelingEfficiency);
76 aLegend->AddEntry(gRoughExperimentalData);
77 aLegend->SetFillStyle(0);
78 aLegend->SetLineColor(0);