326 |
|
result=(sel)/tot; |
327 |
|
resulterr=TMath::Sqrt(sel/tot*(1+sel/tot)/tot); |
328 |
|
} |
329 |
+ |
if(!automatized && k>0 ) dout << "PDF assessment: "; |
330 |
|
if(!automatized) dout << " MC efficiency: " << result << "+-" << resulterr << " ( JZB>" << jzbSel << " : " << sel << " , JZB<-" << jzbSel << " : " << nsel << " and nevents=" << tot << ") with normFact=" << normFactor << std::endl; |
331 |
|
delete effh; |
332 |
|
} |
441 |
|
hJzbResp->SetMinimum(0.2); |
442 |
|
hJzbResp->Fit("pol0","Q"); |
443 |
|
TF1 *fittedfunction = hJzbResp->GetFunction("pol0"); |
444 |
< |
resp=fittedfunction->GetParameter(0); |
445 |
< |
resperr=fittedfunction->GetParError(0); |
446 |
< |
if(!automatized) dout << " Response: " << resp << " +/- " << resperr << endl; |
444 |
> |
if(!fittedfunction) { |
445 |
> |
// in case there are not enough points passing our selection |
446 |
> |
cout << "OOPS response function invalid, assuming 100% error !!!!" << endl; |
447 |
> |
resp=1; |
448 |
> |
resperr=1; |
449 |
> |
} else { |
450 |
> |
resp=fittedfunction->GetParameter(0); |
451 |
> |
resperr=fittedfunction->GetParError(0); |
452 |
> |
if(!automatized) dout << " Response: " << resp << " +/- " << resperr << endl; |
453 |
> |
} |
454 |
|
delete hJzbResp; |
455 |
|
} |
456 |
|
|
488 |
|
float triggereff=5.0/100;// in range [0,1] |
489 |
|
dout << "Trigger efficiency not implemented in this script yet, still using external one" << endl; |
490 |
|
float leptonseleff=2.0/100;// in range [0,1] |
491 |
+ |
leptonseleff=TMath::Sqrt(leptonseleff*leptonseleff+leptonseleff*leptonseleff); // because the 2% is per lepton |
492 |
|
dout << "Lepton selection efficiency not implemented in this script yet, still using external one" << endl; |
493 |
|
|
494 |
|
int NPdfs=0; |
497 |
|
float mceff,mcefferr,jzbeff,jzbefferr; |
498 |
|
if(!automatized) dout << "MC efficiencies:" << endl; |
499 |
|
MCefficiency(events,mceff,mcefferr,mcjzb,requireZ,Neventsinfile,addcut,-1); |
500 |
< |
JZBefficiency(events,informalname,jzbeff,jzbefferr,requireZ,addcut); |
500 |
> |
if(PlottingSetup::computeJZBefficiency) JZBefficiency(events,informalname,jzbeff,jzbefferr,requireZ,addcut); |
501 |
|
if(!automatized) dout << "JZB efficiency: " << jzbeff << "+/-" << jzbefferr << endl; |
502 |
|
|
503 |
|
if(!automatized) dout << "Error from Peak position:" << endl; |
514 |
|
|
515 |
|
if(!automatized) dout << "JZB response: " << std::endl; |
516 |
|
float resp,resperr; |
517 |
< |
JZBresponse(events,requireZ,resp,resperr,addcut); |
517 |
> |
if(PlottingSetup::computeJZBresponse) { |
518 |
> |
if(!automatized) dout << "JZB response: " << std::endl; |
519 |
> |
JZBresponse(events,requireZ,resp,resperr,addcut); |
520 |
> |
} |
521 |
|
|
522 |
|
if(!automatized) dout << "Pileup: " << std::endl; |
523 |
< |
float resolution=pileup(events,requireZ,informalname,addcut); |
523 |
> |
float resolution; |
524 |
> |
resolution=pileup(events,requireZ,informalname,addcut); |
525 |
|
|
526 |
|
float PDFuncert=0; |
527 |
+ |
if(!automatized) dout << "Assessing PDF uncertainty: " << std::endl; |
528 |
|
if(ismSUGRA) PDFuncert = get_pdf_uncertainty(events, mcjzb, requireZ, Neventsinfile, NPdfs, addcut); |
529 |
|
|
530 |
|
dout << "_______________________________________________" << endl; |
539 |
|
dout << "Resolution : " << resolution << endl; // in range [0,1] |
540 |
|
dout << "From peak : " << sysfrompeak << endl; // in range [0,1] |
541 |
|
if(ismSUGRA) dout << "PDF uncertainty : " << PDFuncert << endl; // in range [0,1] |
542 |
< |
dout << "JZB efficiency: " << jzbeff << "+/-" << jzbefferr << " (not yet included below) " << endl; // in range [0,1] |
543 |
< |
dout << "JZB response : " << resp << " +/-" << resperr << " (not yet included below) " << endl; // in range [0,1] |
542 |
> |
if(PlottingSetup::computeJZBefficiency) dout << "JZB efficiency: " << jzbeff << "+/-" << jzbefferr << " (not yet included below) " << endl; // in range [0,1] |
543 |
> |
if(PlottingSetup::computeJZBresponse)dout << "JZB response : " << resp << " +/-" << resperr << " (not yet included below) " << endl; // in range [0,1] |
544 |
|
|
545 |
|
float toterr=0; |
546 |
|
toterr+=(triggereff)*(triggereff); |