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.13 by buchmann, Wed Apr 18 10:28:20 2012 UTC vs.
Revision 1.14 by buchmann, Wed Apr 18 12:56:51 2012 UTC

# Line 1009 | 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");
# Line 1050 | Line 1052 | void do_prediction_plot(string jzb, TCan
1052      Bpred->Draw("hist,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 < //    TH1F *lm4RcorrJZBeemmC = (TH1F*)lm4RcorrJZBeemm->Clone("lm4RcorrJZBeemmC");
1054 < //    lm4RcorrJZBeemmC->SetLineColor(kOrange+1);
1055 <    lm4RcorrJZBeemm->SetLineColor(kOrange+1);
1056 < //    lm4RcorrJZBeemmC->Draw("histo,same");
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 *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");
# Line 1087 | 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 true","p");
# Line 1101 | 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 true","p");
# Line 1116 | 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 1231 | Line 1240 | void do_prediction_plot(string jzb, TCan
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   void do_ratio_plot(int is_data,vector<float> binning, string jzb, TCanvas *can, float high=-9999) {
# Line 1695 | Line 1707 | void jzb_plots(string mcjzb, string data
1707    for(int i=0;i<=coarserbins;i++)coarse_binning.push_back(min+i*(max-min)/((float)coarserbins));
1708    for(int i=0;i<=rebinnedbins;i++)coarsest_binning.push_back(min+i*(max-min)/((float)rebinnedbins));
1709  
1710 <  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP",can,binning);
1711 <  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP",can,binning);
1712 <  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_SFZP",can,binning);
1713 <  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_SFZP",can,binning);
1714 <  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_OFZP",can,binning);
1715 <  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_OFZP",can,binning);
1716 <  flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1717 <  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB",can,binning);
1718 <  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB",can,binning);
1710 >  if ( !PlottingSetup::Approved ) {
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);
1720 >  }
1721    
1722    draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP_coarse",can,coarse_binning);
1723 <  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP_coarse",can,coarse_binning);
1724 <  flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1725 <  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarse",can,coarse_binning);
1726 <  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarse",can,coarse_binning);
1727 <
1728 < //  draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP_coarsest",can,coarsest_binning);
1715 < //  draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP_coarsest",can,coarsest_binning);
1716 < //  flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1717 < //  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarsest",can,coarsest_binning);
1718 < //  if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarsest",can,coarsest_binning);
1723 >  if ( !PlottingSetup::Approved ) {
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    delete can;
1730   }
1731  
# Line 2687 | Line 2697 | void JZBSelEff(string mcjzb, TTree* even
2697    int nbins = sizeof(xbins)/sizeof(float)-1;
2698    int markers[] = { 20, 26, 21, 24, 22, 25, 28 };
2699  
2700 <  TH1F* heff  = new TH1F("heff", "JZB eff ; generator-level JZB [GeV]; efficiency",nbins,xbins);
2701 <  TH1F* hgen  = new TH1F("hgen", "JZB gen ; generator-level JZB [GeV]; efficiency",nbins,xbins);
2702 <  TH1F* hreco = new TH1F("hreco","JZB reco ; generator-level JZB [GeV]; efficiency",nbins,xbins);
2700 >  
2701 >  TH1F* heff  = new TH1F("heff", "JZB eff ; generator JZB [GeV]; efficiency",nbins,xbins);
2702 >  TH1F* hgen  = new TH1F("hgen", "JZB gen ; generator JZB [GeV]; efficiency",nbins,xbins);
2703 >  TH1F* hreco = new TH1F("hreco","JZB reco ; generator JZB [GeV]; efficiency",nbins,xbins);
2704  
2705    TCut kgen(genMassCut&&"genZPt>0&&genNjets>2&&abs(genMID)==23"&&cutOSSF);
2706    TCut kreco(cutmass);
# Line 2705 | Line 2716 | void JZBSelEff(string mcjzb, TTree* even
2716    TCanvas *can = new TCanvas("can","Canvas for JZB Efficiency",600,600);
2717    can->SetGridx(1);
2718    can->SetGridy(1);
2719 +  can->SetLeftMargin(0.16);
2720 +  can->SetRightMargin(0.05);
2721    TLegend *leg = make_legend("",0.6,0.2,false,0.89,0.5);
2722 <
2723 <  
2722 >  leg->SetBorderSize(1);
2723 >  leg->SetLineColor(kBlack);
2724 >  leg->SetTextFont(62);
2725  
2726    for ( int icut=0; icut<jzb_bins.size(); ++icut ) {
2727  
# Line 2725 | Line 2739 | void JZBSelEff(string mcjzb, TTree* even
2739      }
2740    
2741      heff->GetXaxis()->SetRangeUser(min, max);
2742 + //    heff->GetXaxis()->SetLabelSize(0.05); // paper style. overruled.
2743 + //    heff->GetYaxis()->SetLabelSize(0.05); // paper style. overruled.
2744 + //    heff->GetXaxis()->SetTitleSize(0.06); // paper style. overruled.
2745 + //    heff->GetYaxis()->SetTitleSize(0.06); // paper style. overruled.
2746      heff->SetMarkerStyle(markers[icut]);
2747      heff->Fit("func","Q+","same");
2748  
# Line 2736 | Line 2754 | void JZBSelEff(string mcjzb, TTree* even
2754  
2755      // Store plot
2756      TH1F* h = (TH1F*)heff->Clone(hname);
2757 +    h->SetNdivisions(505,"X");
2758      if ( icut) h->Draw("same");
2759      else h->Draw();
2760      char htitle[256]; sprintf(htitle,"JZB > %3.0f GeV", jzb_bins[icut]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines