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.40 by fronga, Fri Jul 20 16:50:04 2012 UTC vs.
Revision 1.43 by fronga, Mon Jul 30 08:21:48 2012 UTC

# Line 196 | Line 196 | void make_special_obs_pred_mll_plot(stri
196    }
197    
198    // Separate predictions
199 <  TH1F* Zpred = (TH1F*)LcorrJZBeemm->Clone("Zpred");
200 <  TH1F* OSpred = (TH1F*)RcorrJZBem->Clone("OSpred");
199 >  TH1F* SFN = (TH1F*)LcorrJZBeemm->Clone("SFN");
200 >  TH1F* OFP = (TH1F*)RcorrJZBem->Clone("OFP");
201 >  TH1F* OFN = (TH1F*)LcorrJZBem->Clone("OFN");
202    if(PlottingSetup::RestrictToMassPeak) {
203 <    OSpred->Scale(1.0/3.0);
204 <    OSpred->Add(RcorrJZBSBem,1.0/3.);
205 <    OSpred->Add(RcorrJZBSBeemm,1.0/3.);
206 <    Zpred->Add(LcorrJZBem,-1.0/3.);
207 <    Zpred->Add(LcorrJZBSBem,-1.0/3.);
208 <    Zpred->Add(LcorrJZBSBeemm,-1.0/3.);
209 <  } else {
210 <    Zpred->Add(LcorrJZBem,-1.0);
211 <  }
212 <
213 <  TH1F* Bpred = (TH1F*)Zpred->Clone("Bpred");
213 <  Bpred->Add(OSpred);
203 >    OFP->Scale(1.0/3.0);
204 >    OFP->Add(RcorrJZBSBem,1.0/3.);
205 >    OFP->Add(RcorrJZBSBeemm,1.0/3.);
206 >    OFN->Scale(1.0/3.0);
207 >    OFN->Add(LcorrJZBSBem,1.0/3.);
208 >    OFN->Add(LcorrJZBSBeemm,1.0/3.);
209 >  }
210 >
211 >  TH1F* Bpred = (TH1F*)SFN->Clone("Bpred");
212 >  Bpred->Add(OFP);
213 >  Bpred->Add(OFN,-1);
214    Bpred->SetLineColor(kRed);
215    
216  // Problem with negative bins: add contents to OSpred
217  for ( unsigned int i=0; i<=Zpred->GetNbinsX(); ++i ) {
218    if ( Zpred->GetBinContent(i)<0 ) {
219      OSpred->SetBinContent(i,OSpred->GetBinContent(i)+Zpred->GetBinContent(i));
220      Zpred->SetBinContent(i,0);
221    }
222  }
223
216    RcorrJZBeemm->SetTitleOffset(1.3,"y");
217    RcorrJZBeemm->Draw();
218    mcRcorrJZBeemm.Draw("same");
# Line 238 | Line 230 | void make_special_obs_pred_mll_plot(stri
230    CompleteSave(ckin,saveas.str());
231    
232    // Draw all predictions overlayed
233 <  Zpred->SetLineColor(kGreen+1);
234 <  Zpred->SetLineStyle(2);
235 <  OSpred->SetLineColor(kBlue-2);
236 <  OSpred->SetLineStyle(3);
233 >  unsigned int w = gStyle->GetHistLineWidth()+1; // Make line a bit wider, since we dash it
234 >  SFN->SetLineColor(kGreen+2);
235 >  SFN->SetLineStyle(2);
236 >  SFN->SetLineWidth(w);
237 >  OFP->SetLineColor(kBlue+2);
238 >  OFP->SetLineStyle(2);
239 >  OFP->SetLineWidth(w);
240 >  OFN->SetLineColor(kMagenta+2);
241 >  OFN->SetLineStyle(3);
242 >  OFN->SetLineWidth(w);
243    
244    RcorrJZBeemm->Draw();
245 <  OSpred->Draw("histo,same");
246 <  Zpred->Draw("histo,same");
245 >  SFN->Draw("histo,same");
246 >  OFP->Draw("histo,same");
247 >  OFN->Draw("histo,same");
248    Bpred->Draw("histo,same");
249    RcorrJZBeemm->Draw("same");
250    
251    TLegend *leg2 = make_legend("",0.52,0.7);
252    leg2->AddEntry(RcorrJZBeemm,"observed (data)","lp");
253    leg2->AddEntry(Bpred,"predicted (data)","l");
254 <  leg2->AddEntry(Zpred, "  bkgd w/Z (data)","l");
255 <  leg2->AddEntry(OSpred,"  bkgd w/o Z (data)","l");
254 >  leg2->AddEntry(SFN,  "  SF JZB<0","l");
255 >  leg2->AddEntry(OFN,  "  OF JZB<0","l");
256 >  leg2->AddEntry(OFP,  "  OF JZB>0","l");
257    leg2->Draw("same");
258    
259    saveas.str("");
# Line 444 | Line 444 | void make_kin_plot(string variable, stri
444    int idx = signalsamples.FindSample(signal)[0];
445    (signalsamples.collection)[idx].events->Project("signalhisto",variable.c_str(),cut);
446    signalhisto->Scale((signalsamples.collection)[idx].weight*luminosity);
447 <  signalhisto->SetLineColor((signalsamples.collection)[idx].samplecolor);
447 >  signalhisto->SetLineColor(kOrange);
448  
449    THStack mcstack   = allsamples.DrawStack("mcstack",  variable,nbins,min,max,xlabel,"events",cut,mc,luminosity);
450    datahisto->Draw("e1");
# Line 501 | Line 501 | void make_kin_plot(string variable, stri
501            upperboundary->Draw("same");
502          }
503            
504 <        kinleg->AddEntry("signalihisto",signal.c_str(),"l");
504 >        kinleg->AddEntry("signalhisto",signal.c_str(),"l");
505          kinleg->Draw();
506          write_cut->Draw();
507          DrawPrelim();
# Line 1330 | Line 1330 | void do_prediction_plot(string jzb, TCan
1330    string ytitle("ratio");
1331    if ( use_data==1 ) ytitle = "data/pred";
1332    //save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,Bpredsaveas,true,use_data!=1,ytitle);
1333 <  save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,subdir+Bpredsaveas,true,true,ytitle,BpredSys);//not extending the y range anymore up to 4
1333 >  save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,subdir+Bpredsaveas,true,false,ytitle,BpredSys);//not extending the y range anymore up to 4
1334  
1335    
1336    flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
# Line 1774 | Line 1774 | void draw_pure_jzb_histo(TCut cut,string
1774    datahisto->Draw("same,e1");
1775    
1776    TLegend *leg;
1777 <  if(is_OF(cut) && is_ZP(cut)) leg = allsamples.allbglegend("OFZP",datahisto);
1778 <  else if(!is_OF(cut) &&  is_ZP(cut)) leg = allsamples.allbglegend("SFZP",datahisto);
1779 <  else if( is_OF(cut) && !is_ZP(cut)) leg = allsamples.allbglegend("OFSB",datahisto);
1780 <  else if(!is_OF(cut) && !is_ZP(cut)) leg = allsamples.allbglegend("SFSB",datahisto);
1781 <  else {
1782 <    std::cerr << "Unable to decode cut: " << cut.GetTitle() << std::endl;
1783 <    exit(-1);
1784 <      }
1777 >  if (!PlottingSetup::RestrictToMassPeak) {
1778 >    if(is_OF(cut)) leg = allsamples.allbglegend("Opposite flavor",datahisto);
1779 >    else leg = allsamples.allbglegend("Same flavor",datahisto);
1780 >  } else {
1781 >    if(is_OF(cut) && is_ZP(cut)) leg = allsamples.allbglegend("OFZP",datahisto);
1782 >    else if(!is_OF(cut) &&  is_ZP(cut)) leg = allsamples.allbglegend("SFZP",datahisto);
1783 >    else if( is_OF(cut) && !is_ZP(cut)) leg = allsamples.allbglegend("OFSB",datahisto);
1784 >    else if(!is_OF(cut) && !is_ZP(cut)) leg = allsamples.allbglegend("SFSB",datahisto);
1785 >    else {
1786 >      std::cerr << "Unable to decode cut: " << cut.GetTitle() << std::endl;
1787 >      exit(-1);
1788 >    }
1789 >  }
1790    leg->Draw();
1791    string write_cut = decipher_cut(cut,"");
1792    TText *writeline1 = write_cut_on_canvas(write_cut.c_str());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines