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.20 by buchmann, Fri Aug 26 12:16:43 2011 UTC vs.
Revision 1.21 by buchmann, Mon Aug 29 06:30:21 2011 UTC

# Line 237 | Line 237 | void MCefficiency(TTree *events,float &r
237          TCut ksel2("pfJetGoodNum>2&&abs(mll-91.2)<20&&id1==id2&&"+TString(mcjzb)+ngeq_or_leq()+TString("-")+TString(jzbSelStr));
238          events->Draw(mcjzbexpression.c_str(),kbase&&ksel,"goff");
239          Float_t sel = events->GetSelectedRows();
240 <        events->Draw(mcjzbexpression.c_str(),kbase&&ksel2,"goff");
241 <        Float_t nsel = events->GetSelectedRows();
240 >        Float_t nsel=0;
241 >        if(ConsiderSignalContaminationForLimits) {
242 >          events->Draw(mcjzbexpression.c_str(),kbase&&ksel2,"goff");
243 >          nsel = events->GetSelectedRows();
244 >        }
245   //      events->Draw(mcjzbexpression.c_str(),kbase,"goff");
246   //      Float_t tot = events->GetSelectedRows();
247          Float_t tot = Neventsinfile;
248          
249 <        result=(sel-nsel)/tot;
250 <        resulterr=(1.0/tot)*TMath::Sqrt(sel+nsel+(sel-nsel)*(sel-nsel)/tot);
249 >        if(ConsiderSignalContaminationForLimits) {
250 >          result=(sel-nsel)/tot;
251 >          resulterr=(1.0/tot)*TMath::Sqrt(sel+nsel+(sel-nsel)*(sel-nsel)/tot);
252 >        } else {//no signal contamination considered:
253 >          result=(sel)/tot;
254 >          resulterr=TMath::Sqrt(sel/tot*(1+sel/tot)/tot);
255 >        }
256          if(!automatized) dout << "  MC efficiency: " << result << "+-" << resulterr << "  ( JZB>" << jzbSel << " : " << sel << " , JZB<-" << jzbSel << " : " << nsel << " and nevents=" << tot << ")" << std::endl;
257   }
258  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines