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+1;
76 int YBins = (Ymax - Ymin)/step+1;
79 int indexmax = XBins * YBins;
83 sprintf(inputfile,
"Hisfiles130/HisAll.root");
88 TFile *fin =
new TFile(inputfile);
89 TH2D *EnPo=
new TH2D(
"EnPo",
"",XBins,Xmin,Xmax,YBins,Ymin,Ymax);
92 cout <<
"XBins = " << XBins << endl;
93 cout <<
"YBins = " << YBins << endl;
97 for(
int i = 0;
i < XBins;
i++)
102 xhigh = Xmin + step*(i+1);
105 for(
int j = 0;
j < YBins;
j++)
110 yhigh = Ymin + step*(j+1);
113 binxhigh = Energyhis->GetZaxis()->FindBin(xhigh);
114 binyhigh = Energyhis->GetYaxis()->FindBin(yhigh);
118 binx = Energyhis->GetZaxis()->FindBin(x);
119 biny = Energyhis->GetYaxis()->FindBin(y);
125 TH1D *h5=
new TH1D(
"h5",
"",50,6,10);
127 Energyhis->ProjectionX(
"h5",biny,binyhigh,binx,binxhigh);
151 Center = h5->GetMean();
153 cout <<
"Mean = " << Center << endl;
155 EnPo->SetBinContent(binx,biny,Center);
164 TCanvas *c22 =
new TCanvas(
"c22",
"c22",0,0,800,600);
172 c22->SaveAs(
"EnPo.png");
175 sprintf(Filename,
"EnergyPosition.root");
178 TFile *
fout =
new TFile(Filename,
"RECREATE");