FairRoot/PandaRoot
Functions
Pic_FEP-Eff_lEE.C File Reference

Go to the source code of this file.

Functions

int Pic_FEP_Eff_lEE ()
 

Function Documentation

int Pic_FEP_Eff_lEE ( )

Definition at line 1 of file Pic_FEP-Eff_lEE.C.

References c1, c2, counter, counter2, counter3, Double_t, i, leg, nEvents, TString, x, and y.

2 {
3  const int nPoints = 20;
4 Double_t x[nPoints],y[nPoints],yE[nPoints]; //without target
5 Double_t x3[nPoints],y3[nPoints],yE3[nPoints]; //with target 3
6 Double_t x2[nPoints],y2[nPoints],yE2[nPoints]; //with target 3
7 Double_t Loss[nPoints];
8 ifstream Inputfile("/data/work/kpha1/steinen/Gamma/Ana/CombinedData/Fitted/FittedDataLowEnergy.txt");
9 
10  Int_t Geometry, Sektar, nEvents;
11  Double_t Energy, FullEnergyPeakEff, FullEnergyPeakEffError, FWHM, FWHMError,FullEnergyPeakEffSEP, FullEnergyPeakEffSEPError,FullEnergyPeakEffSEPDEP, FullEnergyPeakEffSEPDEPError;
12  char InputName[100];
13  int counter = 0;
14  int counter2 = 0;
15  int counter3 = 0;
16  int iSekTarFile = 7;
17  int iSekTarFile2 = 6; //tantallum
18  bool useNoTargetComparison = 1;
19  while(Inputfile >> Geometry >> Sektar >> Energy >> nEvents >> FullEnergyPeakEff >> FullEnergyPeakEffError >>FWHM >> FWHMError>> FullEnergyPeakEffSEP >> FullEnergyPeakEffSEPError>>FullEnergyPeakEffSEPDEP >> FullEnergyPeakEffSEPDEPError )
20  {
21  if (Sektar == 4)
22  {
23  x[counter] = Energy;
24  y[counter] = FullEnergyPeakEff;
25  yE[counter] = FullEnergyPeakEffError;
26  cout <<counter << " "<< Sektar << " " << x[counter] <<" " <<y[counter] << " " <<yE[counter]<<endl;
27  counter++;
28  }
29  if (Sektar == iSekTarFile)
30  {
31  x3[counter3] = Energy;
32  y3[counter3] = FullEnergyPeakEff;
33  yE3[counter3] = FullEnergyPeakEffError;
34  cout <<counter3 << " " <<Sektar << " " << x3[counter3] <<" " <<y3[counter3] << " " <<yE3[counter3]<<endl;
35  counter3++;
36 
37  }
38  if (Sektar == iSekTarFile2)
39  {
40  x2[counter2] = Energy;
41  y2[counter2] = FullEnergyPeakEff;
42  yE2[counter2] = FullEnergyPeakEffError;
43  cout <<counter2 << " " <<Sektar << " " << x2[counter2] <<" " <<y2[counter2] << " " <<yE2[counter2]<<endl;
44  counter2++;
45 
46  }
47  }
48  Inputfile.close();
49  TCanvas *c1 = new TCanvas("c1","c1",800,600);
50  c1->SetGridx(1);
51  c1->SetGridy(1);
52  TGraph *graph = new TGraph(10,x,y);
53  TGraphErrors *graphTr4020 = new TGraphErrors(nPoints,x,y,0,yE);
54  TGraphErrors *graphTr4020SekTar3 = new TGraphErrors(nPoints,x3,y3,0,yE3);
55  TGraphErrors *graphTr4020SekTar2 = new TGraphErrors(nPoints,x2,y2,0,yE2);
56  TString HistoTitle;
57  switch (iSekTarFile)
58  {
59  case 4: HistoTitle = "Simulation of full-energy-peak-efficiency, iron target";
60  break;
61  //case 6: HistoTitle = "Simulation of full-energy-peak-efficiency, tantalum target";
62  case 6: HistoTitle = "Simulation of full-energy-peak-efficiency";
63  break;
64  default: HistoTitle = "Simulation of full-energy-peak-efficiency";
65  }
66  graphTr4020->SetTitle(HistoTitle.Data());
67  graphTr4020->GetHistogram()->SetXTitle("#gamma energy [MeV]");
68  graphTr4020->GetHistogram()->GetXaxis()->CenterTitle();
69  graphTr4020->GetHistogram()->GetXaxis()->SetTitleSize(0.06);
70  graphTr4020->GetHistogram()->GetXaxis()->SetTitleOffset(0.75);
71  graphTr4020->GetHistogram()->GetXaxis()->SetLabelSize(0.045);
72  graphTr4020->GetHistogram()->SetYTitle("Full-energy-peak-efficiency [%]");
73  graphTr4020->GetHistogram()->GetYaxis()->CenterTitle();
74  graphTr4020->GetHistogram()->GetYaxis()->SetTitleSize(0.06);
75  graphTr4020->GetHistogram()->GetYaxis()->SetTitleOffset(0.6);
76  graphTr4020->GetHistogram()->GetYaxis()->SetLabelSize(0.045);
77  graphTr4020->GetHistogram()->SetMinimum(0);
78  //graphTr4020->GetHistogram()->SetMaximum(12);
79  Size_t dMarkerSize = 2;
80  graphTr4020->SetMarkerColor(1);
81  graphTr4020->SetMarkerSize(dMarkerSize/2);
82  graphTr4020->SetMarkerStyle(20);
83  graphTr4020->SetLineColor(1);
84  graphTr4020->SetLineStyle(2);
85 
86  graphTr4020SekTar3->SetTitle(HistoTitle.Data());
87  graphTr4020SekTar3->GetHistogram()->SetXTitle("#gamma energy [MeV]");
88  graphTr4020SekTar3->GetHistogram()->GetXaxis()->CenterTitle();
89  graphTr4020SekTar3->GetHistogram()->GetXaxis()->SetTitleSize(0.06);
90  graphTr4020SekTar3->GetHistogram()->GetXaxis()->SetTitleOffset(0.75);
91  graphTr4020SekTar3->GetHistogram()->GetXaxis()->SetLabelSize(0.045);
92  graphTr4020SekTar3->GetHistogram()->SetYTitle("Full-energy-peak-efficiency [%]");
93  graphTr4020SekTar3->GetHistogram()->GetYaxis()->CenterTitle();
94  graphTr4020SekTar3->GetHistogram()->GetYaxis()->SetTitleSize(0.06);
95  graphTr4020SekTar3->GetHistogram()->GetYaxis()->SetTitleOffset(0.6);
96  graphTr4020SekTar3->GetHistogram()->GetYaxis()->SetLabelSize(0.045);
97  graphTr4020SekTar3->GetHistogram()->SetMinimum(0);
98 
99 
100  graphTr4020SekTar3->SetMarkerColor(2);
101  graphTr4020SekTar3->SetMarkerSize(dMarkerSize/2);
102  graphTr4020SekTar3->SetMarkerStyle(20);
103  graphTr4020SekTar3->SetLineColor(2);
104  graphTr4020SekTar3->SetLineStyle(2);
105 
106  graphTr4020SekTar2->SetTitle(HistoTitle.Data());
107  graphTr4020SekTar2->GetHistogram()->SetXTitle("#gamma energy [MeV]");
108  graphTr4020SekTar2->GetHistogram()->GetXaxis()->CenterTitle();
109  graphTr4020SekTar2->GetHistogram()->GetXaxis()->SetTitleSize(0.06);
110  graphTr4020SekTar2->GetHistogram()->GetXaxis()->SetTitleOffset(0.75);
111  graphTr4020SekTar2->GetHistogram()->GetXaxis()->SetLabelSize(0.045);
112  graphTr4020SekTar2->GetHistogram()->SetYTitle("Full-energy-peak-efficiency [%]");
113  graphTr4020SekTar2->GetHistogram()->GetYaxis()->CenterTitle();
114  graphTr4020SekTar2->GetHistogram()->GetYaxis()->SetTitleSize(0.06);
115  graphTr4020SekTar2->GetHistogram()->GetYaxis()->SetTitleOffset(0.6);
116  graphTr4020SekTar2->GetHistogram()->GetYaxis()->SetLabelSize(0.045);
117  graphTr4020SekTar2->GetHistogram()->SetMinimum(0);
118 
119 
120  graphTr4020SekTar2->SetMarkerColor(3);
121  graphTr4020SekTar2->SetMarkerSize(dMarkerSize/2);
122  graphTr4020SekTar2->SetMarkerStyle(20);
123  graphTr4020SekTar2->SetLineColor(3);
124  graphTr4020SekTar2->SetLineStyle(2);
125 
126  if (useNoTargetComparison)
127  {
128  TLegend* leg = new TLegend(0.7,0.7,0.9,0.9);
129  leg->AddEntry(graphTr4020,"iron target","p");
130  //leg->AddEntry(graphTr4020SekTar3,"tantalum target","p");
131  leg->AddEntry(graphTr4020SekTar3,"iron target, with silicons","p");
132  leg->AddEntry(graphTr4020SekTar2,"tantalum target","p");
133  graphTr4020->Draw("APL");
134  graphTr4020SekTar3->Draw("PL");
135  graphTr4020SekTar2->Draw("PL");
136  leg->Draw("");
137  }
138  else
139  graphTr4020SekTar3->Draw("APL");
140  //graph->Draw("APL");
141 
142  if (useNoTargetComparison)
143  {
144  for (int i = 0; i<counter;i++)
145  {
146  Loss[i]=100-y3[i]/y[i]*100;
147  cout << i << " " << Loss[i] << endl;
148  }
149 
150  TCanvas *c2 = new TCanvas("c2","c2",800,600);
151  c2->SetGridx(1);
152  c2->SetGridy(1);
153  TGraph *graphLoss = new TGraph(10,x,Loss);
154  graphLoss->SetMarkerColor(1);
155  graphLoss->SetMarkerSize(dMarkerSize/2);
156  graphLoss->SetMarkerStyle(20);
157  graphLoss->SetLineColor(1);
158  graphLoss->SetLineStyle(2);
159  graphLoss->SetTitle("Efficiency loss due to the silicon detectors");
160  graphLoss->GetHistogram()->SetXTitle("#gamma energy [keV]");
161  graphLoss->GetHistogram()->GetXaxis()->CenterTitle();
162  graphLoss->GetHistogram()->GetXaxis()->SetTitleSize(0.06);
163  graphLoss->GetHistogram()->GetXaxis()->SetTitleOffset(0.75);
164  graphLoss->GetHistogram()->GetXaxis()->SetLabelSize(0.045);
165  graphLoss->GetHistogram()->SetYTitle("Efficiency loss [%]");
166  graphLoss->GetHistogram()->GetYaxis()->CenterTitle();
167  graphLoss->GetHistogram()->GetYaxis()->SetTitleSize(0.06);
168  graphLoss->GetHistogram()->GetYaxis()->SetTitleOffset(0.6);
169  graphLoss->GetHistogram()->GetYaxis()->SetLabelSize(0.045);
170  graphLoss->GetHistogram()->SetMinimum(0);
171  graphLoss->Draw("APL");
172  }
173  TString PicFEPString ="~/pictures/FEP-Eff_Geo";
174  PicFEPString += iSekTarFile;
175  PicFEPString += "_LE.png";
176  c1->SaveAs(PicFEPString.Data());
177  if (useNoTargetComparison)
178  {
179  TString PicFEPCompString ="~/pictures/Target-NoTarget-Comparion_Geo";
180  PicFEPCompString += iSekTarFile;
181  PicFEPCompString += "_LE.png";
182 
183  c2->SaveAs(PicFEPCompString.Data());
184  }
185  return 0;
186 }
Int_t i
Definition: run_full.C:25
c2
Definition: plot_dirc.C:39
static int counter2
Definition: createSTT.C:28
int counter
Definition: ZeeAnalysis.C:59
Double_t
Int_t nEvents
Definition: hit_dirc.C:11
c1
Definition: plot_dirc.C:35
Double_t x
static int counter3
Definition: createSTT.C:29
Double_t y