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.31 by buchmann, Wed Sep 7 13:30:58 2011 UTC vs.
Revision 1.32 by buchmann, Tue Sep 20 12:17:24 2011 UTC

# Line 326 | Line 326 | void MCefficiency(TTree *events,float &r
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   }
# Line 440 | Line 441 | void JZBresponse(TTree *events, bool req
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  
# Line 480 | Line 488 | void do_systematics_for_one_file(TTree *
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;
# Line 488 | Line 497 | void do_systematics_for_one_file(TTree *
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;
# Line 505 | Line 514 | void do_systematics_for_one_file(TTree *
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;
# Line 525 | Line 539 | void do_systematics_for_one_file(TTree *
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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines