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.6 by buchmann, Tue Mar 13 17:57:36 2012 UTC vs.
Revision 1.15 by buchmann, Wed Apr 18 13:04:08 2012 UTC

# Line 72 | Line 72 | void find_peaks(float &MCPeak,float &MCP
72    delete tempcan;
73   }
74  
75 + void make_special_obs_pred_mll_plot(string mcjzb, float jzbthreshold) {
76 +  float min=70.0;
77 +  float max=115.0;
78 +  if(!PlottingSetup::RestrictToMassPeak) {
79 +    min=10;
80 +    max=150;
81 +  }
82 +  int nbins=int((max-min)/5);
83 +  
84 +  TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600);
85 +  
86 +  stringstream largerzeroS;
87 +  largerzeroS << "(" << mcjzb << ">" << jzbthreshold << ")";
88 +  TCut largerzero(largerzeroS.str().c_str());
89 +  
90 +  stringstream smallerzeroS;
91 +  smallerzeroS << "(" << mcjzb << "<-" << jzbthreshold << ")";
92 +  TCut smallerzero(smallerzeroS.str().c_str());
93 +  
94 +  TH1F *RcorrJZBeemm     = allsamples.Draw("RcorrJZBeemm",       "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,data,luminosity);
95 +  THStack mcRcorrJZBeemm = allsamples.DrawStack("mcRcorrJZBeemm","mll",nbins,min,max, "m_{ll} [GeV}", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,mc,luminosity);
96 +  TH1F *LcorrJZBeemm     = allsamples.Draw("LcorrJZBeemm",       "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&smallerzero,data,luminosity);
97 +  TH1F *RcorrJZBem       = allsamples.Draw("RcorrJZBem",         "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&largerzero,data,luminosity);
98 +  TH1F *LcorrJZBem       = allsamples.Draw("LcorrJZBem",         "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&smallerzero,data,luminosity);
99 +
100 +  TH1F *RcorrJZBSBem;
101 +  TH1F *LcorrJZBSBem;
102 +  TH1F *RcorrJZBSBeemm;
103 +  TH1F *LcorrJZBSBeemm;
104 +  
105 +  TH1F *RcorrJZBeemmNoS;
106 +
107 +  if(PlottingSetup::RestrictToMassPeak) {
108 +    RcorrJZBSBem   = allsamples.Draw("RcorrJZBSBem",  "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&largerzero,data, luminosity);
109 +    LcorrJZBSBem   = allsamples.Draw("LcorrJZBSBem",  "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&smallerzero,data, luminosity);
110 +    RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&largerzero,data, luminosity);
111 +    LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&smallerzero,data, luminosity);
112 +  }
113 +  
114 +  TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred");
115 +  if(PlottingSetup::RestrictToMassPeak) {
116 +    Bpred->Add(RcorrJZBem,1.0/3.);
117 +    Bpred->Add(LcorrJZBem,-1.0/3.);
118 +    Bpred->Add(RcorrJZBSBem,1.0/3.);
119 +    Bpred->Add(LcorrJZBSBem,-1.0/3.);
120 +    Bpred->Add(RcorrJZBSBeemm,1.0/3.);
121 +    Bpred->Add(LcorrJZBSBeemm,-1.0/3.);
122 +  } else {
123 +    Bpred->Add(RcorrJZBem,1.0);
124 +    Bpred->Add(LcorrJZBem,-1.0);
125 +  }
126 +  
127 +  Bpred->SetLineColor(kRed);
128 +  
129 +  RcorrJZBeemm->Draw();
130 +  mcRcorrJZBeemm.Draw("same");
131 +  Bpred->Draw("histo,same");
132 +  RcorrJZBeemm->Draw("same");
133 +  
134 +  TLegend *leg = allsamples.allbglegend();
135 +  leg->SetX1(0.58);
136 +  leg->AddEntry(RcorrJZBeemm,"observed (data)","l");
137 +  leg->AddEntry(Bpred,"predicted (data)","l");
138 +  leg->Draw("same");
139 +  
140 +  stringstream saveas;
141 +  saveas << "kin/Mll_After_Cut/Cut_At" << jzbthreshold;
142 +  CompleteSave(ckin,saveas.str());
143 +
144 +  delete RcorrJZBeemm;
145 +  delete LcorrJZBeemm;
146 +  delete RcorrJZBem;
147 +  delete LcorrJZBem;
148 +  if(PlottingSetup::RestrictToMassPeak) {
149 +    delete RcorrJZBSBeemm;
150 +    delete LcorrJZBSBeemm;
151 +    delete RcorrJZBSBem;
152 +    delete LcorrJZBSBem;
153 +  }
154 +  delete Bpred;
155 +  delete ckin;
156 + }
157 +
158   void make_special_mll_plot(int nbins, float min, float max, bool logscale,string xlabel) {
159    
160    TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600);
# Line 197 | Line 280 | void make_kin_plot(string variable, stri
280          draw_separation_lines=true;
281    }
282    if(filename=="mll_mm") cut=cutOSSF&&cutnJets&&ibasiccut&&"id1==1";
283 <  if(filename=="mll_aboveJZB100") cut=cutOSSF&&cutnJets&&ibasiccut;
283 >  if(Contains(filename,"mll_aboveJZB100")) cut=cutOSSF&&cutnJets&&ibasiccut;
284 >  if(Contains(filename,"mll_osof_aboveJZB")) cut=cutOSOF&&cutnJets&&ibasiccut;
285    if(filename=="mll_inclusive"||filename=="mll_inclusive_highrange") cut=cutOSSF;
286    if(filename=="mll_inclusive_osof") cut=cutOSOF;
287    if(filename=="mll_inclusive_ee") cut=cutOSSF&&"id1==0";
# Line 295 | Line 379 | void make_kin_plot(string variable, stri
379    delete ckin;
380   }
381  
298
382   void make_JES_plot() {
383  
384    int nbins=10;
# Line 350 | Line 433 | void do_kinematic_plots(string mcjzb, st
433    float mll_low=40;
434    float mll_hi=160;
435    if(!PlottingSetup::RestrictToMassPeak) {
436 <        mll_low=30;
437 <        mll_hi=180;
436 >        mll_low=10;
437 >        mll_hi=210;
438    }
439 +  /*
440    make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll",doPF,true);
441    make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof",doPF,true,true);
442    make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_ee",doPF,true);
# Line 361 | Line 445 | void do_kinematic_plots(string mcjzb, st
445    make_kin_plot("mll","",(int)((mll_hi-mll_low)),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_ee",doPF,true);
446    make_kin_plot("mll","",(int)((mll_hi-mll_low)),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_mm",doPF,true);
447    make_kin_plot("mll","",(int)((mll_hi-mll_low)),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_osof",doPF,true);
448 <  make_kin_plot("mll","",(int)((350-mll_low)),mll_low,350,dolog,"m_{ll} [GeV]","mll_inclusive_highrange",doPF);
448 >  make_kin_plot("mll","",(int)((350-mll_low)),mll_low,350,dolog,"m_{ll} [GeV]","mll_inclusive_highrange",doPF);/*
449 >  make_kin_plot("numVtx","",(int)(30.5-(-0.5)),-0.5,30.5,nolog,"N(Vtx)","numVtx",doPF);
450    make_kin_plot("jetpt[0]","",40,0,200,dolog,"leading jet p_{T} [GeV]","pfJetGoodPt_0",doPF);
451    make_kin_plot("jeteta[0]","",40,-5,5,nolog,"leading jet #eta","pfJetGoodEta_0",doPF);
452    make_kin_plot("pt","",50,0,400,dolog,"Z p_{T} [GeV]","Zpt",doPF);
# Line 370 | Line 455 | void do_kinematic_plots(string mcjzb, st
455    make_kin_plot("eta1","",40,-5,5,nolog,"#eta_{l}","eta",doPF);
456    make_kin_plot("jzb[1]","",100,-150,150,dolog,"JZB [GeV]","jzb_ossf",doPF);
457    make_kin_plot("pfJetGoodNum","",8,0.5,8.5,dolog,"nJets","nJets",doPF);
458 <  make_kin_plot("pfJetGoodNum","",8,0.5,8.5,dolog,"nJets","nJets_nocuts_except_mll_ossf",doPF);
458 >  make_kin_plot("pfJetGoodNum","",8,0.5,8.5,dolog,"nJets","nJets_nocuts_except_mll_ossf",doPF);*//*
459    if(!doPF) make_special_mll_plot((int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]");
460    stringstream jzbcut;
461    jzbcut << "((is_data&&("<<datajzb<<")>100)||(!is_data&&("<<mcjzb<<")>100))";
462    make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_aboveJZB100",doPF,true);
463 +  make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof_aboveJZB100",doPF,true);
464 +  make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_aboveJZB100",doPF,true);
465 +  make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof_aboveJZB100",doPF,true);
466 +  stringstream jzbcut2;
467 +  jzbcut2 << "((is_data&&("<<datajzb<<")>150)||(!is_data&&("<<mcjzb<<")>150))";
468 +  make_kin_plot("mll",jzbcut2.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_aboveJZB150",doPF,true);
469 +  make_kin_plot("mll",jzbcut2.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof_aboveJZB150",doPF,true);
470 +  stringstream jzbcut3;
471 +  jzbcut3 << "((is_data&&("<<datajzb<<")>50)||(!is_data&&("<<mcjzb<<")>50))";
472 +  make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_aboveJZB50",doPF,true);   make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof_aboveJZB50",doPF,true,true);
473 +  */
474 +  make_special_obs_pred_mll_plot(mcjzb,50);
475 +  make_special_obs_pred_mll_plot(mcjzb,100);
476 +  make_special_obs_pred_mll_plot(mcjzb,150);
477 +  make_special_obs_pred_mll_plot(mcjzb,200);
478 +  make_special_obs_pred_mll_plot(mcjzb,250);
479   }
480  
481   void make_comp_plot( string var, string xlabel, string filename, float jzbcut, string mcjzb, string datajzb,
# Line 484 | Line 585 | void signal_bg_comparison()
585    float simulatedlumi=luminosity;//in pb please - adjust to your likings
586    
587    TH1F *JZBplotZJETs = allsamples.Draw("JZBplotZJETs",jzbvariablemc,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("/DY"));
588 <  TH1F *JZBplotLM4 = allsamples.Draw("JZBplotLM4",jzbvariablemc,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("LM4"));
588 >  TH1F *JZBplotLM4;
589 >  if(PlottingSetup::RestrictToMassPeak) JZBplotLM4 = allsamples.Draw("JZBplotLM4",jzbvariablemc,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("LM4"));
590 >  else JZBplotLM4 = allsamples.Draw("JZBplotLM4",jzbvariablemc,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("LM3"));
591    TH1F *JZBplotTtbar = allsamples.Draw("JZBplotTtbar",jzbvariablemc,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("TTJets"));
592    
593    JZBplotTtbar->SetLineColor(allsamples.GetColor("TTJet"));
# Line 508 | Line 611 | void signal_bg_comparison()
611    TLegend *signal_bg_comparison_leg2 =  make_legend("",0.55,0.75,false);
612    signal_bg_comparison_leg2->AddEntry(JZBplotZJETs,"Z+Jets","f");
613    signal_bg_comparison_leg2->AddEntry(JZBplotTtbar,"t#bar{t}","f");
614 <  signal_bg_comparison_leg2->AddEntry(JZBplotLM4,"LM4","f");
614 >  if(PlottingSetup::RestrictToMassPeak) signal_bg_comparison_leg2->AddEntry(JZBplotLM4,"LM4","f");
615 >  else signal_bg_comparison_leg2->AddEntry(JZBplotLM4,"LM3","f");
616    signal_bg_comparison_leg2->Draw();
617    DrawMCPrelim(simulatedlumi);
618    CompleteSave(can,"jzb_bg_vs_signal_distribution");
# Line 750 | Line 854 | if you want to start from scratch (witho
854    return return_functions;
855   }
856  
857 < void do_prediction_plot(string jzb, TCanvas *globalcanvas, float sigma, float high, int use_data, bool overlay_signal = false )
857 > void do_prediction_plot(string jzb, TCanvas *globalcanvas, float sigma, float high, int use_data, bool overlay_signal = false,string subdir="" )
858   {
859 +  // note: sigma is not used ATM
860 +  switch_overunderflow(true);
861    bool is_data=false;
862    bool use_signal=false;
863    if(use_data==1) is_data=true;
# Line 760 | Line 866 | void do_prediction_plot(string jzb, TCan
866    if(is_data) nbins=50;
867    float low=0;
868    float hi=500;
869 +  
870 +  stringstream largerzeroS;
871 +  largerzeroS << "("<<jzb<<">0)";
872 +  TCut largerzero(largerzeroS.str().c_str());
873 +  stringstream smallerzeroS;
874 +  smallerzeroS << "("<<jzb<<"<0)";
875 +  TCut smallerzero(smallerzeroS.str().c_str());
876 +  
877    TH1F *blankback = new TH1F("blankback","blankback",int(high/10),0,high);
878 <  TH1F *RcorrJZBeemm   = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
879 <  TH1F *LcorrJZBeemm   = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
880 <  TH1F *RcorrJZBem     = allsamples.Draw("RcorrJZBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
881 <  TH1F *LcorrJZBem     = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
878 >  TH1F *RcorrJZBeemm   = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal);
879 >  TH1F *LcorrJZBeemm   = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal);
880 >  TH1F *RcorrJZBem     = allsamples.Draw("RcorrJZBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal);
881 >  TH1F *LcorrJZBem     = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal);
882 >
883    blankback->GetXaxis()->SetTitle(RcorrJZBeemm->GetXaxis()->GetTitle());
884    blankback->GetYaxis()->SetTitle(RcorrJZBeemm->GetYaxis()->GetTitle());
885    blankback->GetXaxis()->CenterTitle();
# Line 779 | Line 894 | void do_prediction_plot(string jzb, TCan
894    TH1F *RcorrJZBeemmNoS;
895  
896      //these are for the ratio
897 <  TH1F *JRcorrJZBeemm   = allsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
898 <  TH1F *JLcorrJZBeemm   = allsamples.Draw("JLcorrJZBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
899 <  TH1F *JRcorrJZBem     = allsamples.Draw("JRcorrJZBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
900 <  TH1F *JLcorrJZBem     = allsamples.Draw("JLcorrJZBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
897 >  
898 >  TH1F *JRcorrJZBeemm   = allsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal);
899 >  TH1F *JLcorrJZBeemm   = allsamples.Draw("JLcorrJZBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal);
900 >  TH1F *JRcorrJZBem     = allsamples.Draw("JRcorrJZBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal);
901 >  TH1F *JLcorrJZBem     = allsamples.Draw("JLcorrJZBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal);
902    
903    TH1F *JRcorrJZBSBem;
904    TH1F *JLcorrJZBSBem;
905    TH1F *JRcorrJZBSBeemm;
906    TH1F *JLcorrJZBSBeemm;
907    
908 <  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);
908 >  if(use_data==2 || overlay_signal) RcorrJZBeemmNoS = allsamples.Draw("RcorrJZBeemmNoS",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,false);
909  
910    
911    if(PlottingSetup::RestrictToMassPeak) {
912 <    RcorrJZBSBem   = allsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
913 <    LcorrJZBSBem   = allsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
914 <    RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
915 <    LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
916 <
912 >    RcorrJZBSBem   = allsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal);
913 >    LcorrJZBSBem   = allsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal);
914 >    RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal);
915 >    LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal);
916 >    
917      //these are for the ratio
918 <    JRcorrJZBSBem   = allsamples.Draw("JRcorrJZBSBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
919 <    JLcorrJZBSBem   = allsamples.Draw("JLcorrJZBSBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal);
920 <    JRcorrJZBSBeemm = allsamples.Draw("JRcorrJZBSBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
921 <    JLcorrJZBSBeemm = allsamples.Draw("JLcorrJZBSBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
806 <
918 >    JRcorrJZBSBem   = allsamples.Draw("JRcorrJZBSBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal);
919 >    JLcorrJZBSBem   = allsamples.Draw("JLcorrJZBSBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal);
920 >    JRcorrJZBSBeemm = allsamples.Draw("JRcorrJZBSBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal);
921 >    JLcorrJZBSBeemm = allsamples.Draw("JLcorrJZBSBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal);
922    }
923    
924    TH1F *lm4RcorrJZBeemm;
925 <  if(overlay_signal || use_data == 2 ) lm4RcorrJZBeemm = allsamples.Draw("lm4RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,allsamples.FindSample("LM4"));
925 >  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&&largerzero,is_data, luminosity,allsamples.FindSample("LM"));
926    
927    flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- prediction changed.
928    
# Line 894 | Line 1009 | void do_prediction_plot(string jzb, TCan
1009    blankback->Draw();
1010    if(use_data==1)
1011    {
1012 +    //Bpred->SetLineWidth(3); //paper style.overruled.
1013 +    //lm4RcorrJZBeemm->SetLineWidth(3); //paper style.overruled.
1014      analytical_function = do_extended_fit_to_plot(Bpred,Tpred,LcorrJZBeemm,LcorrJZBem,is_data);
1015      kinpad->cd();//necessary because the extended fit function creates its own canvas
1016      RcorrJZBeemm->Draw("e1x0,same");
1017  
1018      Bpred->Draw("hist,same");
1019 <    analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same");
1019 >    //analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same");
1020      RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
1021 +    lm4RcorrJZBeemm->Draw("hist,same");
1022      legBpred->AddEntry(RcorrJZBeemm,"observed","p");
1023      legBpred->AddEntry(Bpred,"predicted","l");
1024      legBpred->AddEntry(analytical_function[1],"predicted fit","l");
# Line 910 | Line 1028 | void do_prediction_plot(string jzb, TCan
1028      DrawPrelim();
1029  
1030      //this plot shows what the prediction is composed of
1031 <    TCanvas *specialcanv = new TCanvas("specialcanv","specialcanv");
1032 <    specialcanv->SetLogy(1);
1033 <    Zjetspred->SetFillColor(kYellow);
1034 <    Zjetspred->SetLineColor(kYellow);
1035 <    TTbarpred->SetFillColor(allsamples.GetColor((allsamples.FindSample("TTJets"))[0]));
1036 <    TTbarpred->SetLineColor(allsamples.GetColor((allsamples.FindSample("TTJets"))[0]));
1031 >    TPad *predcomppad = new TPad("predcomppad","predcomppad",0,0,1,1);
1032 >    float CurrentBpredLineWidth=Bpred->GetLineWidth();
1033 >    Bpred->SetLineWidth(2);
1034 >    predcomppad->cd();
1035 >    predcomppad->SetLogy(1);
1036 >    
1037 >    TH1F *jzbnegative = (TH1F*)LcorrJZBeemm->Clone("jzbnegative");
1038 >    TH1F *sidebandsemu = (TH1F*)Bpred->Clone("sidebandsemu");
1039 >    sidebandsemu->Add(jzbnegative,-1);
1040 >    
1041 >    jzbnegative->SetFillColor(allsamples.GetColor((allsamples.FindSample("DY"))[0]));
1042 >    jzbnegative->SetLineColor(allsamples.GetColor((allsamples.FindSample("DY"))[0]));
1043 >    sidebandsemu->SetLineColor(allsamples.GetColor((allsamples.FindSample("TTJets"))[0]));
1044 >    sidebandsemu->SetFillColor(allsamples.GetColor((allsamples.FindSample("TTJets"))[0]));
1045 >    
1046      THStack predcomposition("predcomposition","prediction composition");
1047 <    predcomposition.Add(TTbarpred);
1048 <    predcomposition.Add(Zjetspred);
1047 >    predcomposition.Add(sidebandsemu);
1048 >    predcomposition.Add(jzbnegative);
1049      blankback->Draw();
1050      RcorrJZBeemm->Draw("e1x0,same");
1051      predcomposition.Draw("histo,same");//
1052      Bpred->Draw("hist,same");
1053 <    analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same");
1053 > //    analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same");
1054      RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
1055 <    legBpred->Draw();
1055 > //    lm4RcorrJZBeemm->SetLineColor(kOrange+1);
1056 >    lm4RcorrJZBeemm->SetLineWidth(2);
1057 >    //lm4RcorrJZBeemm->SetLineWidth(2); // paper style. overruled.
1058 >    lm4RcorrJZBeemm->Draw("histo,same");
1059      DrawPrelim();
1060 <    TLegend *specialleg = new TLegend(0.6,0.4,0.89,0.55);
1061 <    specialleg->SetFillColor(kWhite);specialleg->SetLineColor(kWhite);
1062 <    specialleg->AddEntry(Zjetspred,"Z+Jets prediction","f");
1063 <    specialleg->AddEntry(TTbarpred,"t#bar{t} prediction","f");
1064 <    specialleg->Draw("same");
1065 <    CompleteSave(specialcanv,"Bpred_Data_____PredictionComposition");
1066 <
1060 >    TLegend *speciallegBpred = make_legend("",0.45,0.55);
1061 >    //TLegend *speciallegBpred = make_legend("",0.35,0.55); // paper style. overruled.
1062 >    speciallegBpred->AddEntry(RcorrJZBeemm,"Data","pl");
1063 >    speciallegBpred->AddEntry(Bpred,"Total background","l");
1064 >    speciallegBpred->AddEntry(jzbnegative,"JZB<0 (data)","f");
1065 >    speciallegBpred->AddEntry(sidebandsemu,"Sidebands/e#mu (data)","f");
1066 > //    speciallegBpred->AddEntry(lm4RcorrJZBeemmC,"LM4","l");
1067 >    speciallegBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l");
1068 >    speciallegBpred->Draw();
1069 >    save_with_ratio(JRcorrJZBeemm,JBpred,predcomppad,subdir+"Bpred_Data_____PredictionComposition",true,use_data!=1,"data/pred");
1070 >    
1071 >    TCanvas *specialcanv = new TCanvas("specialcanv","specialcanv");
1072      THStack kostack = allsamples.DrawStack("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,!is_data, luminosity,use_signal);
1073      blankback->Draw();
1074      kostack.Draw("same");
# Line 942 | Line 1077 | void do_prediction_plot(string jzb, TCan
1077      RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
1078      legBpred->Draw();
1079      DrawPrelim();
1080 <    CompleteSave(specialcanv,"Bpred_Data_____PredictionCompositioninMC");
1080 >    CompleteSave(specialcanv,subdir+"Bpred_Data_____PredictionCompositioninMC");
1081 >    Bpred->SetLineWidth((int)CurrentBpredLineWidth);
1082      
1083 <    delete specialcanv;
948 <    delete specialleg;
1083 >    delete speciallegBpred;
1084      delete Zjetspred;
1085      delete TTbarpred;
1086      
# Line 953 | Line 1088 | void do_prediction_plot(string jzb, TCan
1088    }
1089    if(use_data==0) {
1090      RcorrJZBeemm->Draw("e1x0,same");
1091 +    //Bpred->SetLineWidth(3); // paper style. overruled.
1092      Bpred->Draw("hist,same");
1093      RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
1094 <    legBpred->AddEntry(RcorrJZBeemm,"MC observed","p");
1094 >    legBpred->AddEntry(RcorrJZBeemm,"MC true","p");
1095      legBpred->AddEntry(Bpred,"MC predicted","l");
1096      if(versok) legBpred->AddEntry((TObject*)0,"",""); // Just for alignment // causes seg fault on root v5.18
1097      if(versok) legBpred->AddEntry((TObject*)0,"",""); // causes seg fault on root v5.18
# Line 967 | Line 1103 | void do_prediction_plot(string jzb, TCan
1103    }
1104    if(use_data==2) {
1105      RcorrJZBeemm->Draw("e1x0,same");
1106 +    //Bpred->SetLineWidth(3); // paper style. overruled.
1107      Bpred->Draw("hist,same");
1108      RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
1109 <    legBpred->AddEntry(RcorrJZBeemm,"MC observed","p");
1109 >    legBpred->AddEntry(RcorrJZBeemm,"MC true","p");
1110      legBpred->AddEntry(Bpred,"MC predicted","l");
1111 <    legBpred2->AddEntry(RcorrJZBeemm,"MC observed","p");
1111 >    legBpred2->AddEntry(RcorrJZBeemm,"MC true","p");
1112      legBpred2->AddEntry(Bpred,"MC predicted","l");
1113      {
1114        if(versok) legBpred->AddEntry((TObject*)0,"",""); // Just for alignment // causes seg fault on root v5.18 --> now only allowed for root >=v5.30
# Line 982 | Line 1119 | void do_prediction_plot(string jzb, TCan
1119   //      CompleteSave(globalcanvas,"Bpred_MCwithS"); // done below in save_with_ratio
1120      }
1121      {
1122 +      //lm4RcorrJZBeemm->SetLineWidth(3); //paper style. overruled.
1123 +      //RcorrJZBeemmNoS->SetLineWidth(3); //paper style. overruled.
1124 +      //lm4RcorrJZBeemm->SetLineStyle(2); //paper style. overruled.
1125 +      //RcorrJZBeemmNoS->SetLineStyle(3); //paper style. overruled.
1126 +      //lm4RcorrJZBeemm->SetLineColor(kOrange+1); //paper style. overruled.
1127 +      
1128        RcorrJZBeemmNoS->SetLineStyle(2);
1129        legBpred2->AddEntry(RcorrJZBeemmNoS,"MC B","l");
1130        legBpred2->AddEntry(lm4RcorrJZBeemm,"MC S","l");
# Line 1000 | Line 1143 | void do_prediction_plot(string jzb, TCan
1143    //3rd last argument: do special bpred ratio, 2nd last argument: extended range!, last: y-axis title
1144    string ytitle("ratio");
1145    if ( use_data==1 ) ytitle = "data/pred";
1146 <  save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,Bpredsaveas,true,use_data!=1,ytitle);
1146 >  //save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,Bpredsaveas,true,use_data!=1,ytitle);
1147 >  save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,subdir+Bpredsaveas,true,false,ytitle);//not extending the y range anymore up to 4
1148  
1149    
1150    flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1151    /// The part below is meaningless for the offpeak analysis (it's a comparison of the different estimates but there is but one estimate!)
1152 <  if(!PlottingSetup::RestrictToMassPeak) return;
1153 <  TH1F *Bpredem = (TH1F*)LcorrJZBeemm->Clone("Bpredem");
1154 <  Bpredem->Add(RcorrJZBem);
1155 <  Bpredem->Add(LcorrJZBem,-1);
1156 <  TH1F *BpredSBem = (TH1F*)LcorrJZBeemm->Clone("BpredSBem");
1157 <  BpredSBem->Add(RcorrJZBSBem);
1158 <  Bpred->Add(LcorrJZBSBem,-1);
1159 <  TH1F *BpredSBeemm = (TH1F*)LcorrJZBeemm->Clone("BpredSBeemm");  
1160 <  BpredSBeemm->Add(RcorrJZBSBeemm);
1161 <  BpredSBeemm->Add(LcorrJZBSBeemm,-1.0);
1162 <  globalcanvas->cd();
1163 <  globalcanvas->SetLogy(1);
1164 <
1165 <  RcorrJZBeemm->SetMarkerStyle(20);
1166 <  RcorrJZBeemm->GetXaxis()->SetRangeUser(0,high);
1167 <  blankback->Draw();
1168 <  RcorrJZBeemm->Draw("e1x0,same");
1169 <  RcorrJZBeemm->SetMarkerSize(DataMarkerSize);
1170 <  
1171 <  Bpredem->SetLineColor(kRed+1);
1172 <  Bpredem->SetStats(0);
1173 <  Bpredem->Draw("hist,same");
1174 <
1175 <  BpredSBem->SetLineColor(kGreen+2);//TColor::GetColor("#0B6138"));
1176 <  BpredSBem->SetLineStyle(2);
1177 <  BpredSBem->Draw("hist,same");
1178 <
1179 <  BpredSBeemm->SetLineColor(kBlue+1);
1180 <  BpredSBeemm->SetLineStyle(3);
1181 <  BpredSBeemm->Draw("hist,same");
1182 <  RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
1183 <
1184 <  TLegend *legBpredc = make_legend("",0.6,0.55);
1185 <  if(use_data==1)
1186 <  {
1187 <    legBpredc->AddEntry(RcorrJZBeemm,"observed","p");
1188 <    legBpredc->AddEntry(Bpredem,"OFZP","l");
1189 <    legBpredc->AddEntry(BpredSBem,"OFSB","l");
1190 <    legBpredc->AddEntry(BpredSBeemm,"SFSB","l");
1191 <    legBpredc->Draw();
1192 <    CompleteSave(globalcanvas,"Bpred_Data_comparison");
1193 <  }
1194 <  if(use_data==0) {
1195 <    legBpredc->AddEntry(RcorrJZBeemm,"MC observed","p");
1196 <    legBpredc->AddEntry(Bpredem,"MC OFZP","l");
1197 <    legBpredc->AddEntry(BpredSBem,"MC OFSB","l");
1198 <    legBpredc->AddEntry(BpredSBeemm,"MC SFSB","l");
1199 <    legBpredc->Draw();
1200 <    CompleteSave(globalcanvas,"Bpred_MC_comparison");
1201 <  }
1202 <  if(use_data==2) {
1203 <    legBpredc->AddEntry(RcorrJZBeemm,"MC observed","p");
1204 <    legBpredc->AddEntry(Bpredem,"MC OFZP","l");
1205 <    legBpredc->AddEntry(BpredSBem,"MC OFSB","l");
1206 <    legBpredc->AddEntry(BpredSBeemm,"MC SFSB","l");
1207 <    if ( overlay_signal ) legBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l");
1208 <    legBpredc->Draw();
1209 <    CompleteSave(globalcanvas,"Bpred_MCwithS_comparison");
1152 >  if(PlottingSetup::RestrictToMassPeak) {
1153 >    TH1F *Bpredem = (TH1F*)LcorrJZBeemm->Clone("Bpredem");
1154 >    Bpredem->Add(RcorrJZBem);
1155 >    Bpredem->Add(LcorrJZBem,-1);
1156 >    TH1F *BpredSBem = (TH1F*)LcorrJZBeemm->Clone("BpredSBem");
1157 >    BpredSBem->Add(RcorrJZBSBem);
1158 >    Bpred->Add(LcorrJZBSBem,-1);
1159 >    TH1F *BpredSBeemm = (TH1F*)LcorrJZBeemm->Clone("BpredSBeemm");  
1160 >    BpredSBeemm->Add(RcorrJZBSBeemm);
1161 >    BpredSBeemm->Add(LcorrJZBSBeemm,-1.0);
1162 >    globalcanvas->cd();
1163 >    globalcanvas->SetLogy(1);
1164 >    
1165 >    RcorrJZBeemm->SetMarkerStyle(20);
1166 >    RcorrJZBeemm->GetXaxis()->SetRangeUser(0,high);
1167 >    blankback->Draw();
1168 >    RcorrJZBeemm->Draw("e1x0,same");
1169 >    RcorrJZBeemm->SetMarkerSize(DataMarkerSize);
1170 >    
1171 >    Bpredem->SetLineColor(kRed+1);
1172 >    Bpredem->SetStats(0);
1173 >    Bpredem->Draw("hist,same");
1174 >    
1175 >    BpredSBem->SetLineColor(kGreen+2);//TColor::GetColor("#0B6138"));
1176 >    BpredSBem->SetLineStyle(2);
1177 >    BpredSBem->Draw("hist,same");
1178 >    
1179 >    BpredSBeemm->SetLineColor(kBlue+1);
1180 >    BpredSBeemm->SetLineStyle(3);
1181 >    BpredSBeemm->Draw("hist,same");
1182 >    RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
1183 >    
1184 >    TLegend *legBpredc = make_legend("",0.6,0.55);
1185 >    if(use_data==1)
1186 >    {
1187 >      legBpredc->AddEntry(RcorrJZBeemm,"observed","p");
1188 >      legBpredc->AddEntry(Bpredem,"OFZP","l");
1189 >      legBpredc->AddEntry(BpredSBem,"OFSB","l");
1190 >      legBpredc->AddEntry(BpredSBeemm,"SFSB","l");
1191 >      legBpredc->Draw();
1192 >      CompleteSave(globalcanvas,subdir+"Bpred_Data_comparison");
1193 >    }
1194 >    if(use_data==0) {
1195 >      legBpredc->AddEntry(RcorrJZBeemm,"MC true","p");
1196 >      legBpredc->AddEntry(Bpredem,"MC OFZP","l");
1197 >      legBpredc->AddEntry(BpredSBem,"MC OFSB","l");
1198 >      legBpredc->AddEntry(BpredSBeemm,"MC SFSB","l");
1199 >      legBpredc->Draw();
1200 >      CompleteSave(globalcanvas,subdir+"Bpred_MC_comparison");
1201 >    }
1202 >    if(use_data==2) {
1203 >      legBpredc->AddEntry(RcorrJZBeemm,"MC true","p");
1204 >      legBpredc->AddEntry(Bpredem,"MC OFZP","l");
1205 >      legBpredc->AddEntry(BpredSBem,"MC OFSB","l");
1206 >      legBpredc->AddEntry(BpredSBeemm,"MC SFSB","l");
1207 >      if ( overlay_signal ) legBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l");
1208 >      legBpredc->Draw();
1209 >      CompleteSave(globalcanvas,subdir+"Bpred_MCwithS_comparison");
1210 >    }
1211    }
1212 +  
1213    delete RcorrJZBeemm;
1214    delete LcorrJZBeemm;
1215    delete RcorrJZBem;
# Line 1088 | Line 1234 | void do_prediction_plot(string jzb, TCan
1234      delete JLcorrJZBSBeemm;
1235    }
1236    if(overlay_signal || use_data==2) delete lm4RcorrJZBeemm;
1237 +  switch_overunderflow(false);
1238   }
1239  
1240   void do_prediction_plots(string mcjzb, string datajzb, float DataSigma, float MCSigma, bool overlay_signal ) {
1241    TCanvas *globalcanvas = new TCanvas("globalcanvas","Prediction Canvas");
1242    do_prediction_plot(datajzb,globalcanvas,DataSigma,jzbHigh ,data,overlay_signal);
1243 <  do_prediction_plot(mcjzb,globalcanvas,MCSigma,jzbHigh ,mc,overlay_signal);
1244 <  do_prediction_plot(mcjzb,globalcanvas,MCSigma,jzbHigh ,mcwithsignal,overlay_signal);
1243 >  if ( !PlottingSetup::Approved ) {
1244 >    do_prediction_plot(mcjzb,globalcanvas,MCSigma,jzbHigh ,mc,overlay_signal);
1245 >    do_prediction_plot(mcjzb,globalcanvas,MCSigma,jzbHigh ,mcwithsignal,overlay_signal);
1246 >  } else {
1247 >    write_info(__FUNCTION__,"You set approved to true, therefore not producing prediction/observation plots for MC with and without signal.");
1248 >  }
1249   }
1250  
1251   void do_ratio_plot(int is_data,vector<float> binning, string jzb, TCanvas *can, float high=-9999) {
# Line 1444 | Line 1595 | void draw_pure_jzb_histo(TCut cut,string
1595    TText *writeline1 = write_cut_on_canvas(write_cut.c_str());
1596    writeline1->SetTextSize(0.035);
1597    writeline1->Draw();
1598 <  save_with_ratio(datahisto,mcstack,jzbpad->cd(),("jzb/"+savename));
1598 >  if(!Contains(savename,"Dibosons")) save_with_ratio(datahisto,mcstack,jzbpad->cd(),("jzb/"+savename));
1599 >  else save_with_ratio(datahisto,mcstack,jzbpad->cd(),savename);
1600    TPad *jzbpad2 = new TPad("jzbpad2","jzbpad2",0,0,1,1);
1601    jzbpad2->cd();
1602    jzbpad2->SetLogy(1);
# Line 1459 | Line 1611 | void draw_pure_jzb_histo(TCut cut,string
1611    writeline1->SetTextSize(0.035);
1612    writeline1->Draw();
1613    DrawPrelim();
1614 <  save_with_ratio(datahisto,mcstack,jzbpad2->cd(),("jzb/PositiveSideOnly/"+savename+""));
1614 >  if(!Contains(savename,"Dibosons")) save_with_ratio(datahisto,mcstack,jzbpad2->cd(),("jzb/PositiveSideOnly/"+savename+""));
1615 >  else save_with_ratio(datahisto,mcstack,jzbpad2->cd(),(savename+"__PosOnly"));
1616    datahisto->Delete();
1617    mcstack.Delete();
1618   }
# Line 1467 | Line 1620 | void draw_pure_jzb_histo(TCut cut,string
1620   Double_t GausR(Double_t *x, Double_t *par) {
1621    return gRandom->Gaus(x[0],par[0]);
1622   }
1623 +
1624 + void produce_stretched_jzb_plots(string mcjzb, string datajzb,vector<float> ratio_binning) {
1625 +  TCanvas *dican = new TCanvas("dican","JZB Plots Canvas");
1626 +  float max=jzbHigh ;
1627 +  float min=-120;
1628 +  int nbins=(int)((max-min)/5.0); // we want 5 GeV/bin
1629 +  int coarserbins=int(nbins/2.0);
1630 +  int rebinnedbins=int(nbins/4.0);
1631 +  
1632 +  vector<float>binning;vector<float>coarse_binning;vector<float>coarsest_binning;
1633 +  for(int i=0;i<=nbins;i++)binning.push_back(min+i*(max-min)/((float)nbins));
1634 +  for(int i=0;i<=coarserbins;i++)coarse_binning.push_back(min+i*(max-min)/((float)coarserbins));
1635 +  for(int i=0;i<=rebinnedbins;i++)coarsest_binning.push_back(min+i*(max-min)/((float)rebinnedbins));
1636 +
1637 +  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"Dibosons/jzb_OS_SFZP",dican,binning);
1638 +  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"Dibosons/jzb_OS_OFZP",dican,binning);
1639 +  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"Dibosons/ee/jzb_OS_SFZP",dican,binning);
1640 +  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"Dibosons/mm/jzb_OS_SFZP",dican,binning);
1641 +  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"Dibosons/ee/jzb_OS_OFZP",dican,binning);
1642 +  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"Dibosons/mm/jzb_OS_OFZP",dican,binning);
1643 +  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_SFSB",dican,binning);
1644 +  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_OFSB",dican,binning);
1645 +  
1646 +  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"Dibosons/jzb_OS_SFZP_coarse",dican,coarse_binning);
1647 +  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"Dibosons/jzb_OS_OFZP_coarse",dican,coarse_binning);
1648 +  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_SFSB_coarse",dican,coarse_binning);
1649 +  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_OFSB_coarse",dican,coarse_binning);
1650 +  
1651 +  delete dican;
1652 + }
1653 +  
1654 +
1655 + void diboson_plots(string mcjzb, string datajzb,vector<float> ratio_binning) {
1656 +  vector<int> SamplesToBeModified = allsamples.FindSampleBySampleName("WW/WZ/ZZ");
1657 +  
1658 +  if(SamplesToBeModified.size()==0 || SamplesToBeModified[0]==-1) {
1659 +    write_error(__FUNCTION__,"Could not find any diboson samples - aborting diboson plots");
1660 +    return;
1661 +  }
1662 +  
1663 +  float stretchfactor = 100.0;
1664 +  vector<string> labels;
1665 +  
1666 +  
1667 +  dout << "Going to increase the cross section for diboson samples ... " << endl;
1668 +  for(int i=0;i<SamplesToBeModified.size();i++) {
1669 +    float origxs=(allsamples.collection)[SamplesToBeModified[i]].xs;
1670 +    (allsamples.collection)[SamplesToBeModified[i]].xs=origxs*stretchfactor;
1671 +    dout << "     Increased xs for sample " << (allsamples.collection)[SamplesToBeModified[i]].filename << " from " << origxs << " to " << (allsamples.collection)[SamplesToBeModified[i]].xs << " (by a factor of " << stretchfactor << ")" << endl;
1672 +    labels.push_back((allsamples.collection)[SamplesToBeModified[i]].samplename);
1673 +    (allsamples.collection)[SamplesToBeModified[i]].samplename=any2string(int(stretchfactor))+" x "+(allsamples.collection)[SamplesToBeModified[i]].samplename;
1674 +    dout << "         (also renamed it to " << (allsamples.collection)[SamplesToBeModified[i]].samplename << " )" << endl;
1675 +  }
1676 +  
1677 +  dout << "Going to produce JZB plots" << endl;
1678 +  produce_stretched_jzb_plots(mcjzb,datajzb,ratio_binning);
1679 +  TCanvas *gloca = new TCanvas("gloca","gloca");
1680 +  float sigma=123456;
1681 +  
1682 +  dout << "Going to produce prediction plots" << endl;
1683 +  do_prediction_plot(mcjzb, gloca, sigma, PlottingSetup::jzbHigh, 0, false,"Dibosons/Bpred/" ); // do only MC plots, no signal
1684 +  do_prediction_plot(mcjzb, gloca, sigma, PlottingSetup::jzbHigh, 0, false,"Dibosons/Bpred/" ); // do MC plots with signal
1685 +  delete gloca;
1686 +
1687 +  dout << "Going to reset the cross section for diboson samples ... " << endl;
1688 +  for(int i=0;i<SamplesToBeModified.size();i++) {
1689 +    float Upxs=(allsamples.collection)[SamplesToBeModified[i]].xs;
1690 +    (allsamples.collection)[SamplesToBeModified[i]].xs=(allsamples.collection)[SamplesToBeModified[i]].xs*(1.0/stretchfactor);
1691 +    string Upname=(allsamples.collection)[SamplesToBeModified[i]].samplename;
1692 +    (allsamples.collection)[SamplesToBeModified[i]].samplename=labels[i];
1693 +    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;
1694 +    
1695 +  }
1696    
1697 + }
1698   void jzb_plots(string mcjzb, string datajzb,vector<float> ratio_binning) {
1699    TCanvas *can = new TCanvas("can","JZB Plots Canvas");
1700    float max=jzbHigh ;
# Line 1481 | Line 1708 | void jzb_plots(string mcjzb, string data
1708    for(int i=0;i<=coarserbins;i++)coarse_binning.push_back(min+i*(max-min)/((float)coarserbins));
1709    for(int i=0;i<=rebinnedbins;i++)coarsest_binning.push_back(min+i*(max-min)/((float)rebinnedbins));
1710  
1711 <  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP",can,binning);
1712 <  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP",can,binning);
1713 <  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_SFZP",can,binning);
1714 <  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_SFZP",can,binning);
1715 <  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_OFZP",can,binning);
1716 <  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_OFZP",can,binning);
1717 <  flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1718 <  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB",can,binning);
1719 <  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB",can,binning);
1711 >  if ( !PlottingSetup::Approved ) {
1712 >    draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP",can,binning);
1713 >    draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP",can,binning);
1714 >    draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_SFZP",can,binning);
1715 >    draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_SFZP",can,binning);
1716 >    draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_OFZP",can,binning);
1717 >    draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_OFZP",can,binning);
1718 >    flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1719 >    if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB",can,binning);
1720 >    if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB",can,binning);
1721 >  }
1722    
1723    draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP_coarse",can,coarse_binning);
1724 <  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP_coarse",can,coarse_binning);
1725 <  flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1726 <  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarse",can,coarse_binning);
1727 <  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarse",can,coarse_binning);
1728 <
1729 < //  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP_coarsest",can,coarsest_binning);
1730 < //  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP_coarsest",can,coarsest_binning);
1502 < //  flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1503 < //  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarsest",can,coarsest_binning);
1504 < //  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarsest",can,coarsest_binning);
1724 >  if ( !PlottingSetup::Approved ) {
1725 >    draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP_coarse",can,coarse_binning);
1726 >    flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1727 >    if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarse",can,coarse_binning);
1728 >    if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarse",can,coarse_binning);
1729 >  }
1730 >  delete can;
1731   }
1732  
1733  
# Line 1842 | Line 2068 | void find_correction_factors(string &jzb
2068    TCanvas *cancorr = new TCanvas("cancorr","Canvas for Response Correction");
2069    cancorr->SetLogz();
2070    cancorr->SetRightMargin(0.13);
2071 <  flag_this_change(__FUNCTION__,__LINE__,false);//PlottingSetup::RestrictToMassPeak
2071 >  flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
2072    TCut zptforresponsepresentation("pt<600"&&cutmass&&cutOSSF&&"((sumJetPt[1]/pt)<5.0)");
2073    TH2F *niceresponseplotd = new TH2F("niceresponseplotd","",100,0,600,100,0,5);
2074    (allsamples.collection)[allsamples.FindSample("Data")[0]].events->Draw("sumJetPt[1]/pt:pt>>niceresponseplotd",zptforresponsepresentation);
# Line 1916 | Line 2142 | void pick_up_events(string cut) {
2142    allsamples.PickUpEvents(cut);
2143   }
2144  
2145 < void save_template(string mcjzb, string datajzb,vector<float> jzb_cuts,float MCPeakError) {
2145 > void save_template(string mcjzb, string datajzb,vector<float> jzb_cuts,float MCPeakError,float DataPeakError) {
2146    dout << "Saving configuration template!" << endl;
2147    ofstream configfile;
2148    configfile.open("../DistributedModelCalculations/last_configuration.C");
# Line 1937 | Line 2163 | void save_template(string mcjzb, string
2163    configfile<<"string mcjzb=\"mcjzb_ERROR\";\n";
2164    configfile<<"vector<float>jzb_cuts;\n";
2165    configfile<<"float MCPeakError=-999;\n";
2166 +  configfile<<"float DataPeakError=-999;\n";
2167    configfile<<"}\n\n";
2168  
2169    configfile<<"void read_config() {\n";
2170    configfile<<"datajzb=\""<<datajzb<<"\";\n";
2171    configfile<<"mcjzb=\""<<mcjzb<<"\";\n\n";
2172 <  configfile<<"\n\nMCPeakError="<<MCPeakError<<";\n\n";
2172 >  configfile<<"\n\nMCPeakError="<<MCPeakError<<";\n";
2173 >  configfile<<"DataPeakError="<<DataPeakError<<";\n\n";
2174    for(int i=0;i<jzb_cuts.size();i++) configfile<<"jzb_cuts.push_back("<<jzb_cuts[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2175    configfile<<"\n\n";
2176    for(int i=0;i<Nobs.size();i++) configfile<<"Nobs.push_back("<<Nobs[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
# Line 2055 | Line 2283 | void ttbar_sidebands_comparison(string m
2283    leg->Draw("same");
2284    DrawMCPrelim(simulatedlumi);
2285    CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_shape_comparison");
2286 <  
2286 > cout << __LINE__ << endl;  
2287    TH1F *TZemcopy = (TH1F*)TZem->Clone("TZemcopy");
2288 + cout << __LINE__ << endl;  
2289    TH1F *TZeemmcopy = (TH1F*)TZeemm->Clone("TZeemmcopy");
2290 <  TH1F *TSeemmcopy = (TH1F*)TSeemm->Clone("TSeemmcopy");
2291 <  TH1F *TSemcopy = (TH1F*)TSem->Clone("TSemcopy");
2290 > cout << __LINE__ << endl;  
2291 >  TH1F *TSeemmcopy;
2292 >  TH1F *TSemcopy;
2293 >  if(PlottingSetup::RestrictToMassPeak) {
2294 >    TSeemmcopy = (TH1F*)TSeemm->Clone("TSeemmcopy");
2295 >    TSemcopy = (TH1F*)TSem->Clone("TSemcopy");
2296 >  }
2297  
2298    TZem->Divide(TZeemm);
2299    TZem->SetMarkerStyle(21);
# Line 2081 | Line 2315 | void ttbar_sidebands_comparison(string m
2315    
2316    float linepos=0.25;
2317    if(PlottingSetup::RestrictToMassPeak) linepos=0.25;
2318 +  if(!PlottingSetup::RestrictToMassPeak) linepos=0.1; //sys uncertainty for iJZB
2319    TLine *top = new TLine(binning[0],1.0+linepos,binning[binning.size()-1],1.0+linepos);
2320    TLine *center = new TLine(binning[0],1.0,binning[binning.size()-1],1.0);
2321    TLine *bottom = new TLine(binning[0],1.0-linepos,binning[binning.size()-1],1.0-linepos);
2322    
2323 +  /*write_warning(__FUNCTION__,"These two lines are to be removed!");
2324 +  TLine *topalt = new TLine(binning[0],1.0+0.1,binning[binning.size()-1],1.0+0.1);
2325 +  TLine *bottomalt = new TLine(binning[0],1.0-0.1,binning[binning.size()-1],1.0-0.1);
2326 +  topalt->SetLineColor(kRed);topalt->SetLineStyle(3);
2327 +  bottomalt->SetLineColor(kRed);bottomalt->SetLineStyle(3);
2328 +  topalt->Draw("same");bottomalt->Draw("same");*/
2329 +  
2330 +  
2331    top->SetLineColor(kBlue);top->SetLineStyle(2);
2332    bottom->SetLineColor(kBlue);bottom->SetLineStyle(2);
2333    center->SetLineColor(kBlue);
# Line 2109 | Line 2352 | void ttbar_sidebands_comparison(string m
2352    CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_shape_comparison_ratio");
2353    
2354  
2112
2355   ///-------------- second part: only look at the quantity we actually care about!
2356    TH1F *leftsfzp  = (TH1F*)nTZeemm->Clone("leftsfzp");
2357    TH1F *rightsfzp = (TH1F*)TZeemmcopy->Clone("rightsfzp");
# Line 2456 | Line 2698 | void JZBSelEff(string mcjzb, TTree* even
2698    int nbins = sizeof(xbins)/sizeof(float)-1;
2699    int markers[] = { 20, 26, 21, 24, 22, 25, 28 };
2700  
2701 <  TH1F* heff  = new TH1F("heff", "JZB eff ; generator-level JZB [GeV]; efficiency",nbins,xbins);
2702 <  TH1F* hgen  = new TH1F("hgen", "JZB gen ; generator-level JZB [GeV]; efficiency",nbins,xbins);
2703 <  TH1F* hreco = new TH1F("hreco","JZB reco ; generator-level JZB [GeV]; efficiency",nbins,xbins);
2701 >  
2702 >  TH1F* heff  = new TH1F("heff", "JZB eff ; generator JZB [GeV]; efficiency",nbins,xbins);
2703 >  TH1F* hgen  = new TH1F("hgen", "JZB gen ; generator JZB [GeV]; efficiency",nbins,xbins);
2704 >  TH1F* hreco = new TH1F("hreco","JZB reco ; generator JZB [GeV]; efficiency",nbins,xbins);
2705  
2706    TCut kgen(genMassCut&&"genZPt>0&&genNjets>2&&abs(genMID)==23"&&cutOSSF);
2707    TCut kreco(cutmass);
# Line 2474 | Line 2717 | void JZBSelEff(string mcjzb, TTree* even
2717    TCanvas *can = new TCanvas("can","Canvas for JZB Efficiency",600,600);
2718    can->SetGridx(1);
2719    can->SetGridy(1);
2720 +  can->SetLeftMargin(0.16);
2721 +  can->SetRightMargin(0.05);
2722    TLegend *leg = make_legend("",0.6,0.2,false,0.89,0.5);
2723 <
2724 <  
2723 >  leg->SetBorderSize(1);
2724 >  leg->SetLineColor(kBlack);
2725 >  leg->SetTextFont(62);
2726  
2727    for ( int icut=0; icut<jzb_bins.size(); ++icut ) {
2728  
# Line 2494 | Line 2740 | void JZBSelEff(string mcjzb, TTree* even
2740      }
2741    
2742      heff->GetXaxis()->SetRangeUser(min, max);
2743 + //    heff->GetXaxis()->SetLabelSize(0.05); // paper style. overruled.
2744 + //    heff->GetYaxis()->SetLabelSize(0.05); // paper style. overruled.
2745 + //    heff->GetXaxis()->SetTitleSize(0.06); // paper style. overruled.
2746 + //    heff->GetYaxis()->SetTitleSize(0.06); // paper style. overruled.
2747      heff->SetMarkerStyle(markers[icut]);
2748      heff->Fit("func","Q+","same");
2749  
# Line 2505 | Line 2755 | void JZBSelEff(string mcjzb, TTree* even
2755  
2756      // Store plot
2757      TH1F* h = (TH1F*)heff->Clone(hname);
2758 +    h->SetNdivisions(505,"X");
2759      if ( icut) h->Draw("same");
2760      else h->Draw();
2761      char htitle[256]; sprintf(htitle,"JZB > %3.0f GeV", jzb_bins[icut]);
# Line 2816 | Line 3067 | void do_mlls_plot(string mcjzb) {
3067    }
3068   }
3069  
3070 + void met_vs_jzb_plots() {
3071 +  
3072 +  TCanvas *canmetjzb = new TCanvas("canmet","MET vs JZB canvas");
3073 +  canmetjzb->SetRightMargin(0.16);
3074 +  
3075 +  vector<string> findme;
3076 +  findme.push_back("DY");
3077 +  findme.push_back("TTJets");
3078 +  findme.push_back("LM");
3079 +  
3080 +  for(int ifind=0;ifind<findme.size();ifind++) {
3081 +    vector<int> selsamples = allsamples.FindSample(findme[ifind]);
3082 +    TH2F *metvsjzb = new TH2F("metvsjzb","metvsjzb",200,0,100,400,-100,100);
3083 +    for(int isel=0;isel<selsamples.size();isel++) {
3084 +      cout << "Producing MET:JZB plot ... working on sample: " << allsamples.collection[selsamples[isel]].filename << endl;
3085 +      allsamples.collection[selsamples[isel]].events->Draw("jzb[1]:met[4]>>+metvsjzb",cutmass&&cutOSSF);
3086 +    }
3087 +    metvsjzb->Scale(allsamples.collection[selsamples[0]].weight);
3088 +    metvsjzb->SetStats(0);
3089 +    metvsjzb->GetXaxis()->SetTitle("MET (GeV)");
3090 +    metvsjzb->GetYaxis()->SetTitle("JZB (GeV)");
3091 +    metvsjzb->GetXaxis()->CenterTitle();
3092 +    metvsjzb->GetYaxis()->CenterTitle();
3093 +    metvsjzb->Draw("COLZ");
3094 +    TText* title = write_text(0.5,0.95,allsamples.collection[selsamples[0]].samplename);
3095 +    title->SetTextAlign(12);
3096 +    title->Draw();
3097 +    CompleteSave(canmetjzb,(string)"METvsJZBplots/"+findme[ifind]);
3098 +  }
3099 + }
3100 +    
3101 +
3102   void test() {
3103    
3104    TCanvas *testcanv = new TCanvas("testcanv","testcanv");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines