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.33 by buchmann, Mon Sep 26 15:09:41 2011 UTC vs.
Revision 1.38 by buchmann, Wed Sep 28 16:00:49 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 +        
289          char jzbSelStr[256]; sprintf(jzbSelStr,"%f",jzbSel);
290          // All acceptance cuts at gen. level
291          //TCut kbase("abs(genMll-91.2)<20&&genNjets>2&&genZPt>0&&genJZB"+geq_or_leq()+TString(jzbSelStr)+"&&genId1==-genId2");
# Line 334 | Line 339 | Value MCefficiency(TTree *events,float &
339          if(!automatized && k>0 ) dout << "PDF assessment: ";
340          if(!automatized) dout << "  MC efficiency: " << result << "+-" << resulterr << "  ( JZB>" << jzbSel << " : " << sel << " , JZB<-" << jzbSel << " : " << nsel << " and nevents=" << tot << ") with normFact=" << normFactor << std::endl;
341          delete effh;
342 +        return result_wo_signalcont;
343   }
344  
345  
# Line 501 | Line 507 | void do_systematics_for_one_file(TTree *
507    
508    float mceff,mcefferr,jzbeff,jzbefferr;
509    if(!automatized) dout << "MC efficiencies:" << endl;
510 <  MCefficiency(events,mceff,mcefferr,mcjzb,requireZ,Neventsinfile,addcut,-1);
510 >  Value mceff_nosigcont = MCefficiency(events,mceff,mcefferr,mcjzb,requireZ,Neventsinfile,addcut,-1);
511 >  if(!automatized) cout << "   Without signal contamination, we find an efficiency of " << mceff_nosigcont << endl;
512 >
513    if(PlottingSetup::computeJZBefficiency) JZBefficiency(events,informalname,jzbeff,jzbefferr,requireZ,addcut);
514    if(!automatized) dout << "JZB efficiency: " << jzbeff << "+/-" << jzbefferr << endl;
515    
# Line 561 | Line 569 | void do_systematics_for_one_file(TTree *
569    
570    dout << "FINAL RESULT : " << 100*mceff << " +/- "<< 100*mcefferr << " (stat) +/- " << 100*systerr << " (syst)   %" << endl;
571    dout << "     we thus use the sqrt of the sum of the squares of the stat & syst err, which is : " << 100*toterr << endl;
572 +  dout << "_______________________________________________" << endl;
573    
574    //Do not modify the lines below or mess with the order; this order is expected by all limit calculating functions!
575    vector<float> res;
# Line 572 | Line 581 | void do_systematics_for_one_file(TTree *
581    if(fabs(jesup)>fabs(jesdown)) res.push_back(fabs(jesup)); else res.push_back(fabs(jesdown));
582    if(fabs(scaleup)>fabs(scaledown)) res.push_back(fabs(scaleup)); else res.push_back(fabs(scaledown));
583    res.push_back(fabs(resolution));
584 +  res.push_back(mceff_nosigcont.getValue());
585 +  res.push_back(mceff_nosigcont.getError());
586    if(ismSUGRA) res.push_back(PDFuncert);
587    results.push_back(res);
588   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines