ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/Modules/Systematics.C
(Generate patch)

Comparing UserCode/cbrown/AnalysisFramework/Plotting/Modules/Systematics.C (file contents):
Revision 1.32 by buchmann, Tue Sep 20 12:17:24 2011 UTC vs.
Revision 1.33 by buchmann, Mon Sep 26 15:09:41 2011 UTC

# Line 278 | Line 278 | void PeakError(TTree *events,float &resu
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
# Line 319 | Line 320 | void MCefficiency(TTree *events,float &r
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;
# Line 415 | Line 420 | void doJZBscale(TTree *events, float &do
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines