7 #include <TGraphErrors.h>
23 gStyle->SetOptStat(0);
27 double x[
N] ={-288, -288, -277, -260, -230, -205, -258, -300};
28 double y[
N] = {-105, -177, -117, -165, -165, -138, -138, -188};
42 TFile *fin =
new TFile(
"His3.root");
44 TCanvas *c12 =
new TCanvas(
"c12",
"c12",0,0,800,600);
48 TH1D *
h1 =
new TH1D(
"h1",
"",50,4,12);
50 for(
int i = 0;
i <
N ;
i++)
56 XBinlow = Energyhis->GetXaxis()->FindBin(x[
i]-step);
57 XBinhigh = Energyhis->GetXaxis()->FindBin(x[
i]+step);
59 YBinlow = Energyhis->GetXaxis()->FindBin(y[
i]-step);
60 YBinhigh = Energyhis->GetXaxis()->FindBin(y[
i]+step);
62 cout <<
"XBin = " << XBinlow << endl;
64 Energyhis->ProjectionZ(
"h1",XBinlow,XBinhigh,YBinlow,YBinhigh);
69 sprintf(Title,
"Energy Spetrum at Location X = %d Y = %d",x[
i],y[i]);
72 h1->GetXaxis()->SetTitle(
"Energy (GeV)");
73 h1->GetYaxis()->SetTitle(
"Counts");
83 sprintf(hisname,
"Result/Spetrum%d.png",i);