7 #include <TGraphErrors.h>
9 #include "SaveCanvas.C"
10 #include "SetOKStyle.C"
30 gSystem->Load(
"libg4eval.so");
31 gSystem->Load(
"libqa_modules.so");
32 gSystem->Load(
"libPrototype3.so");
34 gStyle->SetOptStat(0);
75 int XBins = (Xmax - Xmin)/step;
76 int YBins = (Ymax - Ymin)/step;
84 int indexmax = XBins * YBins;
90 sprintf(inputfile,
"His3.root");
92 TFile *fin =
new TFile(inputfile);
93 TH2D *EnPo=
new TH2D(
"EnPo",
"",XBins,Xmin,Xmax,YBins,Ymin,Ymax);
96 cout <<
"XBins = " << XBins << endl;
97 cout <<
"YBins = " << YBins << endl;
101 for(
int i = 0;
i < XBins;
i++)
106 xhigh = Xmin + step*(i+1);
109 for(
int j = 0;
j < YBins;
j++)
114 yhigh = Ymin + step*(j+1);
119 binx = Energyhis->GetXaxis()->FindBin(x+0.0001);
120 biny = Energyhis->GetYaxis()->FindBin(y+0.0001);
127 binxhigh = Energyhis->GetXaxis()->FindBin(xhigh-0.0001);
128 binyhigh = Energyhis->GetYaxis()->FindBin(yhigh-0.0001);
131 TH1D *h5=
new TH1D(
"h5",
"",50,6,10);
136 Energyhis->ProjectionZ(
"h5",binx,binxhigh,biny,binyhigh);
160 Center = h5->GetMean();
165 cout <<
"Mean = " << Center << endl;
167 EnPo->SetBinContent(binx,biny,Center);
176 TCanvas *c22 =
new TCanvas(
"c22",
"c22",0,0,800,600);
184 c22->SaveAs(
"EnPo.png");
189 sprintf(Filename,
"EnergyPosition3.root");
190 TFile *
fout =
new TFile(Filename,
"RECREATE");