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.38 by buchmann, Wed Sep 28 16:00:49 2011 UTC vs.
Revision 1.39 by buchmann, Thu Sep 29 07:34:20 2011 UTC

# Line 281 | Line 281 | void PeakError(TTree *events,float &resu
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        if(!events) {
285          write_error(__FUNCTION__,"Tree passed for efficiency calculation is invalid!");
286          return Value(0,0);
287        }
288        
284          char jzbSelStr[256]; sprintf(jzbSelStr,"%f",jzbSel);
285          // All acceptance cuts at gen. level
286          //TCut kbase("abs(genMll-91.2)<20&&genNjets>2&&genZPt>0&&genJZB"+geq_or_leq()+TString(jzbSelStr)+"&&genId1==-genId2");
# Line 336 | Line 331 | Value MCefficiency(TTree *events,float &
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: ";
334 >        if(!automatized && k>0 ) dout << "PDF assessment (" << k << ") : ";
335          if(!automatized) dout << "  MC efficiency: " << result << "+-" << resulterr << "  ( JZB>" << jzbSel << " : " << sel << " , JZB<-" << jzbSel << " : " << nsel << " and nevents=" << tot << ") with normFact=" << normFactor << std::endl;
336          delete effh;
337          return result_wo_signalcont;
# Line 513 | Line 508 | void do_systematics_for_one_file(TTree *
508    if(PlottingSetup::computeJZBefficiency) JZBefficiency(events,informalname,jzbeff,jzbefferr,requireZ,addcut);
509    if(!automatized) dout << "JZB efficiency: " << jzbeff << "+/-" << jzbefferr << endl;
510    
511 +
512 +  if(!(mceff>0)) write_warning(__FUNCTION__,"Efficiency is zero - the systematics will not be computed!");
513 +
514 +
515    if(!automatized) dout << "Error from Peak position:" << endl;
516    float sysfrompeak=0;
517 <  PeakError(events,sysfrompeak,mcjzb,peakerror,addcut);
517 >  if(mceff>0) PeakError(events,sysfrompeak,mcjzb,peakerror,addcut);
518 >  else dout << "Not computed." << endl;
519      
520    if(!automatized) dout << "Jet energy scale: " << std::endl;
521 <  float jesup,jesdown;
522 <  JZBjetScale(events,jesdown,jesup,informalname,requireZ,addcut,JetEnergyScaleUncert);
521 >  float jesup=0,jesdown=0;
522 >  if(mceff>0) JZBjetScale(events,jesdown,jesup,informalname,requireZ,addcut,JetEnergyScaleUncert);
523 >  else dout << "Not computed." << endl;
524    
525    if(!automatized) dout << "JZB scale: " << std::endl;
526 <  float scaleup,scaledown,scalesyst;
527 <  doJZBscale(events,scaledown,scaleup,scalesyst,JZBScaleUncert,informalname,requireZ,addcut);
526 >  float scaleup=0,scaledown=0,scalesyst=0;
527 >  if(mceff>0) doJZBscale(events,scaledown,scaleup,scalesyst,JZBScaleUncert,informalname,requireZ,addcut);
528 >  else dout << "Not computed." << endl;
529    
530    if(!automatized) dout << "JZB response: " << std::endl;
531 <  float resp,resperr;
532 <  if(PlottingSetup::computeJZBresponse) {
531 >  float resp=0,resperr=0;
532 >  if(PlottingSetup::computeJZBresponse && mceff>0) {
533          if(!automatized) dout << "JZB response: " << std::endl;
534          JZBresponse(events,requireZ,resp,resperr,addcut);
535    }
536  
537    if(!automatized) dout << "Pileup: " << std::endl;
538 <  float resolution;
539 <  resolution=pileup(events,requireZ,informalname,addcut);
538 >  float resolution=0;
539 >  if(mceff>0) resolution=pileup(events,requireZ,informalname,addcut);
540 >  else dout << "Not computed." << endl;
541  
542    float PDFuncert=0;
543 <  if(!automatized) dout << "Assessing PDF uncertainty: " << std::endl;
544 <  if(ismSUGRA) PDFuncert = get_pdf_uncertainty(events, mcjzb, requireZ, Neventsinfile, NPdfs, addcut);
543 >  if(!automatized&&mceff>0) dout << "Assessing PDF uncertainty: " << std::endl;
544 >  if(ismSUGRA&&mceff>0) PDFuncert = get_pdf_uncertainty(events, mcjzb, requireZ, Neventsinfile, NPdfs, addcut);
545  
546    dout << "_______________________________________________" << endl;
547    dout << "                 SUMMARY FOR " << informalname << " with JZB>" << jzbSel << "  (all in %) ";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines