1 void doBemcScaleRatio(
char *f_100,
char *f_104,
char *f_96){
5 TFile *f_nom=
new TFile(f_100,
"OPEN");
6 TH1F *h_effHT2=f_nom->Get(
"h_effHT2");
7 TH1F *h_effDHT2=f_nom->Get(
"h_effDaughtersHT2");
8 h_effHT2->Divide(h_effDHT2);
10 TFile *f_plus=
new TFile(f_104,
"OPEN");
11 TH1F *h_effHT2_plus=f_plus->Get(
"h_effHT2");
12 TH1F *h_effDHT2_plus=f_plus->Get(
"h_effDaughtersHT2");
13 h_effHT2_plus->Divide(h_effDHT2_plus);
15 TFile *f_min=
new TFile(f_96,
"OPEN");
16 TH1F *h_effHT2_min=f_min->Get(
"h_effHT2");
17 TH1F *h_effDHT2_min=f_min->Get(
"h_effDaughtersHT2");
18 h_effHT2_min->Divide(h_effDHT2_min);
21 h_effHT2_plus->Divide(h_effHT2);
22 h_effHT2_min->Divide(h_effHT2);
25 TF1 *sub=
new TF1(
"sub",
"1.",0.,20.);
26 h_effHT2_plus->Add(sub,-1.);
27 h_effHT2_min->Add(sub,-1.);
29 TGraphErrors *gHT2_plus=
new TGraphErrors(h_effHT2_plus);
30 gHT2_plus->SetName(
"gHT2_plus");
31 TGraphErrors *gHT2_min=
new TGraphErrors(h_effHT2_min);
32 gHT2_min->SetName(
"gHT2_min");
34 TCanvas *c=
new TCanvas(
"c",
"c",400,250);
35 TMultiGraph *m=
new TMultiGraph();
36 TMultiGraph *mm=
new TMultiGraph();
38 gHT2_plus->SetLineColor(2);
39 gHT2_min->SetLineColor(2);
41 gHT2_plus->RemovePoint(0);
42 gHT2_plus->RemovePoint(0);
43 gHT2_plus->RemovePoint(0);
44 gHT2_plus->RemovePoint(0);
45 gHT2_plus->RemovePoint(0);
46 gHT2_plus->RemovePoint(0);
48 gHT2_min->RemovePoint(0);
49 gHT2_min->RemovePoint(0);
50 gHT2_min->RemovePoint(0);
51 gHT2_min->RemovePoint(0);
52 gHT2_min->RemovePoint(0);
53 gHT2_min->RemovePoint(0);
55 TF1 *fit=
new TF1(
"fit",
"[0]",10.,15.);
57 TF1 *fit2=
new TF1(
"fit2",
"[0]",10.,15.);
77 TLegend *leg=
new TLegend(0.5,0.5,0.7,0.7);
78 leg->AddEntry(gHT2_plus,
"E scale +4%",
"p");
79 leg->AddEntry(gHT2_min,
"E scale -4%",
"p");
82 c->SaveAs(
"bemc_escale_ratio_pp.eps");
83 c->SaveAs(
"bemc_escale_ratio_pp.root");