Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjustUncertainties.C propagates all input histograms, also add tracking #36

Open
wants to merge 2 commits into
base: BinningStudy
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion New_RA2b_2015/Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Events::Events(TTree * ttree_, const std::string sampleKeyString, int verbose) : currentEntry_(-1) {

// Data or MC ?
DataBool=true;
DataBool=false;

// Study Tau ID
StudyTauId=false;
Expand Down
154 changes: 114 additions & 40 deletions New_RA2b_2015/adjustUncertainties.C
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
Plots the various systematics and adjusts the bins with large fluctuations.
> root -l -b
> .L adjustUncertainties()
> adjustUncertainties(true) // to adjust fluctuating bins, will create ARElog49_HadTauEstimation_data_formatted_New.root and data_formatted_systematics_new.pdf
> .L adjustUncertainties.C
> adjustUncertainties(true) // to adjust fluctuating bins, will create ARElog49_HadTauEstimation_data_formatted_New.root and data_formatted_systematics_new.pdf
> adjustUncertainties(false) // for original hists, will create ARElog49_HadTauEstimation_data_formatted_NoChange.root and data_formatted_systematics_NoChange.pdf
*/

Expand All @@ -20,69 +20,77 @@ bool lastPrint =true;

void adjustUncertainties(bool adjust=true) {

TFile *file = TFile::Open("ARElog49_HadTauEstimation_data_formatted.root");
TFile *file = TFile::Open("ARElog58_12.9ifb_UpdatedSysAndMuSys_HadTauEstimation_data_formatted.root");

TFile *fout = TFile::Open("ARElog49_HadTauEstimation_data_formatted_New.root", "RECREATE");
TFile *fout;
if(adjust==false)
fout = TFile::Open("ARElog49_HadTauEstimation_data_formatted_NoChange.root", "RECREATE");
fout = TFile::Open("ARElog58_12.9ifb_UpdatedSysAndMuSys_HadTauEstimation_data_formatted_NoChange.root", "RECREATE");
else
fout = TFile::Open("ARElog58_12.9ifb_UpdatedSysAndMuSys_HadTauEstimation_data_formatted_New.root", "RECREATE");

std::vector<TCanvas *> cc;
cc.push_back( adjustDisplayStyle (file, fout, adjust, "searchBin_nominal") );
cc.push_back( adjustDisplayStyle (file, fout, adjust, "searchBin_nominal_fullstatuncertainty") );
cc.push_back( adjustDisplayStyle (file, fout, adjust, "searchBin_StatUncertainties") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_closureUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_closureUncertainty_adhoc") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "searchBin_BMistag") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "searchBin_MuRecoSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "searchBin_MuIsoSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "searchBin_MuRecoIso") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "searchBin_JECSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "searchBin_MTSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "searchBin_AccSysPDF") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "searchBin_AccSysScale") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_MtEffStat") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_IsoTrkVetoEffUncertaintyStat") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_IsoTrkVetoEffUncertaintySys") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_AccStat") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "searchBin_AccSysPDF") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "searchBin_AccSysScale") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_MuFromTauStat") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_DileptonUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_TrigEffUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_closureUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_closureUncertainty_adhoc") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_StatUncertainties") );
cc.push_back( adjustUncertainties (file, fout, adjust, "searchBin_nominal_fullstatuncertainty") );

cc.push_back( adjustDisplayStyle (file, fout, adjust, "QCDBin_HiDphi_nominal") );
cc.push_back( adjustDisplayStyle (file, fout, adjust, "QCDBin_HiDphi_nominal_fullstatuncertainty") );
cc.push_back( adjustDisplayStyle (file, fout, adjust, "QCDBin_HiDphi_StatUncertainties") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_closureUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_closureUncertainty_adhoc") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_HiDphi_BMistag") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_HiDphi_MuRecoSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_HiDphi_MuIsoSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_HiDphi_MuRecoIso") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_HiDphi_JECSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_HiDphi_MTSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_HiDphi_AccSysPDF") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_HiDphi_AccSysScale") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_MtEffStat") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_IsoTrkVetoEffUncertaintyStat") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_IsoTrkVetoEffUncertaintySys") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_AccStat") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_HiDphi_AccSysPDF") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_HiDphi_AccSysScale") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_MuFromTauStat") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_DileptonUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_TrigEffUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_closureUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_closureUncertainty_adhoc") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_StatUncertainties") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_HiDphi_nominal_fullstatuncertainty") );

cc.push_back( adjustDisplayStyle (file, fout, adjust, "QCDBin_LowDphi_nominal") );
cc.push_back( adjustDisplayStyle (file, fout, adjust, "QCDBin_LowDphi_nominal_fullstatuncertainty") );
cc.push_back( adjustDisplayStyle (file, fout, adjust, "QCDBin_LowDphi_StatUncertainties") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_closureUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_closureUncertainty_adhoc") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_LowDphi_BMistag") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_LowDphi_MuRecoSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_LowDphi_MuIsoSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_LowDphi_MuRecoIso") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_LowDphi_JECSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_LowDphi_MTSys") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_LowDphi_AccSysPDF") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_LowDphi_AccSysScale") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_MtEffStat") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_IsoTrkVetoEffUncertaintyStat") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_IsoTrkVetoEffUncertaintySys") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_AccStat") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_LowDphi_AccSysPDF") );
cc.push_back( adjustUncertaintiesUpDn(file, fout, adjust, "QCDBin_LowDphi_AccSysScale") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_MuFromTauStat") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_DileptonUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_TrigEffUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_closureUncertainty") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_closureUncertainty_adhoc") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_StatUncertainties") );
cc.push_back( adjustUncertainties (file, fout, adjust, "QCDBin_LowDphi_nominal_fullstatuncertainty") );

std::cout << cc.size() << std::endl;

Expand All @@ -108,6 +116,42 @@ void adjustUncertainties(bool adjust=true) {

}

TCanvas* adjustDisplayStyle(TFile *file, TFile *fout, bool adjust, char *hname) {

std::cout << "Adjusting only the display style of " << hname << " : " << adjust << std::endl;

gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);

TH1D *h = (TH1D*) file->FindObjectAny(hname);

char cname[200];
sprintf(cname, "c_%s", hname);
TCanvas *c = new TCanvas(cname, cname, 900, 700);
h->Draw();

TLegend *leg = new TLegend(0.45, 0.8, 0.8, 0.88);

if(hname=="searchBin_StatUncertainties" || hname=="QCDBin_HiDphi_StatUncertainties" || hname=="QCDBin_LowDphi_StatUncertainties"){

}
else if(hname=="searchBin_nominal_fullstatuncertainty" || hname=="QCDBin_HiDphi_nominal_fullstatuncertainty" || hname=="QCDBin_LowDphi_nominal_fullstatuncertainty"){
c->SetLogy(1);
}

else if(hname=="searchBin_nominal" || hname=="QCDBin_HiDphi_nominal" || hname=="QCDBin_LowDphi_nominal"){
c->SetLogy(1);
}

leg->SetHeader(hname);
leg->SetLineColor(10);
leg->Draw("same");

fout->cd(); h->Write();
return c;

}

TCanvas* adjustUncertainties(TFile *file, TFile *fout, bool adjust, char *hname) {

std::cout << "Adjusting the bin contents of " << hname << " : " << adjust << std::endl;
Expand All @@ -121,6 +165,7 @@ TCanvas* adjustUncertainties(TFile *file, TFile *fout, bool adjust, char *hname)
char cname[200];
sprintf(cname, "c_%s", hname);
TCanvas *c = new TCanvas(cname, cname, 900, 700);
c->SetLogy(0);
h_up ->Draw();

TLegend *leg = new TLegend(0.45, 0.8, 0.8, 0.88);
Expand All @@ -131,8 +176,8 @@ TCanvas* adjustUncertainties(TFile *file, TFile *fout, bool adjust, char *hname)
for(int ibin=0; ibin<h_up->GetNbinsX(); ibin++) {
//if(h_up->GetBinContent(ibin)>1.05 || h_up->GetBinContent(ibin)<0.95)
//std::cout << hname << " up: ibin " << ibin << " unc " << h_up->GetBinContent(ibin) << std::endl;
if(h_up->GetBinContent(ibin)>1.05)
h_up->SetBinContent(ibin, 1.05);
if(h_up->GetBinContent(ibin)>1.07)
h_up->SetBinContent(ibin, 1.07);
}
}

Expand All @@ -159,6 +204,10 @@ TCanvas* adjustUncertainties(TFile *file, TFile *fout, bool adjust, char *hname)
else if(hname=="searchBin_nominal_fullstatuncertainty" || hname=="QCDBin_HiDphi_nominal_fullstatuncertainty" || hname=="QCDBin_LowDphi_nominal_fullstatuncertainty"){
h_up->GetYaxis()->SetRangeUser(0.01, 10000.0);
c->SetLogy(1);

} else if(hname=="searchBin_IsoTrkVetoEffUncertaintySys" || hname=="QCDBin_HiDphi_IsoTrkVetoEffUncertaintySys" || hname=="QCDBin_LowDphi_IsoTrkVetoEffUncertaintySys"){
h_up->GetYaxis()->SetRangeUser(0.7, 1.3);
c->SetLogy(1);
}

leg->SetHeader(hname);
Expand Down Expand Up @@ -188,6 +237,7 @@ TCanvas* adjustUncertaintiesUpDn(TFile *file, TFile *fout, bool adjust, char *hn
char cname[200];
sprintf(cname, "c_%s", hname);
TCanvas *c = new TCanvas(cname, cname, 900, 700);
c->SetLogy(0);
h_up ->Draw();
h_dn ->Draw("sames");

Expand All @@ -196,32 +246,56 @@ TCanvas* adjustUncertaintiesUpDn(TFile *file, TFile *fout, bool adjust, char *hn
h_dn->GetYaxis()->SetRangeUser(0.87, 1.12);
if(hname == "searchBin_BMistag" || hname == "QCDBin_HiDphi_BMistag" || hname == "QCDBin_LowDphi_BMistag") {
leg = new TLegend(0.45, 0.8, 0.8, 0.88);
h_up->GetYaxis()->SetRangeUser(0.87, 1.12);
h_dn->GetYaxis()->SetRangeUser(0.87, 1.12);
//h_up->GetYaxis()->SetRangeUser(0.87, 1.12);
//h_dn->GetYaxis()->SetRangeUser(0.87, 1.12);
h_up->GetYaxis()->SetRangeUser(0.5, 1.5);
h_dn->GetYaxis()->SetRangeUser(0.5, 1.5);

if(adjust) {
for(int ibin=0; ibin<h_up->GetNbinsX(); ibin++) {
//if(h_up->GetBinContent(ibin)>1.05 || h_up->GetBinContent(ibin)<0.95)
//std::cout << hname << " up: ibin " << ibin << " unc " << h_up->GetBinContent(ibin) << std::endl;
if(hname == "searchBin_BMistag" && (ibin==39 || ibin==80 || ibin==151) )
h_up->SetBinContent(ibin, 1.05);
else if(hname == "QCDBin_HiDphi_BMistag" && (ibin==42 || ibin==51 || ibin==104 || ibin==199) )
h_up->SetBinContent(ibin, 1.05);
else if(hname == "QCDBin_LowDphi_BMistag" && (ibin==51 || ibin==52 || ibin==186 || ibin==189 || ibin==199) )
h_up->SetBinContent(ibin, 1.10);
if(hname == "searchBin_BMistag" && (ibin==33 || ibin==151 || ibin==154) )
h_up->SetBinContent(ibin, 1.16);
else if(hname == "QCDBin_HiDphi_BMistag" && (ibin==45 || ibin==199 || ibin==202) )
h_up->SetBinContent(ibin, 1.14);
else if(hname == "QCDBin_LowDphi_BMistag" && (ibin==189 || ibin==199) )
h_up->SetBinContent(ibin, 1.27);
}
for(int ibin=0; ibin<h_dn->GetNbinsX(); ibin++) {
//if(h_dn->GetBinContent(ibin)>1.05 || h_dn->GetBinContent(ibin)<0.95)
//std::cout << hname << " dn: ibin " << ibin << " unc " << h_dn->GetBinContent(ibin) << std::endl;
if(hname == "searchBin_BMistag" && (ibin==39 || ibin==80 || ibin==151) )
h_dn->SetBinContent(ibin, 0.95);
else if(hname == "QCDBin_HiDphi_BMistag" && (ibin==42 || ibin==51 || ibin==104 || ibin==199) )
h_dn->SetBinContent(ibin, 0.95);
else if(hname == "QCDBin_LowDphi_BMistag" && (ibin==51 || ibin==52 || ibin==186 || ibin==189 || ibin==199) )
h_dn->SetBinContent(ibin, 0.9);
if(hname == "searchBin_BMistag" && (ibin==33 || ibin==151 || ibin==154) )
h_dn->SetBinContent(ibin, 0.84);
else if(hname == "QCDBin_HiDphi_BMistag" && (ibin==45 || ibin==199 || ibin==202) )
h_dn->SetBinContent(ibin, 0.86);
else if(hname == "QCDBin_LowDphi_BMistag" && (ibin==189 || ibin==199) )
h_dn->SetBinContent(ibin, 0.73);
}
}

} else if(hname == "searchBin_MuRecoSys" || hname == "searchBin_MuIsoSys" || hname == "searchBin_MuRecoIso") {
} else if(hname == "searchBin_MuRecoSys" || hname == "QCDBin_HiDphi_MuRecoSys" || hname == "QCDBin_LowDphi_MuRecoSys") {
// Uncertainty adjustment: 1% for muon tracking SF systematis, 1% for ICHEP dataset extension
leg = new TLegend(0.45, 0.8, 0.8, 0.88);
h_up->GetYaxis()->SetRangeUser(0.87, 1.12);
h_dn->GetYaxis()->SetRangeUser(0.87, 1.12);

if(adjust) {
double err_adjust;
for(int ibin=0; ibin<h_up->GetNbinsX(); ibin++) {
double err = h_up->GetBinContent(ibin+1);
err_adjust = (1-err)*(1-err) + 0.01*0.01 + 0.01*0.01;
h_up->SetBinContent(ibin+1,1-sqrt(err_adjust));
}
for(int ibin=0; ibin<h_dn->GetNbinsX(); ibin++) {
double err = h_dn->GetBinContent(ibin+1);
err_adjust = (err-1.)*(err-1.) + 0.01*0.01 + 0.01*0.01;
h_dn->SetBinContent(ibin+1,sqrt(err_adjust)+1.);
}
}


} else if(hname == "searchBin_MuIsoSys" || hname == "searchBin_MuRecoIso") {
leg = new TLegend(0.45, 0.8, 0.8, 0.88);
h_up->GetYaxis()->SetRangeUser(0.87, 1.12);
h_dn->GetYaxis()->SetRangeUser(0.87, 1.12);
Expand Down
16 changes: 10 additions & 6 deletions New_RA2b_2015/tauhad_template2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1643,18 +1643,22 @@ using namespace std;
if(StudyErrorPropag){

IdSFUp= 1.
+ utils2::GetSFUnc(hMuIDSF, muPt, muEta, true)
+ utils2::GetSFUnc(hMuTrkHighPtSF, muEta, false);
+ utils2::GetSFUnc(hMuIDSF, muPt, muEta, sqrt(0.01*0.01+0.01*0.01))
+ utils2::GetSFUnc(hMuTrkHighPtSF, muEta, 0.01);
IdSFDw= 1.
- utils2::GetSFUnc(hMuIDSF, muPt, muEta, true)
- utils2::GetSFUnc(hMuTrkHighPtSF, muEta, false);
- utils2::GetSFUnc(hMuIDSF, muPt, muEta, sqrt(0.01*0.01+0.01*0.01))
- utils2::GetSFUnc(hMuTrkHighPtSF, muEta, 0.01);

IsoSFUp= 1.
+ utils2::GetSFUnc(hMuIsoSF, muPt, muEta, true);
+ utils2::GetSFUnc(hMuIsoSF, muPt, muEta, 0.01);
IsoSFDw= 1.
- utils2::GetSFUnc(hMuIsoSF, muPt, muEta, true);
- utils2::GetSFUnc(hMuIsoSF, muPt, muEta, 0.01);

/*
std::cout << utils2::GetSFUnc(hMuTrkHighPtSF, muEta, true)
<< " "
<< utils2::GetSFUnc(hMuTrkHighPtSF, muEta, 0.01)
<< std::endl;
std::cout << utils2::GetSFUnc(hMuIDSF, muPt, muEta, true) << " "
<< utils2::GetSFUnc(hMuTrkHighPtSF, muEta, false) << " "
<< utils2::GetSFUnc(hMuIsoSF, muPt, muEta, true) << std::endl;
Expand Down
28 changes: 24 additions & 4 deletions New_RA2b_2015/utils2.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,30 @@ namespace utils2{
}


static double GetSFUnc(TH1 *hist, Double_t xVal, double fractionalSysUnc) {
// fractionalSysUnc: fractional systematic uncertainty

std::pair<double, double> SFandUnc = EvalSF(hist, xVal);

double SF = 0.;

SF = std::max(std::abs(1-SFandUnc.first), std::sqrt(SFandUnc.second*SFandUnc.second + fractionalSysUnc*SFandUnc.first*fractionalSysUnc*SFandUnc.first));

return SF;
}

static double GetSFUnc(TH2 *hist, Double_t xVal, Double_t yVal, double fractionalSysUnc) {
// fractionalSysUnc: fractional systematic uncertainty

std::pair<double, double> SFandUnc = EvalSF(hist, xVal, yVal);

double SF = 0.;

SF = std::max(std::abs(1-SFandUnc.first), std::sqrt(SFandUnc.second*SFandUnc.second + fractionalSysUnc*SFandUnc.first*fractionalSysUnc*SFandUnc.first));

return SF;
}

static double GetSFUnc(TH1 *hist, Double_t xVal, bool addSys) {
// addSys: for muons, 1% systematic has to be added to total uncertainty

Expand All @@ -587,8 +611,6 @@ namespace utils2{
return SF;
}



static double GetSFUnc(TH2 *hist, Double_t xVal, Double_t yVal, bool addSys) {
// addSys: for muons, 1% systematic has to be added to total uncertainty

Expand All @@ -599,8 +621,6 @@ namespace utils2{
if(addSys) SF = std::max(std::abs(1-SFandUnc.first), std::sqrt(SFandUnc.second*SFandUnc.second + 0.01*SFandUnc.first*0.01*SFandUnc.first));
else SF = std::max(std::abs(1-SFandUnc.first), SFandUnc.second);

//std::cout << std::abs(1-hist->GetBinContent(nxBin, nyBin)) << " " << std::sqrt(hist->GetBinError(nxBin, nyBin)*hist->GetBinError(nxBin, nyBin) + 0.01*hist->GetBinContent(nxBin, nyBin)*0.01*hist->GetBinContent(nxBin, nyBin)) << " " << hist->GetBinError(nxBin, nyBin)<<std::endl;

return SF;
}

Expand Down