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

Comparing UserCode/cbrown/Development/Plotting/Modules/Plotting_Functions.C (file contents):
Revision 1.64 by buchmann, Thu Sep 13 07:35:15 2012 UTC vs.
Revision 1.65 by buchmann, Thu Sep 13 09:44:16 2012 UTC

# Line 744 | Line 744 | void make_JES_plot(TCut cut, string name
744  
745   void do_kinematic_plots(string mcjzb, string datajzb, bool doPF=false)
746   {
747 +  switch_overunderflow(true);
748    bool dolog=true;
749    bool nolog=false;
750  
# Line 895 | Line 896 | void do_kinematic_plots(string mcjzb, st
896   //   make_JES_plot(cutmass&&cutOSSF&&basiccut,"_ossf");
897   //   make_JES_plot(cutmass&&cutOSOF&&basiccut,"_osof");
898  
899 +  switch_overunderflow(false);
900   }
901  
902   void make_comp_plot( string var, string xlabel, string filename, float jzbcut, string mcjzb, string datajzb,
# Line 964 | Line 966 | void region_comparison_plots(string mcjz
966  
967   //  switch_overunderflow(true);  // switching overflow/underflow bins on
968      
969 <  
969 >  switch_overunderflow(true);
970      flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- the arguments changed
971    for(int ijzb=0;ijzb<(int)jzb_cuts.size();ijzb++) {
972      float jzbcut=jzb_cuts[ijzb]; // Comparison plots are done for this JZB cut
# Line 1281 | Line 1283 | if you want to start from scratch (witho
1283  
1284   void do_prediction_plot(string jzb, TCanvas *globalcanvas, float high, int use_data, bool overlay_signal = false,string subdir="" )
1285   {
1286 < //  switch_overunderflow(true);
1286 >  
1287    bool is_data=false;
1288    bool use_signal=false;
1289    if(use_data==1) is_data=true;
1290    if(use_data==2) use_signal=true;
1291 <  int nbins=50;//100;
1292 <  if(is_data) nbins=50;
1291 >  int nbins=int(high/10);//100;
1292 >  if(is_data) nbins=int(high/10);
1293    float low=0;
1294 <  float hi=500;
1294 >  float hi=high;
1295 >  
1296 >  stringstream cutpositiveS;
1297 >  cutpositiveS << "(" << jzb << ">0)";
1298 >  TCut cutpositive(cutpositiveS.str().c_str());
1299 >  stringstream cutnegativeS;
1300 >  cutnegativeS << "(" << jzb << "<0)";
1301 >  TCut cutnegative(cutnegativeS.str().c_str());
1302 >  
1303    
1304    TH1F *blankback = new TH1F("blankback","blankback",int(high/10),0,high);
1305 <  TH1F *RcorrJZBeemm   = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1306 <  TH1F *LcorrJZBeemm   = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1307 <  TH1F *RcorrJZBem     = allsamples.Draw("RcorrJZBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1308 <  TH1F *LcorrJZBem     = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1305 >  TH1F *RcorrJZBeemm   = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1306 >  TH1F *LcorrJZBeemm   = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutnegative&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1307 >  TH1F *RcorrJZBem     = allsamples.Draw("RcorrJZBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1308 >  TH1F *LcorrJZBem     = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutnegative&&cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1309  
1310    blankback->GetXaxis()->SetTitle(RcorrJZBeemm->GetXaxis()->GetTitle());
1311    blankback->GetYaxis()->SetTitle(RcorrJZBeemm->GetYaxis()->GetTitle());
# Line 1310 | Line 1320 | void do_prediction_plot(string jzb, TCan
1320    
1321    TH1F *RcorrJZBeemmNoS;
1322  
1323 <    //these are for the ratio
1324 <  
1325 <  TH1F *JRcorrJZBeemm   = allsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1326 <  TH1F *JLcorrJZBeemm   = allsamples.Draw("JLcorrJZBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1327 <  TH1F *JRcorrJZBem     = allsamples.Draw("JRcorrJZBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1318 <  TH1F *JLcorrJZBem     = allsamples.Draw("JLcorrJZBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1323 >  //these are for the ratio
1324 >  TH1F *JRcorrJZBeemm   = allsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1325 >  TH1F *JLcorrJZBeemm   = allsamples.Draw("JLcorrJZBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutnegative&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1326 >  TH1F *JRcorrJZBem     = allsamples.Draw("JRcorrJZBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1327 >  TH1F *JLcorrJZBem     = allsamples.Draw("JLcorrJZBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutnegative&&cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1328    
1329    TH1F *JRcorrJZBSBem;
1330    TH1F *JLcorrJZBSBem;
1331    TH1F *JRcorrJZBSBeemm;
1332    TH1F *JLcorrJZBSBeemm;
1333    
1334 <  if(use_data==2 || overlay_signal) RcorrJZBeemmNoS = allsamples.Draw("RcorrJZBeemmNoS",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,false);
1334 >  if(use_data==2 || overlay_signal) RcorrJZBeemmNoS = allsamples.Draw("RcorrJZBeemmNoS",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,false);
1335  
1336    
1337    if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) {
1338 <    RcorrJZBSBem   = allsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1339 <    LcorrJZBSBem   = allsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1340 <    RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1341 <    LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1338 >    RcorrJZBSBem   = allsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1339 >    LcorrJZBSBem   = allsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutnegative&&sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1340 >    RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1341 >    LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutnegative&&sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1342      
1343      //these are for the ratio
1344 <    JRcorrJZBSBem   = allsamples.Draw("JRcorrJZBSBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1345 <    JLcorrJZBSBem   = allsamples.Draw("JLcorrJZBSBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1346 <    JRcorrJZBSBeemm = allsamples.Draw("JRcorrJZBSBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1347 <    JLcorrJZBSBeemm = allsamples.Draw("JLcorrJZBSBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1344 >    JRcorrJZBSBem   = allsamples.Draw("JRcorrJZBSBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutpositive&&sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1345 >    JLcorrJZBSBem   = allsamples.Draw("JLcorrJZBSBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutnegative&&sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
1346 >    JRcorrJZBSBeemm = allsamples.Draw("JRcorrJZBSBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutpositive&&sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1347 >    JLcorrJZBSBeemm = allsamples.Draw("JLcorrJZBSBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutnegative&&sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
1348    }
1349    
1350    TH1F *lm4RcorrJZBeemm;
1351 <  if(overlay_signal || use_data == 2 || use_data == 1) lm4RcorrJZBeemm = allsamples.Draw("lm4RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,allsamples.FindSample("LM"));
1351 >  if(overlay_signal || use_data == 2 || use_data == 1) lm4RcorrJZBeemm = allsamples.Draw("lm4RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,allsamples.FindSample("LM"));
1352    
1353    flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- prediction changed.
1354    
# Line 1403 | Line 1412 | void do_prediction_plot(string jzb, TCan
1412    SQRT(BpredSys);
1413    BpredSys->Divide(JBpred);
1414  
1406  
1415    flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- prediction changed
1416    TH1F *Tpred = (TH1F*)RcorrJZBem->Clone("Bpred");
1417    Tpred->Add(LcorrJZBem,-1.0);
# Line 1471 | Line 1479 | void do_prediction_plot(string jzb, TCan
1479      Bpred->SetLineWidth(2);
1480      predcomppad->cd();
1481      predcomppad->SetLogy(1);
1474    
1482      TH1F *jzbnegative = (TH1F*)LcorrJZBeemm->Clone("jzbnegative");
1483      TH1F *sidebandsemu = (TH1F*)Bpred->Clone("sidebandsemu");
1484      sidebandsemu->Add(jzbnegative,-1);
# Line 1590 | Line 1597 | void do_prediction_plot(string jzb, TCan
1597    //save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,Bpredsaveas,true,use_data!=1,ytitle);
1598    save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,subdir+Bpredsaveas,true,false,ytitle,BpredSys);//not extending the y range anymore up to 4
1599  
1600 +
1601    
1602    flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1603    // The part below is meaningless for the offpeak analysis (it's a comparison of the different estimates but there is but one estimate!)
# Line 1684 | Line 1692 | void do_prediction_plot(string jzb, TCan
1692      delete JLcorrJZBSBeemm;
1693    }
1694    if(overlay_signal || use_data==2) delete lm4RcorrJZBeemm;
1687  switch_overunderflow(false);
1695   }
1696  
1697   void do_prediction_plots(string mcjzb, string datajzb, float DataSigma, float MCSigma, bool overlay_signal ) {
1698 +  switch_overunderflow(true);
1699    TCanvas *globalcanvas = new TCanvas("globalcanvas","Prediction Canvas");
1700    do_prediction_plot(datajzb,globalcanvas,jzbHigh ,data,overlay_signal);
1701    if ( !PlottingSetup::Approved ) {
# Line 1696 | Line 1704 | void do_prediction_plots(string mcjzb, s
1704    } else {
1705      write_info(__FUNCTION__,"You set approved to true, therefore not producing prediction/observation plots for MC with and without signal.");
1706    }
1707 < }
1708 <
1701 < void do_ratio_plot(int is_data,vector<float> binning, string jzb, TCanvas *can, float high=-9999) {
1702 <  bool do_data=0;
1703 <  bool dosignal=0;
1704 <  if(is_data==1) do_data=1;
1705 <  if(is_data==2) dosignal=1;
1706 <  TH1F *RcorrJZBeemm   = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,do_data, luminosity,dosignal);
1707 <  TH1F *LcorrJZBeemm   = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,do_data, luminosity,dosignal);
1708 <  TH1F *RcorrJZBem     = allsamples.Draw("RcorrJZBem",jzb.c_str(),binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,do_data, luminosity,dosignal);
1709 <  TH1F *LcorrJZBem     = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,do_data, luminosity,dosignal);
1710 <  
1711 <  TH1F *RcorrJZBSBem;
1712 <  TH1F *LcorrJZBSBem;
1713 <  TH1F *RcorrJZBSBeemm;
1714 <  TH1F *LcorrJZBSbeemm;
1715 <  
1716 <  if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) {
1717 <    RcorrJZBSBem   = allsamples.Draw("RcorrJZBSbem",jzb.c_str(),binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,do_data, luminosity,dosignal);
1718 <    LcorrJZBSBem   = allsamples.Draw("LcorrJZBSbem",("-"+jzb).c_str(),binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,do_data, luminosity,dosignal);
1719 <    RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSbeemm",jzb.c_str(),binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,do_data, luminosity,dosignal);
1720 <    LcorrJZBSbeemm = allsamples.Draw("LcorrJZBSbeemm",("-"+jzb).c_str(),binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,do_data, luminosity,dosignal);
1721 <  }
1722 <  
1723 <
1724 <
1725 <
1726 <  flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1727 <  TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred");
1728 <  if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) {
1729 <    Bpred->Add(RcorrJZBem,1.0/3);
1730 <    Bpred->Add(LcorrJZBem,-1.0/3);
1731 <    Bpred->Add(RcorrJZBSBem,1.0/3);
1732 <    Bpred->Add(LcorrJZBSBem,-1.0/3);
1733 <    Bpred->Add(RcorrJZBSBeemm,1.0/3);
1734 <    Bpred->Add(LcorrJZBSbeemm,-1.0/3);
1735 <  } else {
1736 <    Bpred->Add(RcorrJZBem,1.0);
1737 <    Bpred->Add(LcorrJZBem,-1.0);
1738 <  }
1739 <
1740 <  can->cd();
1741 <  can->SetLogy(0);
1742 <  Bpred->SetLineColor(kRed);
1743 <  Bpred->SetStats(0);
1744 <  if(high>0) Bpred->GetXaxis()->SetRangeUser(0,high);
1745 <  TH1F *JZBratioforfitting=(TH1F*)RcorrJZBeemm->Clone("JZBratioforfitting");
1746 <  JZBratioforfitting->Divide(Bpred);
1747 <  TGraphAsymmErrors *JZBratio = histRatio(RcorrJZBeemm,Bpred,is_data,binning,false);
1748 <  
1749 <  
1750 <  JZBratio->SetTitle("");
1751 <  JZBratio->GetYaxis()->SetRangeUser(0.0,9.0);
1752 < //  if(is_data==1) JZBratio->GetXaxis()->SetRangeUser(0,jzbHigh );
1753 <  
1754 <  TF1 *pol0 = new TF1("pol0","[0]",0,1000);
1755 <  TF1 *pol0d = new TF1("pol0","[0]",0,1000);
1756 < //  straightline_fit->SetParameter(0,1);
1757 <  JZBratioforfitting->Fit(pol0,"Q0R","",0,30);
1758 <  pol0d->SetParameter(0,pol0->GetParameter(0));
1759 <  
1760 <  JZBratio->GetYaxis()->SetTitle("Observed/Predicted");
1761 <  JZBratio->GetXaxis()->SetTitle("JZB [GeV]");
1762 <  if ( high>0 ) JZBratio->GetXaxis()->SetRangeUser(0.0,high);
1763 <  JZBratio->GetYaxis()->SetNdivisions(519);
1764 <  JZBratio->GetYaxis()->SetRangeUser(0.0,4.0);
1765 <  JZBratio->GetYaxis()->CenterTitle();
1766 <  JZBratio->GetXaxis()->CenterTitle();
1767 <  JZBratio->SetMarkerSize(DataMarkerSize);
1768 <  JZBratio->Draw("AP");
1769 <  /////----------------------------
1770 <  TPaveText *writeresult = new TPaveText(0.15,0.78,0.49,0.91,"blNDC");
1771 <  writeresult->SetFillStyle(4000);
1772 <  writeresult->SetFillColor(kWhite);
1773 <  writeresult->SetTextFont(42);
1774 <  writeresult->SetTextSize(0.03);
1775 <  writeresult->SetTextAlign(12);
1776 <  ostringstream jzb_agreement_data_text;
1777 <  jzb_agreement_data_text<< setprecision(2) << "mean =" << pol0->GetParameter(0) << " #pm " << setprecision(1) <<  pol0->GetParError(0);
1778 <  if(is_data==1) fitresultconstdata=pol0->GetParameter(0);// data
1779 <  if(is_data==0) fitresultconstmc=pol0->GetParameter(0); // monte carlo, no signal
1780 < /*  if(is_data) writeresult->AddText("Data closure test");
1781 <  else writeresult->AddText("MC closure test");
1782 <  */
1783 <  writeresult->AddText(jzb_agreement_data_text.str().c_str());
1784 < //  writeresult->Draw("same");
1785 < //  pol0d->Draw("same");
1786 <  TF1 *topline =  new TF1("","1.5",0,1000);
1787 <  TF1 *bottomline =  new TF1("","0.5",0,1000);
1788 <  topline->SetLineColor(kBlue);
1789 <  topline->SetLineStyle(2);
1790 <  bottomline->SetLineColor(kBlue);
1791 <  bottomline->SetLineStyle(2);
1792 < //  topline->Draw("same");
1793 < //  bottomline->Draw("same");
1794 <  TF1 *oneline = new TF1("","1.0",0,1000);
1795 <  oneline->SetLineColor(kBlue);
1796 <  oneline->SetLineStyle(1);
1797 <  oneline->Draw("same");
1798 <  TLegend *phony_leg = make_legend("ratio",0.6,0.55,false);//this line is just to have the default CMS Preliminary (...) on the canvas as well.
1799 <  if(is_data==1) DrawPrelim();
1800 <  else DrawMCPrelim();
1801 <  TLegend *leg = new TLegend(0.55,0.75,0.89,0.89);
1802 <  leg->SetTextFont(42);
1803 <  leg->SetTextSize(0.04);
1804 < //   if(is_data==1) leg->SetHeader("Ratio (data)");
1805 < //   else leg->SetHeader("Ratio (MC)");
1806 <
1807 <  TString MCtitle("MC ");
1808 <  if (is_data==1) MCtitle = "";
1809 <
1810 <  leg->SetFillStyle(4000);
1811 <  leg->SetFillColor(kWhite);
1812 <  leg->SetTextFont(42);
1813 < //  leg->AddEntry(topline,"+20\% sys envelope","l");
1814 <  leg->AddEntry(JZBratio,MCtitle+"obs / "+MCtitle+"pred","p");
1815 <  leg->AddEntry(oneline,"ratio = 1","l");
1816 < //  leg->AddEntry(pol0d,"fit in [0,30] GeV","l");
1817 < //  leg->AddEntry(bottomline,"#pm50% envelope","l");
1818 <
1819 <
1820 <  //leg->Draw("same"); // no longer drawing legend
1821 <
1822 <  if(is_data==1) CompleteSave(can, "jzb_ratio_data");
1823 <  if(is_data==0) CompleteSave(can, "jzb_ratio_mc");
1824 <  if(is_data==2) CompleteSave(can, "jzb_ratio_mc_BandS");//special case, MC with signal!
1825 <  
1826 <  delete RcorrJZBeemm;
1827 <  delete LcorrJZBeemm;
1828 <  delete RcorrJZBem;
1829 <  delete LcorrJZBem;
1830 <  
1831 <  delete RcorrJZBSBem;
1832 <  delete LcorrJZBSBem;
1833 <  delete RcorrJZBSBeemm;
1834 <  delete LcorrJZBSbeemm;
1835 < }
1836 <
1837 < void do_ratio_plots(string mcjzb,string datajzb,vector<float> ratio_binning) {
1838 <  TCanvas *globalc = new TCanvas("globalc","Ratio Plot Canvas");
1839 <  globalc->SetLogy(0);
1840 <  
1841 <  do_ratio_plot(mc,ratio_binning,mcjzb,globalc, jzbHigh  );
1842 <  do_ratio_plot(data,ratio_binning,datajzb,globalc, jzbHigh  );
1843 <  do_ratio_plot(mcwithsignal,ratio_binning,mcjzb,globalc, jzbHigh  );
1707 >  delete globalcanvas;
1708 >  switch_overunderflow(false);
1709   }
1710  
1711   string give_jzb_expression(float peak, int type) {
# Line 2108 | Line 1973 | void produce_stretched_jzb_plots(string
1973    
1974  
1975   void diboson_plots(string mcjzb, string datajzb,vector<float> ratio_binning) {
1976 +  switch_overunderflow(true);
1977    vector<int> SamplesToBeModified = allsamples.FindSampleBySampleName("WW/WZ/ZZ");
1978    
1979    if(SamplesToBeModified.size()==0 || SamplesToBeModified[0]==-1) {
# Line 2147 | Line 2013 | void diboson_plots(string mcjzb, string
2013      dout << "     Reset xs for sample " << (allsamples.collection)[SamplesToBeModified[i]].samplename << " from " << Upxs << " to " << (allsamples.collection)[SamplesToBeModified[i]].xs << " (by a factor of " << stretchfactor << ") and reset the correct name (from " << Upname << ")" << endl;
2014      
2015    }
2016 <  
2016 > //   switch_overunderflow(false);
2017   }
2018  
2019  
# Line 2182 | Line 2048 | void draw_normalized_data_vs_data_histo(
2048  
2049  
2050   void jzb_plots(string mcjzb, string datajzb,vector<float> ratio_binning) {
2051 +  switch_overunderflow(true);
2052    TCanvas *can = new TCanvas("can","JZB Plots Canvas");
2053    float max=jzbHigh ;
2054    float min=-120;
# Line 2218 | Line 2085 | void jzb_plots(string mcjzb, string data
2085      if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarse",can,coarse_binning);
2086    }
2087    delete can;
2088 +  switch_overunderflow(false);
2089   }
2090  
2091  
# Line 2758 | Line 2626 | void ttbar_sidebands_comparison(string m
2626    //in the case of the on peak analysis, we compare the 3 control regions to the real value
2627    //in the case of the OFF peak analysis, we compare our control region to the real value
2628    TCut weightbackup=cutWeight;
2629 +  switch_overunderflow(true);
2630    
2631    bool doPURW=false;
2632    
# Line 3006 | Line 2875 | void ttbar_sidebands_comparison(string m
2875  
2876    delete tcan;
2877    cutWeight=weightbackup;
2878 +  switch_overunderflow(false);
2879   }
2880  
2881   void ttbar_sidebands_comparison(string mcjzb, vector<float> jzb_binning) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines