4 int pz[9] = {1,2,4,8,12,16,32,40,50};
7 for (
int i=0;
i<9;
i++)
10 sprintf(infile,
"%s%dout.root",part, pz[
i]);
12 sprintf(hname,
"%s%s%dd",calo,part,pz[i]);
13 TH1F *
h1 =
new TH1F(hname,
"", 100, 0, 1);
14 TFile *
f = TFile::Open(infile);
16 TNtuple *nt = (TNtuple *)f->Get(
"ed");
21 nt->Project(hname,
"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
25 nt->Project(hname,
"(HIA+HIS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
29 nt->Project(hname,
"(EA+ES)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
31 else if (calo ==
"MAG")
33 nt->Project(hname,
"(MAG)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
35 else if (calo ==
"BH")
37 nt->Project(hname,
"(BH)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
41 cout <<
"ERROR" << endl;
46 sprintf(fname,
"%spercent.root",part);
47 TFile *
fout = TFile::Open(fname,
"UPDATE");
50 cout << h1->Integral() <<
" " << hname <<
" " << pz[
i] << endl;
55 void EdepSmall(
const char *calo=
"HOe",
const char *part =
"e")
57 int pz[9] = {1,2,4,8,12,16,32,40,50};
64 sprintf(fname,
"%spercent.root",part);
66 sprintf(area,
"%s",calo);
67 TFile *fin = TFile::Open(fname);
69 for (
int i=0;
i<9;
i++)
72 sprintf(hname,
"%s%s%dd",calo,part,pz[
i]);
73 TH1 *
h1 = (TH1F *) fin->Get(hname);
74 y[
i] = h1->GetMean(1);
75 yer[
i] = h1->GetRMS(1);
77 gr =
new TGraphErrors(9,x,y,xer,yer);
80 gr->SetMarkerStyle(20);
81 gr->SetMarkerColor(2);