1537 |
|
TGraphAsymmErrors *eratio; |
1538 |
|
TGraphAsymmErrors *SysEnvelope = new TGraphAsymmErrors(); |
1539 |
|
|
1540 |
– |
if(!do_bpred_ratio) eratio = produce_ratio_graph(ratio); |
1541 |
– |
else { |
1542 |
– |
bool using_data=false; |
1543 |
– |
if((int)savemeas.find("Data")>0) using_data=true; |
1544 |
– |
eratio = histRatio(nominator,denominator,using_data,PlottingSetup::global_ratio_binning,false); |
1545 |
– |
if(syshisto!=0) { |
1546 |
– |
for(int i=1;i<=syshisto->GetNbinsX();i++) { |
1547 |
– |
SysEnvelope->SetPoint(i-1,syshisto->GetBinCenter(i),1.0); |
1548 |
– |
SysEnvelope->SetPointError(i-1,syshisto->GetBinWidth(i),syshisto->GetBinWidth(i),syshisto->GetBinContent(i),syshisto->GetBinContent(i)); |
1549 |
– |
} |
1550 |
– |
SysEnvelope->SetFillColor(TColor::GetColor("#006DE1")); |
1551 |
– |
} |
1552 |
– |
for(int i=1;i<=ratio->GetNbinsX();i++) { |
1553 |
– |
ratio->SetBinContent(i,0); |
1554 |
– |
ratio->SetBinError(i,0); |
1555 |
– |
} |
1556 |
– |
|
1557 |
– |
} |
1558 |
– |
|
1540 |
|
if(syshisto && !do_bpred_ratio) { |
1541 |
|
for(int i=1;i<=syshisto->GetNbinsX();i++) { |
1542 |
+ |
float dx=syshisto->GetBinWidth(i)/2.0; |
1543 |
+ |
float dy=syshisto->GetBinContent(i); |
1544 |
+ |
if(dy<0.01) dy=0.07; |
1545 |
|
SysEnvelope->SetPoint(i-1,syshisto->GetBinCenter(i),1.0); |
1546 |
< |
SysEnvelope->SetPointError(i-1,syshisto->GetBinWidth(i),syshisto->GetBinWidth(i),syshisto->GetBinContent(i),syshisto->GetBinContent(i)); |
1546 |
> |
SysEnvelope->SetPointError(i-1,dx,dx,dy,dy); |
1547 |
|
} |
1548 |
|
SysEnvelope->SetFillColor(TColor::GetColor("#006DE1")); |
1549 |
|
} |
1567 |
|
ratio->Draw("e1"); |
1568 |
|
|
1569 |
|
if(syshisto!=0) { |
1586 |
– |
ratio->Draw(""); |
1570 |
|
SysEnvelope->SetFillColor(TColor::GetColor("#FE9A2E")); |
1571 |
|
SysEnvelope->Draw("2,same"); |
1572 |
|
ratio->Draw("e1,same"); |
1612 |
|
CompleteRatio->Draw(); |
1613 |
|
|
1614 |
|
CompleteSave(main_canvas,savemeas+"_withSysRatio_and_Chi2"); |
1632 |
– |
|
1615 |
|
delete main_canvas; |
1616 |
|
} |
1617 |
|
|