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.12 by buchmann, Wed Apr 18 09:20:36 2012 UTC vs.
Revision 1.16 by buchmann, Mon Apr 30 08:38:11 2012 UTC

# Line 102 | Line 102 | void make_special_obs_pred_mll_plot(stri
102    TH1F *RcorrJZBSBeemm;
103    TH1F *LcorrJZBSBeemm;
104    
105 <  TH1F *RcorrJZBeemmNoS;
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);
# Line 189 | Line 189 | void make_special_mll_plot(int nbins, fl
189    TIter next(bgleg->GetListOfPrimitives());
190    TObject* obj;
191    // Copy the nice bkgd legend skipping the "data"
192 <  while ( obj = next() )
192 >  while ( (obj = next()) )
193      if ( strcmp(((TLegendEntry*)obj)->GetObject()->GetName(),"datahistoOSSF") )
194        kinleg->GetListOfPrimitives()->Add(obj);
195  
# Line 208 | Line 208 | void draw_ratio_plot(TH1* hdata, THStack
208    TIter next(hmc.GetHists());
209    TObject* obj;
210    TH1* hratio = NULL;
211 <  while ( obj = next() ) {
211 >  while ( (obj = next()) ) {
212      if ( !hratio ) {
213        hratio = (TH1*)obj->Clone();
214        hratio->SetName("hratio");
# Line 436 | Line 436 | void do_kinematic_plots(string mcjzb, st
436          mll_low=10;
437          mll_hi=210;
438    }
439 <  /*
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 445 | 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);
# Line 455 | 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))";
# Line 470 | Line 470 | void do_kinematic_plots(string mcjzb, st
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 <  */
473 >  
474 >  make_special_obs_pred_mll_plot(mcjzb,0);
475    make_special_obs_pred_mll_plot(mcjzb,50);
476    make_special_obs_pred_mll_plot(mcjzb,100);
477    make_special_obs_pred_mll_plot(mcjzb,150);
# Line 547 | Line 548 | void region_comparison_plots(string mcjz
548      
549    
550      flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- the arguments changed
551 <  for(int ijzb=0;ijzb<jzb_cuts.size();ijzb++) {
551 >  for(int ijzb=0;ijzb<(int)jzb_cuts.size();ijzb++) {
552      float jzbcut=jzb_cuts[ijzb]; // Comparison plots are done for this JZB cut
553      float mll_low=50;float mll_high=170;
554      if(!PlottingSetup::RestrictToMassPeak) {
# Line 1009 | Line 1010 | void do_prediction_plot(string jzb, TCan
1010    blankback->Draw();
1011    if(use_data==1)
1012    {
1013 +    //Bpred->SetLineWidth(3); //paper style.overruled.
1014 +    //lm4RcorrJZBeemm->SetLineWidth(3); //paper style.overruled.
1015      analytical_function = do_extended_fit_to_plot(Bpred,Tpred,LcorrJZBeemm,LcorrJZBem,is_data);
1016      kinpad->cd();//necessary because the extended fit function creates its own canvas
1017      RcorrJZBeemm->Draw("e1x0,same");
1018  
1019      Bpred->Draw("hist,same");
1020 <    analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same");
1020 >    //analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same");
1021      RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
1022      lm4RcorrJZBeemm->Draw("hist,same");
1023      legBpred->AddEntry(RcorrJZBeemm,"observed","p");
# Line 1050 | Line 1053 | void do_prediction_plot(string jzb, TCan
1053      Bpred->Draw("hist,same");
1054   //    analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same");
1055      RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
1056 < //    TH1F *lm4RcorrJZBeemmC = (TH1F*)lm4RcorrJZBeemm->Clone("lm4RcorrJZBeemmC");
1054 < //    lm4RcorrJZBeemmC->SetLineColor(kOrange+1);
1055 <    lm4RcorrJZBeemm->SetLineColor(kOrange+1);
1056 < //    lm4RcorrJZBeemmC->Draw("histo,same");
1056 > //    lm4RcorrJZBeemm->SetLineColor(kOrange+1);
1057      lm4RcorrJZBeemm->SetLineWidth(2);
1058 +    //lm4RcorrJZBeemm->SetLineWidth(2); // paper style. overruled.
1059      lm4RcorrJZBeemm->Draw("histo,same");
1060      DrawPrelim();
1061      TLegend *speciallegBpred = make_legend("",0.45,0.55);
1062 +    //TLegend *speciallegBpred = make_legend("",0.35,0.55); // paper style. overruled.
1063      speciallegBpred->AddEntry(RcorrJZBeemm,"Data","pl");
1064      speciallegBpred->AddEntry(Bpred,"Total background","l");
1065      speciallegBpred->AddEntry(jzbnegative,"JZB<0 (data)","f");
# Line 1087 | Line 1089 | void do_prediction_plot(string jzb, TCan
1089    }
1090    if(use_data==0) {
1091      RcorrJZBeemm->Draw("e1x0,same");
1092 +    //Bpred->SetLineWidth(3); // paper style. overruled.
1093      Bpred->Draw("hist,same");
1094      RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
1095      legBpred->AddEntry(RcorrJZBeemm,"MC true","p");
# Line 1101 | Line 1104 | void do_prediction_plot(string jzb, TCan
1104    }
1105    if(use_data==2) {
1106      RcorrJZBeemm->Draw("e1x0,same");
1107 +    //Bpred->SetLineWidth(3); // paper style. overruled.
1108      Bpred->Draw("hist,same");
1109      RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
1110      legBpred->AddEntry(RcorrJZBeemm,"MC true","p");
# Line 1116 | Line 1120 | void do_prediction_plot(string jzb, TCan
1120   //      CompleteSave(globalcanvas,"Bpred_MCwithS"); // done below in save_with_ratio
1121      }
1122      {
1123 +      //lm4RcorrJZBeemm->SetLineWidth(3); //paper style. overruled.
1124 +      //RcorrJZBeemmNoS->SetLineWidth(3); //paper style. overruled.
1125 +      //lm4RcorrJZBeemm->SetLineStyle(2); //paper style. overruled.
1126 +      //RcorrJZBeemmNoS->SetLineStyle(3); //paper style. overruled.
1127 +      //lm4RcorrJZBeemm->SetLineColor(kOrange+1); //paper style. overruled.
1128 +      
1129        RcorrJZBeemmNoS->SetLineStyle(2);
1130        legBpred2->AddEntry(RcorrJZBeemmNoS,"MC B","l");
1131        legBpred2->AddEntry(lm4RcorrJZBeemm,"MC S","l");
# Line 1231 | Line 1241 | void do_prediction_plot(string jzb, TCan
1241   void do_prediction_plots(string mcjzb, string datajzb, float DataSigma, float MCSigma, bool overlay_signal ) {
1242    TCanvas *globalcanvas = new TCanvas("globalcanvas","Prediction Canvas");
1243    do_prediction_plot(datajzb,globalcanvas,DataSigma,jzbHigh ,data,overlay_signal);
1244 <  do_prediction_plot(mcjzb,globalcanvas,MCSigma,jzbHigh ,mc,overlay_signal);
1245 <  do_prediction_plot(mcjzb,globalcanvas,MCSigma,jzbHigh ,mcwithsignal,overlay_signal);
1244 >  if ( !PlottingSetup::Approved ) {
1245 >    do_prediction_plot(mcjzb,globalcanvas,MCSigma,jzbHigh ,mc,overlay_signal);
1246 >    do_prediction_plot(mcjzb,globalcanvas,MCSigma,jzbHigh ,mcwithsignal,overlay_signal);
1247 >  } else {
1248 >    write_info(__FUNCTION__,"You set approved to true, therefore not producing prediction/observation plots for MC with and without signal.");
1249 >  }
1250   }
1251  
1252   void do_ratio_plot(int is_data,vector<float> binning, string jzb, TCanvas *can, float high=-9999) {
# Line 1652 | Line 1666 | void diboson_plots(string mcjzb, string
1666    
1667    
1668    dout << "Going to increase the cross section for diboson samples ... " << endl;
1669 <  for(int i=0;i<SamplesToBeModified.size();i++) {
1669 >  for(int i=0;i<(int)SamplesToBeModified.size();i++) {
1670      float origxs=(allsamples.collection)[SamplesToBeModified[i]].xs;
1671      (allsamples.collection)[SamplesToBeModified[i]].xs=origxs*stretchfactor;
1672      dout << "     Increased xs for sample " << (allsamples.collection)[SamplesToBeModified[i]].filename << " from " << origxs << " to " << (allsamples.collection)[SamplesToBeModified[i]].xs << " (by a factor of " << stretchfactor << ")" << endl;
# Line 1662 | Line 1676 | void diboson_plots(string mcjzb, string
1676    }
1677    
1678    dout << "Going to produce JZB plots" << endl;
1679 < //  produce_stretched_jzb_plots(mcjzb,datajzb,ratio_binning);
1679 >  produce_stretched_jzb_plots(mcjzb,datajzb,ratio_binning);
1680    TCanvas *gloca = new TCanvas("gloca","gloca");
1681    float sigma=123456;
1682    
# Line 1672 | Line 1686 | void diboson_plots(string mcjzb, string
1686    delete gloca;
1687  
1688    dout << "Going to reset the cross section for diboson samples ... " << endl;
1689 <  for(int i=0;i<SamplesToBeModified.size();i++) {
1689 >  for(int i=0;i<(int)SamplesToBeModified.size();i++) {
1690      float Upxs=(allsamples.collection)[SamplesToBeModified[i]].xs;
1691      (allsamples.collection)[SamplesToBeModified[i]].xs=(allsamples.collection)[SamplesToBeModified[i]].xs*(1.0/stretchfactor);
1692      string Upname=(allsamples.collection)[SamplesToBeModified[i]].samplename;
# Line 1695 | Line 1709 | void jzb_plots(string mcjzb, string data
1709    for(int i=0;i<=coarserbins;i++)coarse_binning.push_back(min+i*(max-min)/((float)coarserbins));
1710    for(int i=0;i<=rebinnedbins;i++)coarsest_binning.push_back(min+i*(max-min)/((float)rebinnedbins));
1711  
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);
1712 >  if ( !PlottingSetup::Approved ) {
1713 >    draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP",can,binning);
1714 >    draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP",can,binning);
1715 >    draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_SFZP",can,binning);
1716 >    draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_SFZP",can,binning);
1717 >    draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_OFZP",can,binning);
1718 >    draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_OFZP",can,binning);
1719 >    flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1720 >    if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB",can,binning);
1721 >    if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB",can,binning);
1722 >  }
1723    
1724    draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP_coarse",can,coarse_binning);
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 < //  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);
1725 >  if ( !PlottingSetup::Approved ) {
1726 >    draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP_coarse",can,coarse_binning);
1727 >    flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
1728 >    if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarse",can,coarse_binning);
1729 >    if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarse",can,coarse_binning);
1730 >  }
1731    delete can;
1732   }
1733  
# Line 1771 | Line 1783 | void compute_MC_yields(string mcjzb,vect
1783    string posneg[] = {"pos","neg"};
1784    TCut tkRegions[] = {cutOSSF&&cutnJets&&cutmass,cutOSOF&&cutnJets&&cutmass,cutOSSF&&cutnJets&&sidebandcut,cutOSOF&&cutnJets&&sidebandcut};
1785  
1786 <  for(int ijzb=0;ijzb<jzb_cuts.size();ijzb++) {
1786 >  for(int ijzb=0;ijzb<(int)jzb_cuts.size();ijzb++) {
1787      TCut jzbMC[]  = { give_jzb_expression(mcjzb,jzb_cuts[ijzb],"pos"), give_jzb_expression(mcjzb,jzb_cuts[ijzb],"neg") };
1788      dout << "_________________________________________________________" << endl;
1789      dout << "Table for JZB> " << jzb_cuts[ijzb] << endl;
1790 <    for(int isample=0;isample<(allsamples.collection).size();isample++) {
1790 >    for(int isample=0;isample<(int)(allsamples.collection).size();isample++) {
1791        if(!(allsamples.collection)[isample].is_data) dout << (allsamples.collection)[isample].samplename << "  &  ";
1792        else dout << "Sample & ";
1793        for(int iregion=0;iregion<nRegions;iregion++) {
# Line 2034 | Line 2046 | void draw_ttbar_and_zjets_shape_for_one_
2046  
2047   void draw_ttbar_and_zjets_shape(string mcjzb, string datajzb) {
2048    int all_leptons=-1;
2037  int electrons_only=0;
2038  int mu_only=1;
2039  int twojetswith50gev=1;
2049    int threejetswith30gev=0;
2050   /*  
2051 +  int twojetswith50gev=1;
2052 +  int electrons_only=0;
2053 +  int mu_only=1;
2054 +
2055    draw_ttbar_and_zjets_shape_for_one_configuration(mcjzb,datajzb,all_leptons,twojetswith50gev);
2056    draw_ttbar_and_zjets_shape_for_one_configuration(mcjzb,datajzb,all_leptons,threejetswith30gev);
2057    
# Line 2160 | Line 2173 | void save_template(string mcjzb, string
2173    configfile<<"mcjzb=\""<<mcjzb<<"\";\n\n";
2174    configfile<<"\n\nMCPeakError="<<MCPeakError<<";\n";
2175    configfile<<"DataPeakError="<<DataPeakError<<";\n\n";
2176 <  for(int i=0;i<jzb_cuts.size();i++) configfile<<"jzb_cuts.push_back("<<jzb_cuts[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2176 >  for(int i=0;i<(int)jzb_cuts.size();i++) configfile<<"jzb_cuts.push_back("<<jzb_cuts[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2177    configfile<<"\n\n";
2178 <  for(int i=0;i<Nobs.size();i++) configfile<<"Nobs.push_back("<<Nobs[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2179 <  for(int i=0;i<Npred.size();i++) configfile<<"Npred.push_back("<<Npred[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2180 <  for(int i=0;i<Nprederr.size();i++) configfile<<"Nprederr.push_back("<<Nprederr[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2178 >  for(int i=0;i<(int)Nobs.size();i++) configfile<<"Nobs.push_back("<<Nobs[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2179 >  for(int i=0;i<(int)Npred.size();i++) configfile<<"Npred.push_back("<<Npred[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2180 >  for(int i=0;i<(int)Nprederr.size();i++) configfile<<"Nprederr.push_back("<<Nprederr[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2181    configfile<<"\n\n";
2182 <  for(int i=0;i<flippedNobs.size();i++) configfile<<"flippedNobs.push_back("<<flippedNobs[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2183 <  for(int i=0;i<flippedNpred.size();i++) configfile<<"flippedNpred.push_back("<<flippedNpred[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2184 <  for(int i=0;i<flippedNprederr.size();i++) configfile<<"flippedNprederr.push_back("<<flippedNprederr[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2182 >  for(int i=0;i<(int)flippedNobs.size();i++) configfile<<"flippedNobs.push_back("<<flippedNobs[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2183 >  for(int i=0;i<(int)flippedNpred.size();i++) configfile<<"flippedNpred.push_back("<<flippedNpred[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2184 >  for(int i=0;i<(int)flippedNprederr.size();i++) configfile<<"flippedNprederr.push_back("<<flippedNprederr[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
2185    configfile<<"\n\n";
2186    configfile<<"luminosity="<<luminosity<<";\n";
2187    configfile<<"RestrictToMassPeak="<<RestrictToMassPeak<<";//defines the type of analysis we're running\n";
# Line 2194 | Line 2207 | void draw_all_ttbar_histos(TCanvas *can,
2207    float max=histos[0]->GetMaximum();
2208    if(manualmin>=0) min=manualmin;
2209    else {
2210 <    for(int i=1;i<histos.size();i++) {
2210 >    for(int i=1;i<(int)histos.size();i++) {
2211        float curmin=get_nonzero_minimum(histos[i]);
2212        float curmax=histos[i]->GetMaximum();
2213        if(curmin<min) min=curmin;
# Line 2205 | Line 2218 | void draw_all_ttbar_histos(TCanvas *can,
2218    histos[0]->Draw(drawoption.c_str());
2219    stringstream drawopt;
2220    drawopt << drawoption << ",same";
2221 <  for(int i=1;i<histos.size();i++) {
2221 >  for(int i=1;i<(int)histos.size();i++) {
2222      histos[i]->Draw(drawopt.str().c_str());
2223    }
2224   }
# Line 2499 | Line 2512 | void zjets_prediction_comparison() {
2512    hJZBpos->SetLineColor(kBlack);
2513    hJZBneg->SetLineColor(kRed);
2514    
2502  Int_t nbins = 5;
2503  Float_t xmax = 100.;
2504
2505  
2515    TCanvas *zcan = new TCanvas("zcan","zcan");  
2516    zcan->SetLogy(1);
2517  
# Line 2587 | Line 2596 | void make_table(samplecollection &coll,
2596    
2597    TCanvas *cannie = new TCanvas("cannie","cannie");
2598    
2599 <  for(int icut=0;icut<jzb_cuts.size();icut++) {
2599 >  for(int icut=0;icut<(int)jzb_cuts.size();icut++) {
2600      float currcut=jzb_cuts[icut];
2601      int nbins=1;float low=currcut;
2602      vector<int> mysample;
# Line 2646 | Line 2655 | void make_table(samplecollection &coll,
2655    //prediction part
2656    if(is_data) cout << "Data prediction & ";
2657    if(subselection!="none") cout << subselection << " prediction &";
2658 <  for(int ij=0;ij<jzb_cuts.size();ij++) cout << jzbcutprediction[ij] << " vs " << metcutprediction[ij] << " & ";
2658 >  for(int ij=0;ij<(int)jzb_cuts.size();ij++) cout << jzbcutprediction[ij] << " vs " << metcutprediction[ij] << " & ";
2659    
2660    cout << endl;
2661    //observation part
2662    if(is_data) cout << "Data observation & ";
2663    if(subselection!="none") cout << subselection << " observation &";
2664 <  for(int ij=0;ij<jzb_cuts.size();ij++) cout << jzbcutobservation[ij] << " vs " << metcutobservation[ij] << " & ";
2664 >  for(int ij=0;ij<(int)jzb_cuts.size();ij++) cout << jzbcutobservation[ij] << " vs " << metcutobservation[ij] << " & ";
2665    cout << endl;
2666    cout << "_________________________________________________________________" << endl;
2667    delete cannie;
# Line 2687 | Line 2696 | void JZBSelEff(string mcjzb, TTree* even
2696    int nbins = sizeof(xbins)/sizeof(float)-1;
2697    int markers[] = { 20, 26, 21, 24, 22, 25, 28 };
2698  
2699 <  TH1F* heff  = new TH1F("heff", "JZB eff ; generator-level JZB [GeV]; efficiency",nbins,xbins);
2700 <  TH1F* hgen  = new TH1F("hgen", "JZB gen ; generator-level JZB [GeV]; efficiency",nbins,xbins);
2701 <  TH1F* hreco = new TH1F("hreco","JZB reco ; generator-level JZB [GeV]; efficiency",nbins,xbins);
2699 >  
2700 >  TH1F* heff  = new TH1F("heff", "JZB eff ; generator JZB [GeV]; efficiency",nbins,xbins);
2701 >  TH1F* hgen  = new TH1F("hgen", "JZB gen ; generator JZB [GeV]; efficiency",nbins,xbins);
2702 >  TH1F* hreco = new TH1F("hreco","JZB reco ; generator JZB [GeV]; efficiency",nbins,xbins);
2703  
2704    TCut kgen(genMassCut&&"genZPt>0&&genNjets>2&&abs(genMID)==23"&&cutOSSF);
2705    TCut kreco(cutmass);
# Line 2705 | Line 2715 | void JZBSelEff(string mcjzb, TTree* even
2715    TCanvas *can = new TCanvas("can","Canvas for JZB Efficiency",600,600);
2716    can->SetGridx(1);
2717    can->SetGridy(1);
2718 +  can->SetLeftMargin(0.16);
2719 +  can->SetRightMargin(0.05);
2720    TLegend *leg = make_legend("",0.6,0.2,false,0.89,0.5);
2721 +  leg->SetBorderSize(1);
2722 +  leg->SetLineColor(kBlack);
2723 +  leg->SetTextFont(62);
2724  
2725 <  
2711 <
2712 <  for ( int icut=0; icut<jzb_bins.size(); ++icut ) {
2725 >  for ( int icut=0; icut<(int)jzb_bins.size(); ++icut ) {
2726  
2727      ostringstream selection;
2728      selection << mcjzb << ">" << jzb_bins[icut];
# Line 2725 | Line 2738 | void JZBSelEff(string mcjzb, TTree* even
2738      }
2739    
2740      heff->GetXaxis()->SetRangeUser(min, max);
2741 + //    heff->GetXaxis()->SetLabelSize(0.05); // paper style. overruled.
2742 + //    heff->GetYaxis()->SetLabelSize(0.05); // paper style. overruled.
2743 + //    heff->GetXaxis()->SetTitleSize(0.06); // paper style. overruled.
2744 + //    heff->GetYaxis()->SetTitleSize(0.06); // paper style. overruled.
2745      heff->SetMarkerStyle(markers[icut]);
2746      heff->Fit("func","Q+","same");
2747  
# Line 2736 | Line 2753 | void JZBSelEff(string mcjzb, TTree* even
2753  
2754      // Store plot
2755      TH1F* h = (TH1F*)heff->Clone(hname);
2756 +    h->SetNdivisions(505,"X");
2757      if ( icut) h->Draw("same");
2758      else h->Draw();
2759      char htitle[256]; sprintf(htitle,"JZB > %3.0f GeV", jzb_bins[icut]);
# Line 2756 | Line 2774 | void JZBSelEff(string mcjzb, TTree* even
2774   // Calls the above function for each signal sample
2775   void plot_jzb_sel_eff(string mcjzb, samplecollection &signalsamples, vector<float> bins )
2776   {  
2777 <  for (int isignal=0; isignal<signalsamples.collection.size();isignal++) {
2777 >  for (int isignal=0; isignal<(int)signalsamples.collection.size();isignal++) {
2778      dout << "JZB selection efficiency curve: " << std::endl;
2779      JZBSelEff(mcjzb,(signalsamples.collection)[isignal].events,(signalsamples.collection)[isignal].samplename,bins); // Only for some selected samples
2780    }
# Line 2799 | Line 2817 | void qcd_plots(string datajzb, string mc
2817    TH1F *RcorrJZBSBeemm;
2818    TH1F *LcorrJZBSBeemm;
2819    
2820 <  TH1F *RcorrJZBeemmNoS;
2820 > //  TH1F *RcorrJZBeemmNoS;
2821  
2822      //these are for the ratio
2823    TH1F *JRcorrJZBeemm   = qcdsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal);
# Line 2930 | Line 2948 | void qcd_plots(string datajzb, string mc
2948    dout << "    Observation increases by : " << RcorrJZBeemm->Integral() << endl;
2949    
2950    dout << endl;
2951 <  for(int i=0;i<bins.size();i++) {
2951 >  for(int i=0;i<(int)bins.size();i++) {
2952      dout << " JZB > " << bins[i] << " : " << endl;
2953      dout << "    Observation increases by : " << RcorrJZBeemm->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) << endl;
2954      if(PlottingSetup::RestrictToMassPeak) {
# Line 2978 | Line 2996 | void check_ptsanity() {
2996    leg->SetY2(1.0);
2997    
2998    
2999 <  for(int isample=0;isample<allsamples.collection.size();isample++) {
2999 >  for(int isample=0;isample<(int)allsamples.collection.size();isample++) {
3000      string nowname=(allsamples.collection)[isample].filename;
3001      cout << "Drawing: " << nowname << " (sample " << isample+1 << " / " << allsamples.collection.size() << ")" << endl;
3002      individualpt1histos[isample] = allsamples.Draw(GetNumericHistoName(),"pt1",50,0,50, "p_{T,1}", "events",cutOSSF&&cutnJets,mc,luminosity,allsamples.FindSample(nowname));
# Line 3002 | Line 3020 | void check_ptsanity() {
3020    ptsancan->cd(2);
3021    fpt2->Draw();
3022  
3023 <  for(int isample=0;isample<allsamples.collection.size();isample++) {
3023 >  for(int isample=0;isample<(int)allsamples.collection.size();isample++) {
3024      ptsancan->cd(1);
3025      individualpt1histos[isample]->DrawNormalized("same,histo");
3026      ptsancan->cd(2);
# Line 3018 | Line 3036 | void check_ptsanity() {
3036   void do_mlls_plot(string mcjzb) {
3037    cout << "At this point we'd plot the mll distribution" << endl;
3038    TCanvas *sigcan = new TCanvas("sigcan","sigcan");
3039 <  for(int isig=0;isig<(signalsamples.collection).size();isig++) {
3039 >  for(int isig=0;isig<(int)(signalsamples.collection).size();isig++) {
3040      if(!(signalsamples.collection)[isig].events) continue;
3041      string nowname=(signalsamples.collection)[isig].filename;
3042      TH1F *mll = signalsamples.Draw("mllhisto","mll",150,0,150, "m_{ll}", "events",cutOSSF&&cutnJets,mc,luminosity,signalsamples.FindSample(nowname));
# Line 3057 | Line 3075 | void met_vs_jzb_plots() {
3075    findme.push_back("TTJets");
3076    findme.push_back("LM");
3077    
3078 <  for(int ifind=0;ifind<findme.size();ifind++) {
3078 >  for(int ifind=0;ifind<(int)findme.size();ifind++) {
3079      vector<int> selsamples = allsamples.FindSample(findme[ifind]);
3080      TH2F *metvsjzb = new TH2F("metvsjzb","metvsjzb",200,0,100,400,-100,100);
3081 <    for(int isel=0;isel<selsamples.size();isel++) {
3081 >    for(int isel=0;isel<(int)selsamples.size();isel++) {
3082        cout << "Producing MET:JZB plot ... working on sample: " << allsamples.collection[selsamples[isel]].filename << endl;
3083        allsamples.collection[selsamples[isel]].events->Draw("jzb[1]:met[4]>>+metvsjzb",cutmass&&cutOSSF);
3084      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines