3 TString
hists[nhists]={
"efrac_2sig",
"emaxfrac_6plane",
"Efrac_sumplane9",
"efrac_plane2",
"efrac_plane3",
"efrac_plane4",
"BDT7ratio"};
4 TString
hists_name[nhists]={
"Fraction of energy in 2#sigma road",
"Maximum fraction of energy in 6-continuous planes",
"Fraction of energy in frist 10 planes",
"Fraction of energy in 2nd plane",
"Fraction of energy in 3rd plane",
"Fraction energy in 4th plane",
"BDT7 output"};
6 double minXbin[nhists]={0.9,0,0,0,0,0,-0.3};
7 double maxXbin[nhists]={1.01,0.2,0.2,0.025,0.025,0.025,0.3};
9 int nxbins[nhists]={120,20,40,200,200,200,50};
10 double lxbins[nhists]={0,0,0,0,0,0,-1};
11 double hxbins[nhists]={1.2,0.2,0.2,0.2,0.2,0.2,1};
13 TFile *
fd =
new TFile(
"data_results.root");
14 TFile *
fmc =
new TFile(
"makeplots_LID02/data_results.root");
16 gStyle->SetOptStat(0);
18 for(
int ih=0; ih<nhists; ++ih ){
20 TH1F *
hmc = (TH1F*)fmc->Get(hists[ih]);
21 TH1F *
hd = (TH1F*)fd->Get(hists[ih]);
23 TString ratio_name=
"ratio_"+nhists[ih];
24 TH1F *hratio=
new TH1F(ratio_name,
"",nxbins[ih],lxbins[ih],hxbins[ih]);
27 double bin_data=hd->GetBinContent(
ibin);
28 double err_data=hd->GetBinError(
ibin);
29 double bin_mc=hmc->GetBinContent(
ibin);
30 double err_mc=hmc->GetBinError(
ibin);
33 if( bin_data>0. && bin_mc>0. ){
34 bin_con=bin_data/bin_mc;
35 bin_err =
sqrt((err_mc/bin_mc)**2+(err_data/bin_data)**2);
37 hratio->SetBinContent(
ibin,bin_con);
38 hratio->SetBinError(
ibin,bin_con*bin_err);
43 TString can_name=
"variable_"+hists[ih];
44 TCanvas *
c1 =
new TCanvas(can_name,
"",700,600);
47 pad1 =
new TPad(
"pad1",
"",0,0,0.99,0.99);
50 pad1->Range(-1.081083,0.6027835,104.4476,1.087781);
51 pad1->SetFillColor(0);
52 pad1->SetBorderMode(0);
53 pad1->SetBorderSize(2);
54 pad1->SetLeftMargin(0.1523859);
55 pad1->SetRightMargin(0.04214559);
56 pad1->SetTopMargin(0.07790022);
57 pad1->SetBottomMargin(0.3035405);
58 pad1->SetFrameBorderMode(0);
59 pad1->SetFrameBorderMode(0);
62 TString h2f_name=
"h2f_"+hists[ih];
63 TH2F *
h2f =
new TH2F(h2f_name,
"Rock muons",100,minXbin[ih],maxXbin[ih],100,0.5,8000);
70 hmc->SetMarkerColor(4);
71 hmc->SetMarkerStyle(24);
74 hd->SetMarkerStyle(8);
78 TLegend *
leg =
new TLegend(0.6,0.6,0.89,0.89);
81 leg->AddEntry(hd,
"new",
"p");
82 leg->AddEntry(hmc,
"old",
"p");
88 pad2 =
new TPad(
"pad2",
"",0,0,0.99,0.3);
91 pad2->Range(-1.081081,0.6526316,103.3923,1.202863);
92 pad2->SetFillColor(0);
93 pad2->SetBorderMode(0);
94 pad2->SetBorderSize(2);
95 pad2->SetLeftMargin(0.1539252);
96 pad2->SetRightMargin(0.0324703);
97 pad2->SetTopMargin(0.005203551);
98 pad2->SetBottomMargin(0.2678298);
99 pad2->SetFrameBorderMode(0);
100 pad2->SetFrameBorderMode(0);
103 TString h2f2_name=
"h2f2_"+hists[ih];
104 TH2F *
h2f2 =
new TH2F(h2f2_name,
"",100,minXbin[ih],maxXbin[ih],100,0.01,1.99);
105 h2f2->SetXTitle(hists_name[ih]);
106 h2f2->SetYTitle(
"data/MC");
107 h2f2->GetXaxis()->SetLabelSize(0.1);
108 h2f2->GetXaxis()->SetTitleSize(0.13);
109 h2f2->GetXaxis()->SetTitleOffset(0.85);
110 h2f2->GetYaxis()->SetLabelSize(0.12);
111 h2f2->GetYaxis()->SetTitleSize(0.13);
112 h2f2->GetYaxis()->SetTitleOffset(0.5);
113 h2f2->GetYaxis()->SetNdivisions(011);
116 hratio->SetMarkerStyle(24);
117 hratio->SetLineColor(2);
118 hratio->SetMarkerColor(2);
119 hratio->Draw(
"E0 same");
TString hists_name[nhists]