1334 |
|
|
1335 |
|
|
1336 |
|
TGraphAsymmErrors *eratio; |
1337 |
< |
TGraphAsymmErrors *sysratio; |
1337 |
> |
TH1F *SystDown; |
1338 |
> |
TH1F *SystUp; |
1339 |
> |
|
1340 |
|
if(!do_bpred_ratio) eratio = produce_ratio_graph(ratio); |
1341 |
|
else { |
1342 |
|
bool using_data=false; |
1343 |
|
if((int)savemeas.find("Data")>0) using_data=true; |
1344 |
|
eratio = histRatio(nominator,denominator,using_data,PlottingSetup::global_ratio_binning,false); |
1345 |
|
if(syshisto!=0) { |
1346 |
< |
sysratio = SysAndStatRatio(nominator,denominator,syshisto,using_data,PlottingSetup::global_ratio_binning,false); |
1347 |
< |
sysratio->SetFillColor(TColor::GetColor("#006DE1")); |
1346 |
> |
SystDown = (TH1F*)syshisto->Clone("SystDown"); |
1347 |
> |
SystUp = (TH1F*)syshisto->Clone("SystUp"); |
1348 |
> |
for(int i=1;i<=syshisto->GetNbinsX();i++) { |
1349 |
> |
SystDown->SetBinContent(i,1-syshisto->GetBinContent(i)); |
1350 |
> |
SystUp->SetBinContent(i,1+syshisto->GetBinContent(i)); |
1351 |
> |
} |
1352 |
> |
SystDown->SetLineColor(TColor::GetColor("#006DE1")); |
1353 |
> |
SystUp->SetLineColor(TColor::GetColor("#006DE1")); |
1354 |
|
} |
1355 |
|
for(int i=1;i<=ratio->GetNbinsX();i++) { |
1356 |
|
ratio->SetBinContent(i,0); |
1383 |
|
// sysratio->Draw("2"); |
1384 |
|
// eratio->Draw("2,same"); |
1385 |
|
eratio->Draw("2"); |
1386 |
+ |
SystDown->Draw("histo,same"); |
1387 |
+ |
SystUp->Draw("histo,same"); |
1388 |
|
} else { |
1389 |
|
eratio->Draw("2"); |
1390 |
|
} |
1570 |
|
perror ("Couldn't open the directory"); |
1571 |
|
} |
1572 |
|
|
1573 |
< |
void ClearHisto(TH1F *histo) { |
1573 |
> |
void ClearHisto(TH1* histo) { |
1574 |
|
for(int ix=0;ix<=histo->GetNbinsX()+1;ix++) {//also reset over- and underflow |
1575 |
|
histo->SetBinContent(ix,0); |
1576 |
|
histo->SetBinContent(ix,0); |
1578 |
|
} |
1579 |
|
|
1580 |
|
void AddSquared(TH1F *histo, TH1F *addthis, float weight) { |
1581 |
< |
for(int ix=0;ix<=histo->GetNbinsX()+1;ix++) {//also include over- and underflow |
1582 |
< |
histo->SetBinContent(ix,histo->GetBinContent(ix)+(addthis->GetBinContent(ix))*(addthis->GetBinContent(ix))*weight); |
1581 |
> |
for(int ix=1;ix<=addthis->GetNbinsX()+1;ix++) {//also include over- and underflow |
1582 |
> |
float bincenter=addthis->GetBinCenter(ix); |
1583 |
> |
int nBinHisto= histo->FindBin(bincenter); |
1584 |
> |
float old_content=histo->GetBinContent(nBinHisto); |
1585 |
> |
histo->SetBinContent(nBinHisto,old_content+((addthis->GetBinContent(ix))*(addthis->GetBinContent(ix))*weight)); |
1586 |
|
} |
1587 |
|
} |
1588 |
|
|
1589 |
< |
void SQRT(TH1F *histo) { |
1589 |
> |
void SQRT(TH1* histo) { |
1590 |
|
for(int ix=0;ix<=histo->GetNbinsX()+1;ix++) {//also include over- and underflow |
1591 |
|
histo->SetBinContent(ix,TMath::Sqrt(histo->GetBinContent(ix))); |
1592 |
|
} |