1 void doBemcSpread(
char *f_7,
char *f_5,
char *f_9){
5 TFile *f_nom=
new TFile(f_7,
"OPEN");
6 TH1F *h_effMB=f_nom->Get(
"h_effMB");
7 TH1F *h_effHT1=f_nom->Get(
"h_effHT1");
8 TH1F *h_effHT2=f_nom->Get(
"h_effHT2");
10 TFile *f_plus=
new TFile(f_5,
"OPEN");
11 TH1F *h_effMB_plus=f_plus->Get(
"h_effMB");
12 TH1F *h_effHT1_plus=f_plus->Get(
"h_effHT1");
13 TH1F *h_effHT2_plus=f_plus->Get(
"h_effHT2");
15 TFile *f_min=
new TFile(f_9,
"OPEN");
16 TH1F *h_effMB_min=f_min->Get(
"h_effMB");
17 TH1F *h_effHT1_min=f_min->Get(
"h_effHT1");
18 TH1F *h_effHT2_min=f_min->Get(
"h_effHT2");
20 h_effMB_plus->Divide(h_effMB);
21 h_effHT1_plus->Divide(h_effHT1);
22 h_effHT2_plus->Divide(h_effHT2);
24 h_effMB_min->Divide(h_effMB);
25 h_effHT1_min->Divide(h_effHT1);
26 h_effHT2_min->Divide(h_effHT2);
28 TF1 *sub=
new TF1(
"sub",
"1.",0.,20.);
29 TF1 *mult=
new TF1(
"mult",
"-1.",0.,20.);
30 h_effMB_plus->Add(sub,-1.);
31 h_effHT1_plus->Add(sub,-1.);
32 h_effHT2_plus->Add(sub,-1.);
33 h_effMB_min->Add(sub,-1.);
34 h_effHT1_min->Add(sub,-1.);
35 h_effHT2_min->Add(sub,-1.);
36 h_effMB_plus->Multiply(mult);
37 h_effHT1_plus->Multiply(mult);
38 h_effHT2_plus->Multiply(mult);
39 h_effMB_min->Multiply(mult);
40 h_effHT1_min->Multiply(mult);
41 h_effHT2_min->Multiply(mult);
45 TGraphErrors *gMB_plus=
new TGraphErrors(h_effMB_plus);
46 gMB_plus->SetName(
"gMB_plus");
47 TGraphErrors *gHT1_plus=
new TGraphErrors(h_effHT1_plus);
48 gHT1_plus->SetName(
"gHT1_plus");
49 TGraphErrors *gHT2_plus=
new TGraphErrors(h_effHT2_plus);
50 gHT2_plus->SetName(
"gHT2_plus");
52 TGraphErrors *gMB_min=
new TGraphErrors(h_effMB_min);
53 gMB_min->SetName(
"gMB_min");
54 TGraphErrors *gHT1_min=
new TGraphErrors(h_effHT1_min);
55 gHT1_min->SetName(
"gHT1_min");
56 TGraphErrors *gHT2_min=
new TGraphErrors(h_effHT2_min);
57 gHT2_min->SetName(
"gHT2_min");
59 TCanvas *c=
new TCanvas(
"c",
"c",400,250);
60 TMultiGraph *m=
new TMultiGraph();
61 TMultiGraph *mm=
new TMultiGraph();
63 gMB_plus->SetLineColor(1);
64 gMB_min->SetLineColor(1);
65 gHT1_plus->SetLineColor(4);
66 gHT1_min->SetLineColor(4);
67 gHT2_plus->SetLineColor(2);
68 gHT2_min->SetLineColor(2);
70 gMB_plus->RemovePoint(0);
71 gMB_plus->RemovePoint(0);
72 gHT1_plus->RemovePoint(0);
73 gHT1_plus->RemovePoint(0);
74 gHT1_plus->RemovePoint(0);
75 gHT1_plus->RemovePoint(0);
76 gHT2_plus->RemovePoint(0);
77 gHT2_plus->RemovePoint(0);
78 gHT2_plus->RemovePoint(0);
79 gHT2_plus->RemovePoint(0);
80 gHT2_plus->RemovePoint(0);
81 gHT2_plus->RemovePoint(0);
83 gMB_min->RemovePoint(0);
84 gMB_min->RemovePoint(0);
85 gHT1_min->RemovePoint(0);
86 gHT1_min->RemovePoint(0);
87 gHT1_min->RemovePoint(0);
88 gHT1_min->RemovePoint(0);
89 gHT2_min->RemovePoint(0);
90 gHT2_min->RemovePoint(0);
91 gHT2_min->RemovePoint(0);
92 gHT2_min->RemovePoint(0);
93 gHT2_min->RemovePoint(0);
94 gHT2_min->RemovePoint(0);
96 TF1 *fit=
new TF1(
"fit",
"[0]",2.,15.);
97 TF1 *fit2=
new TF1(
"fit2",
"[0]",2.,15.);
121 TLegend *leg=
new TLegend(0.5,0.5,0.7,0.7);
122 leg->AddEntry(gMB_plus,
"minimum bias, #sigma(C)/C=7%",
"p");
123 leg->AddEntry(gHT1_plus,
"hightower 1",
"p");
124 leg->AddEntry(gHT2_plus,
"hightower 2",
"p");
125 leg->AddEntry(gMB_min,
"#sigma(C)/C=11%",
"p");
128 c->SaveAs(
"bemc_spread_dau.eps");
129 c->SaveAs(
"bemc_spread_dau.root");