1 void doBsmdSpreadRatio(
char *f_100,
char *f_110,
char *f_90){
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_110,
"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_90,
"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]",1.,15.);
57 TF1 *fit2=
new TF1(
"fit2",
"[0]",1.,15.);
76 TLegend *leg=
new TLegend(0.5,0.5,0.7,0.7);
77 leg->AddEntry(gHT2_plus,
"BSMD gain spread 30%",
"p");
78 leg->AddEntry(gHT2_min,
"BSMD gain spread 10%",
"p");
81 c->SaveAs(
"bsmd_spread_ratio_pp.eps");
82 c->SaveAs(
"bsmd_spread_ratio_pp.root");