278 |
|
|
279 |
|
//____________________________________________________________________________________ |
280 |
|
// Total selection efficiency (MC) |
281 |
< |
void MCefficiency(TTree *events,float &result, float &resulterr,string mcjzb,bool requireZ,int Neventsinfile, string addcut="", int k = 0) { |
281 |
> |
//returns the efficiency WITHOUT signal contamination, and the result and resulterr contain the result and the corresponding error |
282 |
> |
Value MCefficiency(TTree *events,float &result, float &resulterr,string mcjzb,bool requireZ,int Neventsinfile, string addcut="", int k = 0) { |
283 |
|
|
284 |
|
char jzbSelStr[256]; sprintf(jzbSelStr,"%f",jzbSel); |
285 |
|
// All acceptance cuts at gen. level |
320 |
|
// Float_t tot = events->GetSelectedRows(); |
321 |
|
Float_t tot = Neventsinfile; |
322 |
|
|
323 |
+ |
Value result_wo_signalcont; |
324 |
+ |
|
325 |
|
if(ConsiderSignalContaminationForLimits) { |
326 |
|
result=(sel-nsel)/tot; |
327 |
|
resulterr=(1.0/tot)*TMath::Sqrt(sel+nsel+(sel-nsel)*(sel-nsel)/tot); |
328 |
+ |
result_wo_signalcont=Value(sel/tot,TMath::Sqrt(sel/tot*(1+sel/tot)/tot)); |
329 |
|
} else {//no signal contamination considered: |
330 |
|
result=(sel)/tot; |
331 |
|
resulterr=TMath::Sqrt(sel/tot*(1+sel/tot)/tot); |
332 |
+ |
result_wo_signalcont=Value(result,resulterr); |
333 |
|
} |
334 |
|
if(!automatized && k>0 ) dout << "PDF assessment: "; |
335 |
|
if(!automatized) dout << " MC efficiency: " << result << "+-" << resulterr << " ( JZB>" << jzbSel << " : " << sel << " , JZB<-" << jzbSel << " : " << nsel << " and nevents=" << tot << ") with normFact=" << normFactor << std::endl; |
420 |
|
Float_t eff = Interpolate(jzbSel,hist); |
421 |
|
Float_t effp = Interpolate(jzbSel*(1.+systematic),hist); |
422 |
|
Float_t effm = Interpolate(jzbSel*(1.-systematic),hist); |
423 |
< |
if(!automatized) dout << " efficiency at JZB==" << jzbSel*(1.+systematic) << "(-"<<syst*100<<"%) : " << effp << " (" << ((effp-eff)/eff)*100. << "%)" << std::endl; |
423 |
> |
if(!automatized) dout << " efficiency at JZB==" << jzbSel*(1.+systematic) << "(-"<<systematic*100<<"%) : " << effp << " (" << ((effp-eff)/eff)*100. << "%)" << std::endl; |
424 |
|
if(!automatized) dout << " efficiency at JZB==" << jzbSel << ": " << eff << std::endl; |
425 |
< |
if(!automatized) dout << " efficiency at JZB==" << jzbSel*(1.-systematic) << "(-"<<syst*100<<"%) : " << effm << " (" << ((effm-eff)/eff)*100. << "%)" << std::endl; |
425 |
> |
if(!automatized) dout << " efficiency at JZB==" << jzbSel*(1.-systematic) << "(-"<<systematic*100<<"%) : " << effm << " (" << ((effm-eff)/eff)*100. << "%)" << std::endl; |
426 |
|
up=((effp-eff)/eff); |
427 |
|
down=((effm-eff)/eff); |
428 |
|
} |