644 |
|
} |
645 |
|
|
646 |
|
|
647 |
< |
void do_systematics_for_one_file(TTree *events,int Neventsinfile,string informalname, vector<vector<float> > &results,int flipped, string mcjzb,string datajzb,float peakerror,bool requireZ=false, string addcut="", bool ismSUGRA=false) { |
647 |
> |
void do_systematics_for_one_file(TTree *events,int Neventsinfile,string informalname, vector<vector<float> > &results,int flipped, string mcjzb,string datajzb,float peakerror,bool requireZ=false, string addcut="", bool isscan=false) { |
648 |
|
float JZBScaleUncert=0.05; |
649 |
|
mcjzbexpression=mcjzb; |
650 |
|
float triggereff=2.0/100;// in range [0,1] |
654 |
|
dout << "Lepton selection efficiency not implemented in this script yet, still using external one" << endl; |
655 |
|
|
656 |
|
int NPdfs=0; |
657 |
< |
if(ismSUGRA) NPdfs = get_npdfs(events); |
657 |
> |
if(isscan) NPdfs = get_npdfs(events); |
658 |
|
|
659 |
|
float mceff,mcefferr,jzbeff,jzbefferr; |
660 |
|
if(!automatized) dout << "MC efficiencies:" << endl; |
681 |
|
float resp,resperr; |
682 |
|
if(PlottingSetup::computeJZBresponse) { |
683 |
|
if(!automatized) dout << "JZB response: " << std::endl; |
684 |
< |
if(!ismSUGRA) JZBresponse(events,informalname,requireZ,resp,resperr,flipped,addcut); |
684 |
> |
if(!isscan) JZBresponse(events,informalname,requireZ,resp,resperr,flipped,addcut); |
685 |
|
} |
686 |
|
|
687 |
|
if(!automatized) dout << "Pileup: " << std::endl; |
690 |
|
|
691 |
|
float PDFuncert=0; |
692 |
|
if(!automatized) dout << "Assessing PDF uncertainty: " << std::endl; |
693 |
< |
if(ismSUGRA) PDFuncert = get_pdf_uncertainty(events, flipped, mcjzb, requireZ, Neventsinfile, NPdfs, addcut); |
693 |
> |
if(isscan) PDFuncert = get_pdf_uncertainty(events, flipped, mcjzb, requireZ, Neventsinfile, NPdfs, addcut); |
694 |
|
|
695 |
|
dout << "_______________________________________________" << endl; |
696 |
|
dout << " SUMMARY FOR " << informalname << " with JZB>" << jzbSel << " (all in %) "; |
703 |
|
dout << "JZB Scale Uncert: " << scaledown << " " << scaleup << endl; // in range [0,1] |
704 |
|
// dout << "Resolution : " << resolution << endl; // in range [0,1] |
705 |
|
dout << "From peak : " << sysfrompeak << endl; // in range [0,1] |
706 |
< |
if(ismSUGRA) dout << "PDF uncertainty : " << PDFuncert << endl; // in range [0,1] |
706 |
> |
if(isscan) dout << "PDF uncertainty : " << PDFuncert << endl; // in range [0,1] |
707 |
|
if(PlottingSetup::computeJZBefficiency) dout << "JZB efficiency: " << jzbeff << "+/-" << jzbefferr << " (not yet included below) " << endl; // in range [0,1] |
708 |
|
if(PlottingSetup::computeJZBresponse)dout << "JZB response : " << resp << " +/-" << resperr << " (not yet included below) " << endl; // in range [0,1] |
709 |
|
|
714 |
|
if(fabs(scaleup)>fabs(scaledown)) toterr+=(scaleup*scaleup); else toterr+=(scaledown*scaledown); |
715 |
|
// toterr+=(resolution*resolution); |
716 |
|
toterr+=(sysfrompeak*sysfrompeak); |
717 |
< |
if(ismSUGRA) toterr+=(PDFuncert*PDFuncert); |
717 |
> |
if(isscan) toterr+=(PDFuncert*PDFuncert); |
718 |
|
dout << "TOTAL SYSTEMATICS: " << TMath::Sqrt(toterr) << " --> " << TMath::Sqrt(toterr)*mceff << endl; |
719 |
|
float systerr=TMath::Sqrt(toterr)*mceff; |
720 |
|
toterr=TMath::Sqrt(toterr*mceff*mceff+mcefferr*mcefferr);//also includes stat err! |
736 |
|
res.push_back(0.0); |
737 |
|
res.push_back(mceff_nosigcont.getValue()); |
738 |
|
res.push_back(mceff_nosigcont.getError()); |
739 |
< |
if(ismSUGRA) res.push_back(PDFuncert); |
739 |
> |
if(isscan) res.push_back(PDFuncert); |
740 |
|
results.push_back(res); |
741 |
|
} |
742 |
|
|