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

Comparing UserCode/cbrown/AnalysisFramework/Plotting/Modules/ResultModule.C (file contents):
Revision 1.18 by buchmann, Wed Nov 23 15:35:10 2011 UTC vs.
Revision 1.19 by buchmann, Thu Nov 24 08:17:14 2011 UTC

# Line 111 | Line 111 | void fill_result_histos(float &zossfp, f
111    fill_result_histos(zossfp, zossfperr,zosofp, zossfn, zosofn, sbossfp, sbosofp, sbossfn, sbosofn,datajzb,cut,cuthigh,mcordata,result,emptyvector,allsamples,addcut);
112   }
113  
114 < vector<float> get_result_between_two_fixed_jzb_values(float cut , float cuthigh, string mcjzb,string datajzb, int mcordata,float jzbpeakerrorMC, float jzbpeakerrorData, TCanvas *rescan, bool chatty=false, bool dopoisson=false, bool writeanything=true) {
114 > vector<float> get_result_between_two_fixed_jzb_values(int doquick, float cut , float cuthigh, string mcjzb,string datajzb, int mcordata,float jzbpeakerrorMC, float jzbpeakerrorData, TCanvas *rescan, bool chatty=false, bool dopoisson=false, bool writeanything=true) {
115   /*return vector of floats
116    [0] Bpred [1] Bpred uncert [2] Observed [3] Observed error
117    // if we use this for the ratio plot we don't want to see any of the results (hence writeanything=false)
# Line 257 | Line 257 | vector<float> get_result_between_two_fix
257      ftotprederr=TMath::Sqrt(ftotprederr);
258      flippedNprederr.push_back(ftotprederr);
259      
260 <    //also save results (for data only!) in the new Results Library class
261 <    int jzbcutindex=allresults.Find(cut);
262 <      
263 <    (allresults.predictions[jzbcutindex]).Zbkg.value=zossfn;
264 <    (allresults.predictions[jzbcutindex]).Zbkg.syserror=zossfn*zjetsestimateuncert;
265 <    (allresults.predictions[jzbcutindex]).Zbkg.staterror=TMath::Sqrt(zossfn);
266 <      
267 <    float ofsyserr=0;
268 <    if(PlottingSetup::RestrictToMassPeak) {
269 <      ofsyserr+= ((zosofn)*(zosofn))*(1.0/9)*emuncert*emuncert;//sys err from emu method
270 <      ofsyserr+= ((sbossfp)*(sbossfp)+(sbossfn)*(sbossfn))*(1.0/9)*eemmsidebanduncert*eemmsidebanduncert; // sys err from eemm sidebands
271 <      ofsyserr+= ((sbosofp)*(sbosofp)+(sbosofn)*(sbosofn))*(1.0/9)*emsidebanduncert*emsidebanduncert; // sys err from emu sidebands
272 <      
273 <      (allresults.predictions[jzbcutindex]).Flavorsym.value=(1.0/3)*(zosofp-zosofn)+ (1.0/3)*(sbossfp-sbossfn)+ (1.0/3)*(sbosofp-sbosofn);
274 <      (allresults.predictions[jzbcutindex]).Flavorsym.syserror=TMath::Sqrt(ofsyserr);
275 <      (allresults.predictions[jzbcutindex]).Flavorsym.staterror=TMath::Sqrt((1.0/9)*(zosofp+zosofn)+ (1.0/9)*(sbossfp+sbossfn)+ (1.0/9)*(sbosofp+sbosofn));
276 <    } else {
277 <      ofsyserr= ((zosofn)*(zosofn))*emuncert*emuncert;//sys err from emu method
278 <      
279 <      (allresults.predictions[jzbcutindex]).Flavorsym.value=(zosofp-zosofn);
280 <      (allresults.predictions[jzbcutindex]).Flavorsym.syserror=TMath::Sqrt(ofsyserr);
281 <      (allresults.predictions[jzbcutindex]).Flavorsym.staterror=TMath::Sqrt((zosofp+zosofn));
260 >    if(doquick<2) {//only for 2 we don't compute this
261 >        //also save results (for data only!) in the new Results Library class
262 >        int jzbcutindex=allresults.Find(cut);
263 >
264 >        (allresults.predictions[jzbcutindex]).Zbkg.value=zossfn;
265 >        (allresults.predictions[jzbcutindex]).Zbkg.syserror=zossfn*zjetsestimateuncert;
266 >        (allresults.predictions[jzbcutindex]).Zbkg.staterror=TMath::Sqrt(zossfn);
267 >        
268 >        if(PlottingSetup::RestrictToMassPeak) {
269 >          float ofsyserr= ((zosofp)*(zosofp) + (zosofn)*(zosofn))*(1.0/9)*emuncert*emuncert;//sys err from emu method
270 >          ofsyserr+= ((sbossfp)*(sbossfp)+(sbossfn)*(sbossfn))*(1.0/9)*eemmsidebanduncert*eemmsidebanduncert; // sys err from eemm sidebands
271 >          ofsyserr+= ((sbosofp)*(sbosofp)+(sbosofn)*(sbosofn))*(1.0/9)*emsidebanduncert*emsidebanduncert; // sys err from emu sidebands
272 >
273 >          (allresults.predictions[jzbcutindex]).Flavorsym.value=(1.0/3)*(zosofp-zosofn)+ (1.0/3)*(sbossfp-sbossfn)+ (1.0/3)*(sbosofp-sbosofn);
274 >          (allresults.predictions[jzbcutindex]).Flavorsym.syserror=TMath::Sqrt(ofsyserr);
275 >          (allresults.predictions[jzbcutindex]).Flavorsym.staterror=TMath::Sqrt((1.0/9)*(zosofp+zosofn)+ (1.0/9)*(sbossfp+sbossfn)+ (1.0/9)*(sbosofp+sbosofn));
276 >        } else {
277 >          (allresults.predictions[jzbcutindex]).Flavorsym.value=(zosofp-zosofn);
278 >          (allresults.predictions[jzbcutindex]).Flavorsym.syserror=(zosofn)*emuncert;
279 >          (allresults.predictions[jzbcutindex]).Flavorsym.staterror=TMath::Sqrt((zosofp+zosofn));
280 >        }
281 >
282 >        (allresults.predictions[jzbcutindex]).total.value=(allresults.predictions[jzbcutindex]).Zbkg.value+(allresults.predictions[jzbcutindex]).Flavorsym.value;
283 >        (allresults.predictions[jzbcutindex]).total.syserror=syserr;
284 >        (allresults.predictions[jzbcutindex]).total.staterror=staterr;
285 >
286 >        (allresults.predictions[jzbcutindex]).observed.ee=zossfpee;
287 >        (allresults.predictions[jzbcutindex]).observed.mm=zossfpmm;
288 >        (allresults.predictions[jzbcutindex]).observed.eemm=zossfp;
289 >
290      }
283    
284    (allresults.predictions[jzbcutindex]).total.value=(allresults.predictions[jzbcutindex]).Zbkg.value+(allresults.predictions[jzbcutindex]).Flavorsym.value;
285    (allresults.predictions[jzbcutindex]).total.syserror=syserr;
286    (allresults.predictions[jzbcutindex]).total.staterror=staterr;
287    
288    (allresults.predictions[jzbcutindex]).observed.ee=zossfpee;
289    (allresults.predictions[jzbcutindex]).observed.mm=zossfpmm;
290    (allresults.predictions[jzbcutindex]).observed.eemm=zossfp;
291    
292    vector<float> sigmas = compute_one_upper_limit(1.0,0.0, Npred.size()-1, mcjzb, "UPPERLIMIT", false, 0);
293    
294    (allresults.predictions[jzbcutindex]).UpperLimit=sigmas[0];
291    }
292  
293    vector<float> resultvector; // only used for poisson computation in experimental module (therefore ignoring flipped business)
# Line 305 | Line 301 | vector<float> get_result_between_two_fix
301    return resultvector;
302   }
303  
304 < void get_result_above_one_fixed_jzb_value(float cut ,string mcjzb,string datajzb, int mcordata,float jzbpeakerrorMC, float jzbpeakerrorData, TCanvas *rescan, bool chatty=false, bool dopoisson=false) {
305 <  get_result_between_two_fixed_jzb_values(cut ,15000, mcjzb,datajzb, mcordata,jzbpeakerrorMC, jzbpeakerrorData, rescan, chatty, dopoisson);
304 > void get_result_above_one_fixed_jzb_value(int doquick, float cut ,string mcjzb,string datajzb, int mcordata,float jzbpeakerrorMC, float jzbpeakerrorData, TCanvas *rescan, bool chatty=false, bool dopoisson=false) {
305 >  get_result_between_two_fixed_jzb_values(doquick, cut ,15000, mcjzb,datajzb, mcordata,jzbpeakerrorMC, jzbpeakerrorData, rescan, chatty, dopoisson);
306   }
307  
308    
309 < void get_result(string mcjzb, string datajzb, float jzbpeakerrordata, float jzbpeakerrormc, vector<float> jzbcuts, bool chatty=false, bool dopoisson=false,bool doquick=false) {
309 > void get_result(string mcjzb, string datajzb, float jzbpeakerrordata, float jzbpeakerrormc, vector<float> jzbcuts, bool chatty=false, bool dopoisson=false,int doquick=0) {
310    TCanvas *rescan = new TCanvas("rescan","Result Canvas");
311     for(int icut=0;icut<jzbcuts.size();icut++) {
312 <     get_result_above_one_fixed_jzb_value(jzbcuts[icut],mcjzb,datajzb,data,jzbpeakerrormc,jzbpeakerrordata,rescan,chatty,dopoisson);
313 <     if(!doquick) {
314 <       get_result_above_one_fixed_jzb_value(jzbcuts[icut],mcjzb,datajzb,mc,jzbpeakerrormc,jzbpeakerrordata,rescan,chatty,dopoisson);
315 <       get_result_above_one_fixed_jzb_value(jzbcuts[icut],mcjzb,datajzb,mcwithsignal,jzbpeakerrormc,jzbpeakerrordata,rescan,chatty,dopoisson);
312 >     get_result_above_one_fixed_jzb_value(doquick,jzbcuts[icut],mcjzb,datajzb,data,jzbpeakerrormc,jzbpeakerrordata,rescan,chatty,dopoisson);
313 >     if(doquick==0) {
314 >       get_result_above_one_fixed_jzb_value(doquick,jzbcuts[icut],mcjzb,datajzb,mc,jzbpeakerrormc,jzbpeakerrordata,rescan,chatty,dopoisson);
315 >       get_result_above_one_fixed_jzb_value(doquick,jzbcuts[icut],mcjzb,datajzb,mcwithsignal,jzbpeakerrormc,jzbpeakerrordata,rescan,chatty,dopoisson);
316       }
317     }
318    delete rescan;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines