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.68 by buchmann, Fri Sep 14 15:17:51 2012 UTC vs.
Revision 1.75 by buchmann, Tue Dec 4 12:31:52 2012 UTC

# Line 305 | Line 305 | void make_special_mll_plot(int nbins, fl
305    datahistoOSSF->SetMarkerSize(DataMarkerSize);
306    datahistoOSSF->Draw();
307  
308 <  mcstackOSSF.Draw("same");
308 >  mcstackOSSF.Draw("histo,same");
309    datahistoOSSF->Draw("same");
310  
311    datahistoOSOF->SetMarkerColor(TColor::GetColor("#FE642E"));
# Line 468 | Line 468 | float make_data_comparison_plot(string v
468  
469    TH1F *data1 = allsamples.Draw("data1",variable,nbins,min,max, xlabel, "events",ibasiccut,data,luminosity);
470    TH1F *data2 = comparesamples.Draw("data2",variable,nbins,min,max, xlabel, "events",ibasiccut,data,luminosity);
471 +  data1->Scale(5.0/9.2);
472  
473    data1->SetMarkerSize(DataMarkerSize);
474    data2->SetLineColor(kRed);
# Line 492 | Line 493 | float make_data_comparison_plot(string v
493    data1->GetYaxis()->CenterTitle();
494  
495    TLegend *mleg = make_legend("",legendPosition,0.7,false,legendPosition+0.2);
496 <  mleg->AddEntry(data1, "New 3.8/fb", "PL");
497 <  mleg->AddEntry(data2, "Old 5.1/fb", "L");
496 >  mleg->AddEntry(data1, "2012 data (scaled)", "PL");
497 >  mleg->AddEntry(data2, "2011 data", "L");
498  
499    data1->Draw("E1");
500    data2->Draw("HIST,SAMES");
501    mleg->Draw();
502    DrawPrelim();
503 <  save_with_ratio( data1, data2, rcan, "compareData/" + filename, false, false, "old/new" );
503 >  save_with_ratio( data1, data2, rcan, "compareData/" + filename, false, false, "new/old" );
504  
505    data1->Delete();
506    data2->Delete();
# Line 629 | Line 630 | void make_kin_plot(string variable, stri
630    THStack mcstack   = allsamples.DrawStack("mcstack",  variable,nbins,min,max,xlabel,"events",cut,mc,luminosity);
631    datahisto->Draw("e1");
632    ckin->Update();
633 <  mcstack.Draw("same");
633 >  mcstack.Draw("histo,same");
634    
635    datahisto->Draw("same,e1");
636    TLegend *kinleg = allsamples.allbglegend();
# Line 672 | Line 673 | void make_kin_plot(string variable, stri
673          kinpad->cd();
674          kinpad->SetLogy(logscale);
675          datahisto->Draw("e1");
676 <        mcstack.Draw("same");
676 >        mcstack.Draw("histo,same");
677          if(drawsignal) signalhisto->Draw("same");
678          datahisto->Draw("same,e1");
679          datahisto->Draw("same,axis");
# Line 700 | Line 701 | void make_kin_plot(string variable, stri
701    delete ckin;
702   }
703  
704 +
705 + void make_plain_kin_plot(string variable, string addcut, int nbins, float min, float max, bool logscale,
706 +                   string xlabel, string filename, bool isPF=true, bool plotratio=true, bool loadlastminmax=false ) {
707 +  TCut cut=TCut(addcut.c_str())&&basiccut;
708 +
709 +  TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600);
710 +  ckin->SetLogy(logscale);
711 +  TH1F *datahisto = allsamples.Draw("datahisto",variable,nbins,min,max, xlabel, "events",cut,data,luminosity);
712 +  datahisto->SetMarkerSize(DataMarkerSize);
713 +  if ( !logscale ) datahisto->SetMinimum(0); // Defaults
714 +  else datahisto->SetMinimum(0.5);
715 +  // Custom max.
716 +  if (logscale) datahisto->SetMaximum(5.3*datahisto->GetMaximum());
717 +  else datahisto->SetMaximum(1.3*datahisto->GetMaximum());
718 +
719 +  cout << "******** Cut used : " << (const char*) cut << " for plot " << filename << endl;
720 +  if(loadlastminmax) {
721 +        datahisto->SetMinimum(lastrange_min);
722 +        datahisto->SetMaximum(lastrange_max);
723 +        if(logscale) {
724 +                datahisto->SetMinimum(pow(10,lastrange_min));
725 +                datahisto->SetMaximum(pow(10,lastrange_max));
726 +        }              
727 +  }
728 +
729 +  THStack mcstack   = allsamples.DrawStack("mcstack",  variable,nbins,min,max,xlabel,"events",cut,mc,luminosity);
730 +  datahisto->Draw("e1");
731 +  ckin->Update();
732 +  mcstack.Draw("histo,same");
733 +  
734 +  datahisto->Draw("same,e1");
735 +  TLegend *kinleg = allsamples.allbglegend();
736 +  kinleg->Draw();
737 +
738 +  lastrange_min=ckin->GetUymin();
739 +  lastrange_max=ckin->GetUymax();
740 +
741 +  if ( plotratio ) {
742 +        TPad *kinpad = new TPad("kinpad","kinpad",0,0,1,1);
743 +        kinpad->cd();
744 +        kinpad->SetLogy(logscale);
745 +        datahisto->Draw("e1");
746 +        mcstack.Draw("histo,same");
747 +        datahisto->Draw("same,e1");
748 +        datahisto->Draw("same,axis");
749 +          
750 +        kinleg->Draw();
751 +        DrawPrelim();
752 +        string saveas="kin/"+filename;
753 +        if(isPF) saveas="kin/"+filename+"__PF";
754 +        save_with_ratio(datahisto,mcstack,kinpad->cd(),saveas);
755 +  } else {
756 +        if(isPF) CompleteSave(ckin,"kin/"+filename+"__PF");
757 +        else CompleteSave(ckin,"kin/"+filename);
758 +  }
759 +  datahisto->Delete();
760 +  delete ckin;
761 + }
762 +
763 +
764   void make_JES_plot(TCut cut, string name) {
765  
766    int nbins=10;
# Line 733 | Line 794 | void make_JES_plot(TCut cut, string name
794    JESunc->SetFillColor(TColor::GetColor("#00ADE1"));
795    JESunc->SetFillStyle(3002);
796    datahisto->Draw("e1");
797 <  mcstack.Draw("same");
797 >  mcstack.Draw("histo,same");
798    JESunc->Draw("2");
799    datahisto->Draw("same,e1");
800    TLegend *kinleg = allsamples.allbglegend();
# Line 745 | Line 806 | void make_JES_plot(TCut cut, string name
806  
807   }
808  
809 + string Cut2Str(TCut cut) {
810 +  return ((string)(const char*)cut);
811 + }
812 +
813 + void MakeElegantTwoThreeComparisons() {
814 +    
815 +    TCut signal("met[4]>100&&met[4]<150&&mll>20"&&PlottingSetup::basicqualitycut);
816 +    TCut TwoJets("pfJetGoodNum40==2");
817 +    TCut ThreeJets("pfJetGoodNum40>=3");
818 +    
819 +    float min=20;
820 +    float max=300;
821 +    int nbins=int((max-min)/5.0);
822 +    string xlabel="m_{ll} [GeV]";
823 +    
824 +    TCanvas *can2 = new TCanvas("can2","can2");
825 +    TH1F *TwoOF = allsamples.Draw("TwoOF","mll",nbins,min,max, xlabel, "events",cutOSOF&&signal&&TwoJets,mc,luminosity,allsamples.FindSample("TTJets_"));
826 +    TH1F *TwoSF = allsamples.Draw("TwoSF","mll",nbins,min,max, xlabel, "events",cutOSSF&&signal&&TwoJets,mc,luminosity,allsamples.FindSample("TTJets_"));
827 +    TH1F *ThreeOF = allsamples.Draw("ThreeOF","mll",nbins,min,max, xlabel, "events",cutOSOF&&signal&&ThreeJets,mc,luminosity,allsamples.FindSample("TTJets_"));
828 +    TH1F *ThreeSF = allsamples.Draw("ThreeSF","mll",nbins,min,max, xlabel, "events",cutOSSF&&signal&&ThreeJets,mc,luminosity,allsamples.FindSample("TTJets_"));
829 +    
830 +    can2->cd(1);
831 +    
832 +    TwoSF->SetFillColor(kWhite);
833 +    TwoOF->SetFillColor(kWhite);
834 +    ThreeSF->SetFillColor(kWhite);
835 +    ThreeOF->SetFillColor(kWhite);
836 +    
837 +    TPad *kin3 = new TPad("kin3","kin3",0,0,1,1);
838 +    kin3->cd();
839 +    TwoOF->Draw("histo");
840 +    TwoSF->Draw("e1,same");
841 +    TLegend *leg_SFOF_Two = make_legend();
842 +    leg_SFOF_Two->SetHeader("t#bar{t} MC:");
843 +    leg_SFOF_Two->AddEntry(TwoOF,"OF, nJets==2","l");
844 +    leg_SFOF_Two->AddEntry(TwoSF,"SF, nJets==2","lp");
845 +    leg_SFOF_Two->Draw();
846 +    save_with_ratio(TwoSF,TwoOF,kin3->cd(),"DoubleRatios/SFOF_Two");
847 +    
848 +    TPad *kin4 = new TPad("kin4","kin4",0,0,1,1);
849 +    kin4->cd();
850 +    ThreeOF->Draw("histo");
851 +    ThreeSF->Draw("e1,same");
852 +    TLegend *leg_SFOF_Three = make_legend();
853 +    leg_SFOF_Three->SetHeader("t#bar{t} MC:");
854 +    leg_SFOF_Three->AddEntry(TwoOF,"OF, nJet#geq3","l");
855 +    leg_SFOF_Three->AddEntry(TwoSF,"SF, nJets#geq3","lp");
856 +    leg_SFOF_Three->Draw();
857 +    save_with_ratio(ThreeSF,ThreeOF,kin4->cd(),"DoubleRatios/SFOF_Three");
858 +    
859 +    
860 +    TwoSF->Scale(ThreeSF->Integral()/TwoSF->Integral());
861 +    TPad *kin = new TPad("kin","kin",0,0,1,1);
862 +    kin->cd();
863 +    TwoSF->Draw("histo");
864 +    ThreeSF->Draw("e1,same");
865 +    TLegend *leg_SF_Two_Three = make_legend();
866 +    leg_SF_Two_Three->SetHeader("t#bar{t} MC:");
867 +    leg_SF_Two_Three->AddEntry(TwoSF,"#splitline{SF, nJets==2}{ (scaled)}","l");
868 +    leg_SF_Two_Three->AddEntry(ThreeSF,"SF, nJets#geq3","lp");
869 +    leg_SF_Two_Three->Draw();
870 +    save_with_ratio(TwoSF,ThreeSF,kin->cd(),"DoubleRatios/SF_Two_Three");
871 +    
872 +    TwoOF->Scale(ThreeOF->Integral()/TwoOF->Integral());
873 +    TPad *kin2 = new TPad("kin2","kin2",0,0,1,1);
874 +    kin2->cd();
875 +    TwoOF->Draw("histo");
876 +    ThreeOF->Draw("e1,same");
877 +    TLegend *leg_OF_Two_Three = make_legend();
878 +    leg_OF_Two_Three->SetHeader("t#bar{t} MC:");
879 +    leg_OF_Two_Three->AddEntry(TwoSF,"#splitline{OF, nJets==2}{ (scaled)}","l");
880 +    leg_OF_Two_Three->AddEntry(ThreeSF,"OF, nJets#geq3","lp");
881 +    leg_OF_Two_Three->Draw();
882 +    save_with_ratio(TwoOF,ThreeOF,kin2->cd(),"DoubleRatios/OF_Two_Three");
883 +    
884 + }
885 +
886 +
887   void do_kinematic_plots(string mcjzb, string datajzb, bool doPF=false)
888   {
889   //  switch_overunderflow(true);
890    bool dolog=true;
891    bool nolog=false;
892  
893 <  bool doOFSF = true;
893 >  bool doOFSF = false;
894    bool doKin  = true;
895 <  bool doDataComp = true;
895 >  bool doDataComp = false;
896 >  bool MakeTwoThreeJetComparison = false;
897    
898  
899    if(doPF) write_warning(__FUNCTION__,"Please use caution when trying to produce PF plots; not all versions of the JZB trees have these variables!");
# Line 763 | Line 903 | void do_kinematic_plots(string mcjzb, st
903          mll_low=20;
904          mll_hi=320;
905    }
906 +  
907 +  if(MakeTwoThreeJetComparison) MakeElegantTwoThreeComparisons();
908  
909    if ( doOFSF ) {
910 <    make_OFSF_plots("mll", "met[4]>100", 60, 20., 320., false, "m_{ll}", "mll");
910 >     make_OFSF_plots("mll", "met[4]>100", 60, 20., 320., false, "m_{ll}", "mll");
911  
912 <    make_OFSF_plots("pfJetGoodNum40", "met[4]>100",                        7, 3, 10, true, "#(jets)", "njets");
913 < //     make_OFSF_plots("pfJetGoodNum40", "met[4]>100&&pfJetGoodNumBtag30==0", 7, 3, 10, true, "#(jets)", "njets_btagVeto");
914 < //     make_OFSF_plots("pfJetGoodNum40", "met[4]>100&&pfJetGoodNumBtag30>0",  7, 3, 10, true, "#(jets)", "njets_AtLeastOneBJet30");
912 > //      make_OFSF_plots("pfJetGoodNum40", "met[4]>100",                        7, 3, 10, true, "#(jets)", "njets");
913 > //      make_OFSF_plots("pfJetGoodNum40", "met[4]>100&&pfJetGoodNumBtag30==0", 7, 3, 10, true, "#(jets)", "njets_btagVeto");
914 > //      make_OFSF_plots("pfJetGoodNum40", "met[4]>100&&pfJetGoodNumBtag30>0",  7, 3, 10, true, "#(jets)", "njets_AtLeastOneBJet30");
915  
916 < //     make_OFSF_plots("pfJetGoodNumBtag30", "met[4]>100", 5, 0, 5, true, "#(b-jets)", "nbjets");
917 < //     make_OFSF_plots("pfJetGoodPtBtag[0]", "met[4]>100&&pfJetGoodNumBtag30>0", 20, 0, 400, true, "p_{T}(leading b-jet)", "ptb1");
916 > //      make_OFSF_plots("pfJetGoodNumBtag30", "met[4]>100", 5, 0, 5, true, "#(b-jets)", "nbjets");
917 > //      make_OFSF_plots("pfJetGoodPtBtag[0]", "met[4]>100&&pfJetGoodNumBtag30>0", 20, 0, 400, true, "p_{T}(leading b-jet)", "ptb1");
918  
919   //     make_OFSF_plots("iso1", "met[4]>100", 20, 0, 0.3, true, "lepton 1 isolation", "iso1");
920   //     make_OFSF_plots("iso2", "met[4]>100", 20, 0, 0.3, true, "lepton 2 isolation", "iso2");
# Line 782 | Line 924 | void do_kinematic_plots(string mcjzb, st
924   //     make_OFSF_plots("eta2", "met[4]>100", 10, -2.5, 2.5, false, "#eta_{2}", "eta2", 0.15);
925      //  make_OFSF_plots("phi1", "met[4]>100", 10, -TMath::Pi(), TMath::Pi(), false, "#phi_{1}", "phi1", 0.2);
926      //  make_OFSF_plots("phi2", "met[4]>100", 10, -TMath::Pi(), TMath::Pi(), false, "#phi_{2}", "phi2", 0.2);
927 <    make_OFSF_plots("pfJetGoodPt[0]/pfJetGoodPt[1]", "met[4]>100", 20, 1, 10, true, "pt_{j}^{1}/pt_{j}^{2}", "jpt1pt2", 0.2);
927 > //     make_OFSF_plots("pfJetGoodPt[0]/pfJetGoodPt[1]", "met[4]>100", 20, 1, 10, true, "pt_{j}^{1}/pt_{j}^{2}", "jpt1pt2", 0.2);
928      make_OFSF_plots("TMath::Abs(pfJetDphiMet[0])", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(jet1,MET)|", "dphij1met", 0.2);
929 <    make_OFSF_plots("TMath::Abs(dphi)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l1,l2)|", "dphi", 0.2);
930 <    make_OFSF_plots("TMath::Abs(dphiMet1)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l1,MET)|", "dphiMet1", 0.2);
931 <    make_OFSF_plots("TMath::Abs(dphiMet2)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l2,MET)|", "dphiMet2", 0.2);
932 <    make_OFSF_plots("TMath::Min(TMath::Abs(dphiMet1), TMath::Abs(dphiMet2))", "met[4]>100", 16, 0, 3.2, false, "Min(|#Delta#phi(l,MET)|)", "dphilc");
933 <    make_OFSF_plots("TMath::Min(TMath::Abs(pfJetDphiMet[0]), TMath::Min(TMath::Abs(pfJetDphiMet[1]), TMath::Abs(pfJetDphiMet[2])))", "met[4]>100", 16, 0, 3.2, false, "Min(|#Delta#phi(jet,MET)|)", "dphijc");
934 <    make_OFSF_plots("TMath::Min((TMath::Pi()-TMath::Abs(dphiMet1)), (TMath::Pi() - TMath::Abs(dphiMet2)))", "met[4]>100", 16, 0, 3.2, false, "Min(#pi - |#Delta#phi(l,MET)|)", "dphilco");
935 <    make_OFSF_plots("TMath::Min((TMath::Pi()-TMath::Abs(pfJetDphiMet[0])), TMath::Min( (TMath::Pi()-TMath::Abs(pfJetDphiMet[1])), (TMath::Pi() - TMath::Abs(pfJetDphiMet[2]))))", "met[4]>100", 16, 0, 3.2, false, "Min(#pi - |#Delta#phi(jet,MET)|)", "dphijco");
929 > //    make_OFSF_plots("TMath::Abs(dphi)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l1,l2)|", "dphi", 0.2);
930 > //    make_OFSF_plots("TMath::Abs(dphiMet1)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l1,MET)|", "dphiMet1", 0.2);
931 > //    make_OFSF_plots("TMath::Abs(dphiMet2)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l2,MET)|", "dphiMet2", 0.2);
932 > //    make_OFSF_plots("TMath::Min(TMath::Abs(dphiMet1), TMath::Abs(dphiMet2))", "met[4]>100", 16, 0, 3.2, false, "Min(|#Delta#phi(l,MET)|)", "dphilc");
933 > //    make_OFSF_plots("TMath::Min(TMath::Abs(pfJetDphiMet[0]), TMath::Min(TMath::Abs(pfJetDphiMet[1]), TMath::Abs(pfJetDphiMet[2])))", "met[4]>100", 16, 0, 3.2, false, "Min(|#Delta#phi(jet,MET)|)", "dphijc");
934 > //    make_OFSF_plots("TMath::Min((TMath::Pi()-TMath::Abs(dphiMet1)), (TMath::Pi() - TMath::Abs(dphiMet2)))", "met[4]>100", 16, 0, 3.2, false, "Min(#pi - |#Delta#phi(l,MET)|)", "dphilco");
935 > //    make_OFSF_plots("TMath::Min((TMath::Pi()-TMath::Abs(pfJetDphiMet[0])), TMath::Min( (TMath::Pi()-TMath::Abs(pfJetDphiMet[1])), (TMath::Pi() - TMath::Abs(pfJetDphiMet[2]))))", "met[4]>100", 16, 0, 3.2, false, "Min(#pi - |#Delta#phi(jet,MET)|)", "dphijco");
936    }
937  
938 <  if ( doDataComp && !PlottingSetup::openBox ) {
938 >  if ( doDataComp) {
939      TCut mllCut("");
940      float massmin = 15.;
941      float massmax = 315;
942      int massnbins = 60;
943 <    if ( !PlottingSetup::openBox ) {
944 <      mllCut = "mll>120";
943 > /*    if ( !PlottingSetup::openBox ) {
944 >      mllCut = "mll>70";
945        massmin = 120;
946        massmax = 360;
947        massnbins = 14;
948 <    }
948 >    }*/
949  
950      TCut cutSignal = cutmass&&cutnJets&&"met[4]>100";
951 <    make_data_comparison_plot("mll", cutOSSF,60, 15., 315.,-1., true, "m_{ll}", "mll_SF_inclusive");
952 <    make_data_comparison_plot("mll", cutOSOF,60, 15., 315.,-1., true, "m_{ll}", "mll_OF_inclusive");
953 <
951 >    
952 > /*    make_data_comparison_plot("numVtx", "",40, -0.5, 39.5,-1., true, "N(Vertices)", "numVtx");
953 >    make_data_comparison_plot("pfJetGoodEta[0]", "",50, -3.0, 3.0,-1., true, "N(Jets)", "pfJetGoodEta0");
954 >    
955 >    
956 >    make_data_comparison_plot("pfJetGoodNum40", cutOSOF,10, -0.5, 9.5,-1., true, "N(Jets)", "njets_OF");
957 >    make_data_comparison_plot("met[4]", cutOSSF,60, 0., 300.,-1., true, "pfMET", "met_SF_inclusive");
958 >    make_data_comparison_plot("met[1]", cutOSSF,60, 0., 300.,-1., true, "type 1 corrected pfMET", "mett1_SF_inclusive");
959 >    make_data_comparison_plot("met[4]", cutOSOF,60, 0., 300.,-1., true, "pfMET", "met_OF_inclusive");
960 >    make_data_comparison_plot("met[1]", cutOSOF,60, 0., 300.,-1., true, "type 1 corrected pfMET", "mett1_OF_inclusive");
961 >    
962 >    make_data_comparison_plot("met[4]", cutnJets&&cutOSSF,60, 0., 300.,-1., true, "pfMET", "met_SF_exclusive");
963 > //    make_data_comparison_plot("met[1]", cutnJets&&cutOSSF,60, 0., 300.,-1., true, "type 1 corrected pfMET", "mett1_SF_exclusive");
964 >    make_data_comparison_plot("met[4]", cutnJets&&cutOSOF,60, 0., 300.,-1., true, "pfMET", "met_OF_exclusive");
965 > //    make_data_comparison_plot("met[1]", cutnJets&&cutOSOF,60, 0., 300.,-1., true, "type 1 corrected pfMET", "mett1_OF_exclusive");
966 > */
967 >  
968 >    string basiccutsaved = (const char*)basiccut;
969 >    
970 >    string newbasiccut=basiccutsaved;
971 >    
972 >    size_t found;
973 >    found = newbasiccut.find( "pt2>20" );
974 >    while (found!=string::npos){
975 >      newbasiccut.replace( found, string( "pt2>20" ).length(), "pt2>10" );
976 >      found = newbasiccut.find( "pt2>20" );
977 >    }
978 > //    basiccut=TCut(newbasiccut.c_str());
979 > //    make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=2&&met[4]>150")&&cutOSSF,60, 0., 300.,-1., false, "mll", "mll_SF_Aachen_pt2010_met");
980 > //    make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=2&&met[4]>150")&&cutOSOF,60, 0., 300.,-1., false, "mll", "mll_OF_Aachen_pt2010_met");
981 > //    make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=2&&met[1]>150")&&cutOSSF,60, 0., 300.,-1., true, "mll", "mll_SF_Aachen_pt2010_t1cpfmet");
982 > //    make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=2&&met[1]>150")&&cutOSOF,60, 0., 300.,-1., true, "mll", "mll_OF_Aachen_pt2010_t1cpfmet");
983 > //    basiccut=TCut(basiccutsaved.c_str());
984 >    
985 > //     make_data_comparison_plot("pfJetGoodNum40", cutOSSF, 8, 0., 8.,-1., true, "#(jets)", "njets_SF");
986 > //     make_data_comparison_plot("pfJetGoodNum40", cutOSOF, 8, 0., 8.,-1., true, "#(jets)", "njets_OF");
987 >    
988 > //     make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=3&&met[4]>100")&&cutOSSF,60, 0., 300.,-1., true, "mll", "mll_SF_ETH_met");
989 > //     make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=3&&met[4]>100")&&cutOSOF,60, 0., 300.,-1., true, "mll", "mll_OF_ETH_met");
990 > //     make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=3&&met[1]>100")&&cutOSSF,60, 0., 300.,-1., true, "mll", "mll_SF_ETH_t1cpfmet");
991 > //     make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=3&&met[1]>100")&&cutOSOF,60, 0., 300.,-1., true, "mll", "mll_OF_ETH_t1cpfmet");
992 >
993 >    
994 > /*     make_data_comparison_plot("mll", cutOSSF,60, 15., 315.,-1., true, "m_{ll}", "mll_SF_inclusive");
995 >     make_data_comparison_plot("mll", cutOSSF&&TCut("id1==0"),60, 15., 315.,-1., true, "m_{ll}", "mll_SF_inclusive_ee");
996 >     make_data_comparison_plot("mll", cutOSSF&&TCut("id1==1"),60, 15., 315.,-1., true, "m_{ll}", "mll_SF_inclusive_mm");
997 >     make_data_comparison_plot("mll", cutOSOF,60, 15., 315.,-1., true, "m_{ll}", "mll_OF_inclusive");
998 >    make_data_comparison_plot("mll", cutnJets&&cutOSSF&&TCut("id1==0"),60, 15., 315.,-1., true, "m_{ll}", "mll_SF_exclusive_ee");
999 >    make_data_comparison_plot("mll", cutnJets&&cutOSSF&&TCut("id1==1"),60, 15., 315.,-1., true, "m_{ll}", "mll_SF_exclusive_mm");
1000 >    make_data_comparison_plot("mll", cutnJets&&cutOSSF,60, 15., 315.,-1., true, "m_{ll}", "mll_SF_exclusive");
1001 >    make_data_comparison_plot("mll", cutnJets&&cutOSOF,60, 15., 315.,-1., true, "m_{ll}", "mll_OF_exclusive");
1002 > */
1003      make_data_comparison_plot("mll", cutOSSF&&cutSignal&&mllCut,           massnbins, 15., 315.,-1., false, "m_{ll}", "mll_SF_sig");
1004 +    make_data_comparison_plot("mll", cutOSOF&&cutSignal&&mllCut,           massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_sig");
1005 +    
1006 +    make_data_comparison_plot("mll", TCut("abs(eta1)<1.4&&abs(eta2)<1.4") && cutOSSF&&cutSignal&&mllCut,           massnbins, 15., 315.,-1., false, "m_{ll}", "mll_SF_sig_central");
1007 +    make_data_comparison_plot("mll", TCut("abs(eta1)<1.4&&abs(eta2)<1.4") && cutOSOF&&cutSignal&&mllCut,           massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_sig_central");
1008 +    
1009      make_data_comparison_plot("mll", cutOSSF&&cutSignal&&mllCut&&"pfJetGoodNumBtag30==0", massnbins, 15., 315.,-1., false, "m_{ll}", "mll_SF_sig_btagVeto");
1010 +    make_data_comparison_plot("mll", cutOSOF&&cutSignal&&mllCut&&"pfJetGoodNumBtag30==0", massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_sig_btagVeto");
1011 +    
1012      make_data_comparison_plot("mll", cutOSSF&&cutSignal&&mllCut&&"pfJetGoodNumBtag30>0",  massnbins, 15., 315.,-1., false, "m_{ll}", "mll_SF_sig_AtLeastOneBJet");
1013 +    make_data_comparison_plot("mll", cutOSOF&&cutSignal&&mllCut&&"pfJetGoodNumBtag30>0",  massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_sig_AtLeastOneBJet");
1014  
1015 + /*
1016      make_data_comparison_plot("mll", mllCut&&cutOSOF&&cutSignal, massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_sig");
1017      make_data_comparison_plot("mll", cutmass&&cutOSSF&&"met[4]>100&&met[4]<150&&pfJetGoodNum40==2", massnbins, 15., 315.,-1., false, "m_{ll}", "mll_SF_CR");
1018      make_data_comparison_plot("mll", cutmass&&cutOSOF&&"met[4]>100&&met[4]<150&&pfJetGoodNum40==2", massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_CR");
# Line 821 | Line 1021 | void do_kinematic_plots(string mcjzb, st
1021      make_data_comparison_plot("pfJetGoodNum40", cutOSOF&&cutSignal&&mllCut, 8, 0., 8.,-1., false, "#(jets)", "njets_OF_sig");
1022      make_data_comparison_plot("pfJetGoodNumBtag30", cutOSSF&&cutSignal&&mllCut, 8, 0., 8.,-1., false, "#(b-jets)", "nbjets_SF_sig");
1023      make_data_comparison_plot("pfJetGoodNumBtag30", cutOSOF&&cutSignal&&mllCut, 8, 0., 8.,-1., false, "#(b-jets)", "nbjets_OF_sig");
1024 +  */
1025    }
1026  
1027  
1028    if ( doKin ) {
1029      string mllCut("");
1030 <    if ( !PlottingSetup::openBox ) mllCut = "&&mll>120";
1031 <
1032 <    make_kin_plot("pfJetGoodPt[0]/pfJetGoodPt[1]","",45,1,10,dolog,"pt_{j}^{1}/pt_{j}^{2}","j1j2ratio",doPF,true);
1033 <    make_kin_plot("TMath::Abs(pfJetDphiMet[0])","",32,0,3.2,nolog,"|#Delta#phi(jet1,MET)|","dphiJ1MET",doPF,true);
1030 > /*  
1031 >    make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==0")),40,0,400,dolog,"PFMET","Debunking/MET_OF_30to70_0j",doPF,true);
1032 >    make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==1")),40,0,400,dolog,"PFMET","Debunking/MET_OF_30to70_1j",doPF,true);
1033 >    make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==2")),40,0,400,dolog,"PFMET","Debunking/MET_OF_30to70_2j",doPF,true);
1034 >    make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==3")),40,0,400,dolog,"PFMET","Debunking/MET_OF_30to70_3j",doPF,true);
1035 >
1036 >    make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfJetGoodNum40==0")),40,0,400,dolog,"PFMET","Debunking/MET_OF_Z_0j",doPF,true);
1037 >    make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfJetGoodNum40==1")),40,0,400,dolog,"PFMET","Debunking/MET_OF_Z_1j",doPF,true);
1038 >    make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfTightHT>100&&pfJetGoodNum40==2")),40,0,400,dolog,"PFMET","Debunking/MET_OF_Z_2j",doPF,true);
1039 >    make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfTightHT>100&&pfJetGoodNum40==3")),40,0,400,dolog,"PFMET","Debunking/MET_OF_Z_3j",doPF,true);
1040 > */
1041 >
1042 >    make_plain_kin_plot("pfTightHT",Cut2Str(cutOSOF&&cutnJets),120,0,1200,dolog,"H_{T}","HT_3jets_OF",doPF,true);
1043 >    make_plain_kin_plot("pfTightHT",Cut2Str(cutOSSF&&cutnJets) ,120,0,1200,dolog,"H_{T}","HT_3jets_SF",doPF,true);
1044 >    make_plain_kin_plot("pfTightHT",Cut2Str(cutOSOF&&cutnJets&&TCut("met[4]>100")),120,0,1200,dolog,"H_{T}","HT_3jets_OF_MET100",doPF,true);
1045 >    make_plain_kin_plot("pfTightHT",Cut2Str(cutOSSF&&cutnJets&&TCut("met[4]>100")) ,120,0,1200,dolog,"H_{T}","HT_3jets_SF_MET100",doPF,true);
1046 >
1047 >    
1048 >    make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==0")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_30to70_0j",doPF,true);
1049 >    make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==1")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_30to70_1j",doPF,true);
1050 >    make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==2")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_30to70_2j",doPF,true);
1051 >    make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==3")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_30to70_3j",doPF,true);
1052 >
1053 >    make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfJetGoodNum40==0")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_Z_0j",doPF,true);
1054 >    make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfJetGoodNum40==1")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_Z_1j",doPF,true);
1055 >    make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfTightHT>100&&pfJetGoodNum40==2")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_Z_2j",doPF,true);
1056 >    make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfTightHT>100&&pfJetGoodNum40==3")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_Z_3j",doPF,true);
1057 >
1058 >     /*make_plain_kin_plot("met[4]",Cut2Str(cutOSSF&&cutnJets&&TCut("mll>20&&mll<70")),50,0,300,dolog,"PFMET","MET_SF_20to70",doPF,true);
1059 >     make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&cutnJets&&TCut("mll>20&&mll<70")),50,0,300,dolog,"PFMET","MET_OF_20to70",doPF,true);
1060 >    
1061 >     make_plain_kin_plot("met[4]",Cut2Str(cutOSSF&&cutnJets&&TCut("mll>120")),50,0,300,dolog,"PFMET","MET_SF_above120",doPF,true);
1062 >     make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&cutnJets&&TCut("mll>120")),50,0,300,dolog,"PFMET","MET_OF_above120",doPF,true);*/
1063 >    
1064 > /*     make_plain_kin_plot("met[4]",Cut2Str(cutOSSF&&TCut("pfJetGoodNum40==2")&&TCut("mll>20&&mll<70")),50,0,300,dolog,"PFMET","MET_SF_20to70___2jetsonly",doPF,true);
1065 >     make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("pfJetGoodNum40==2")&&TCut("mll>20&&mll<70")),50,0,300,dolog,"PFMET","MET_OF_20to70___2jetsonly",doPF,true);
1066 >    
1067 >     make_plain_kin_plot("met[4]",Cut2Str(cutOSSF&&TCut("pfJetGoodNum40==2")&&TCut("mll>120")),50,0,300,dolog,"PFMET","MET_SF_above120___2jetsonly",doPF,true);
1068 >     make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("pfJetGoodNum40==2")&&TCut("mll>120")),50,0,300,dolog,"PFMET","MET_OF_above120___2jetsonly",doPF,true);
1069 > */
1070 >    write_info(__FUNCTION__,"Last plot");
1071 >    
1072 >    
1073 >    
1074 >    
1075 >    
1076 >    
1077 >    
1078 >    
1079 >     return;
1080 >    
1081 >    
1082 >    
1083 >     make_kin_plot("pfJetGoodPt[0]/pfJetGoodPt[1]","",45,1,10,dolog,"pt_{j}^{1}/pt_{j}^{2}","j1j2ratio",doPF,true);
1084 >     make_kin_plot("TMath::Abs(pfJetDphiMet[0])","",32,0,3.2,nolog,"|#Delta#phi(jet1,MET)|","dphiJ1MET",doPF,true);
1085      // Plots in signal region
1086   //     make_kin_plot("met[4]","",70,0,350,dolog,"MET [GeV]","met",doPF,true);
1087 <    make_kin_plot("mll","mll>20"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll",doPF,true);
1088 <    make_kin_plot("mll","mll>20",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof",doPF,true,true);
1089 <    make_kin_plot("mll","mll>20"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_ee",doPF,true);
1090 <    make_kin_plot("mll","mll>20"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_mm",doPF,true);
1091 <    
1092 <    make_kin_plot("pfJetGoodNum40",mllCut,9,-0.5,8.5,dolog,"nJets","nJets",doPF);
1093 <    make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_osof",doPF);
1094 <    
1095 <    make_kin_plot("mll","mll>20&&met[4]>100"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_met100",doPF,true);
1096 <    make_kin_plot("mll","mll>20&&met[4]>100",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof_met100",doPF,true,true);
1097 <    make_kin_plot("mll","mll>20&&met[4]>100"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_ee_met100",doPF,true);
1098 <    make_kin_plot("mll","mll>20&&met[4]>100"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_mm_met100",doPF,true);
1087 >     make_kin_plot("mll","mll>20"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll",doPF,true);
1088 >     make_kin_plot("mll","mll>20",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof",doPF,true,true);
1089 >     make_kin_plot("mll","mll>20"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_ee",doPF,true);
1090 >     make_kin_plot("mll","mll>20"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_mm",doPF,true);
1091 >    
1092 >     make_kin_plot("pfJetGoodNum40",mllCut,9,-0.5,8.5,dolog,"nJets","nJets",doPF);
1093 >     make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_osof",doPF);
1094 >    
1095 > //     make_kin_plot("mll","mll>20&&met[4]>100"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_met100",doPF,true);
1096 > //     make_kin_plot("mll","mll>20&&met[4]>100",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof_met100",doPF,true,true);
1097 > //     make_kin_plot("mll","mll>20&&met[4]>100"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_ee_met100",doPF,true);
1098 > //     make_kin_plot("mll","mll>20&&met[4]>100"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_mm_met100",doPF,true);
1099      
1100 <    make_kin_plot("pfJetGoodNum40","met[4]>100"+mllCut,9,-0.5,8.5,dolog,"nJets","nJets_met100",doPF);
1101 <    make_kin_plot("pfJetGoodNum40","met[4]>100",9,-0.5,8.5,dolog,"nJets","nJets_osof_met100",doPF);
1100 >    
1101 > //     make_kin_plot("pfJetGoodNum40","met[4]>100"+mllCut,9,-0.5,8.5,dolog,"nJets","nJets_met100",doPF);
1102 > //     make_kin_plot("pfJetGoodNum40","met[4]>100",9,-0.5,8.5,dolog,"nJets","nJets_osof_met100",doPF);
1103  
1104      // Further inclusive invariant mass plots
1105 <    make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive",doPF,true);
1106 <    make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_ee",doPF,true);
1107 <    make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_mm",doPF,true);
1108 <    make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_osof",doPF,true);
1105 >    make_kin_plot("mll",mllCut,(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive",doPF,true);
1106 > //     make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_ee",doPF,true);
1107 > //     make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_mm",doPF,true);
1108 >    make_kin_plot("mll",mllCut,(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_osof",doPF,true);
1109      
1110      //make_kin_plot("mll","",(int)((350-mll_low))/5,mll_low,350,dolog,"m_{ll} [GeV]","mll_inclusive_highrange",doPF);
1111      //if(!doPF) make_special_mll_plot((int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]");
# Line 947 | Line 1200 | void make_comp_plot( string var, string
1200        if (ymax>ymin) datahisto->SetMaximum(ymax);
1201        lm3histo->SetLineStyle(2);
1202        datahisto->Draw("e1");
1203 <      mcstack.Draw("same");
1203 >      mcstack.Draw("histo,same");
1204        datahisto->Draw("same,e1");
1205        lm3histo->Draw("hist,same");
1206        TLegend *kinleg = allsamples.allbglegend((sRegions[iregion]+(ijzb?"neg":"pos")).c_str());
# Line 1530 | Line 1783 | void do_prediction_plot(string jzb, TCan
1783   //    THStack kostack = allsamples.DrawStack("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,!is_data, luminosity,use_signal);
1784      blankback->Draw();
1785   //    kostack.Draw("same");
1786 <    predcomposition.Draw();
1786 >    predcomposition.Draw("hist");
1787      Bpred->Draw("hist,same");
1788      //analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same");
1789      RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP!
# Line 1904 | Line 2157 | void draw_pure_jzb_histo(TCut cut,string
2157    datahisto->SetMinimum(0.1);
2158    datahisto->SetMarkerSize(DataMarkerSize);
2159    datahisto->Draw("e1");
2160 <  mcstack.Draw("same");
2160 >  mcstack.Draw("histo,same");
2161    datahisto->Draw("same,e1");
2162    
2163    TLegend *leg;
# Line 1935 | Line 2188 | void draw_pure_jzb_histo(TCut cut,string
2188    datahisto->SetMinimum(0.1);
2189    datahisto->SetMarkerSize(DataMarkerSize);
2190    datahisto->Draw("e1");
2191 <  mcstack.Draw("same");
2191 >  mcstack.Draw("histo,same");
2192    datahisto->Draw("same,e1");
2193    leg->SetHeader("");
2194    leg->Draw();
# Line 2659 | Line 2912 | void ttbar_sidebands_comparison(string m
2912        
2913    float simulatedlumi = luminosity; //in pb please - adjust to your likings
2914  
2915 <  TH1F *TZem  = systsamples.Draw("TZem",     mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets"));
2916 <  TH1F *nTZem = systsamples.Draw("nTZem","-"+mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets"));
2915 >  TH1F *TZem  = systsamples.Draw("TZem",     mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTT"));
2916 >  TH1F *nTZem = systsamples.Draw("nTZem","-"+mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTT"));
2917    TH1F *TSem;
2918    TH1F *nTSem;
2919 <  TH1F *TZeemm  = systsamples.Draw("TZeemm",     mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets"));
2920 <  TH1F *nTZeemm = systsamples.Draw("nTZeemm","-"+mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets"));
2919 >  TH1F *TZeemm  = systsamples.Draw("TZeemm",     mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTT"));
2920 >  TH1F *nTZeemm = systsamples.Draw("nTZeemm","-"+mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTT"));
2921    TH1F *TSeemm;
2922    TH1F *nTSeemm;
2923    
2924    if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) {
2925 <    TSem    = systsamples.Draw("TSem",       mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets"));
2926 <    nTSem   = systsamples.Draw("nTSem",  "-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets"));
2927 <    TSeemm  = systsamples.Draw("TSeemm",     mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets"));
2928 <    nTSeemm = systsamples.Draw("nTSeemm","-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets"));
2925 >    TSem    = systsamples.Draw("TSem",       mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTT"));
2926 >    nTSem   = systsamples.Draw("nTSem",  "-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTT"));
2927 >    TSeemm  = systsamples.Draw("TSeemm",     mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTT"));
2928 >    nTSeemm = systsamples.Draw("nTSeemm","-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTT"));
2929    }
2930  
2931    TCanvas *tcan = new TCanvas("tcan","tcan");
# Line 2931 | Line 3184 | void ttbar_sidebands_comparison(string m
3184   }
3185  
3186  
3187 < void zjets_prediction_comparison(string mcjzbWithPUa) {
3187 > void zjets_prediction_comparison(string mcjzbWithPUa, TCut massregioncut, string massregionname) {
3188    cout << "****************************************************************************************************************************************************************" << endl;
3189    TCanvas *zcan = new TCanvas("zcan","zcan");  
3190   //  zcan->SetLogy(1);
# Line 2983 | Line 3236 | void zjets_prediction_comparison(string
3236    TCut ee_mm_tautau("mll>0");
3237    
3238  
3239 <  TH1F *hJZBpos = systsamples.Draw("hJZBpos",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&&notTau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY"));
3240 <  TH1F *hJZBneg = systsamples.Draw("hJZBneg",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&&notTau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY"));
3239 >  TH1F *hJZBpos = systsamples.Draw("hJZBpos",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&&notTau&&kPos&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY"));
3240 >  TH1F *hJZBneg = systsamples.Draw("hJZBneg",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&&notTau&&kNeg&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY"));
3241    
3242    hJZBpos->SetLineColor(kBlack);
3243    hJZBneg->SetLineColor(kRed);
# Line 2999 | Line 3252 | void zjets_prediction_comparison(string
3252    leg->AddEntry(hJZBneg,"Predicted","l");
3253    leg->Draw("same");
3254    DrawMCPrelim(simulatedlumi);
3255 <  CompleteSave(zcan,"Systematics/ZJets/zjets_eemm_prediction");
3255 >  CompleteSave(zcan,"Systematics/ZJets/zjets_eemm_prediction"+any2string(massregionname));
3256    
3257    TH1F* hratio = (TH1F*)hJZBpos->Clone("hratio");
3258    hratio->Divide(hJZBneg);
# Line 3008 | Line 3261 | void zjets_prediction_comparison(string
3261      cout << "Positive: " << hJZBpos->GetBinContent(i) << "   vs    Negative : " << hJZBneg->GetBinContent(i) << "   (ratio : " << hJZBpos->GetBinContent(i) / hJZBneg->GetBinContent(i) << endl;
3262    }
3263    
3264 <  zcan->SetLogy(0);
3264 > //  zcan->SetLogy(0);
3265    hratio->GetYaxis()->SetRangeUser(0,2.5);
3266    hratio->GetYaxis()->SetTitle("Observed/Predicted");
3267    hratio->Draw("e1");
# Line 3018 | Line 3271 | void zjets_prediction_comparison(string
3271    TLine *bottom = new TLine(binning[0],0.75,binning[binning.size()-1],0.75);
3272    
3273  
3274 +  cout << __LINE__ << endl;
3275    top->SetLineColor(kBlue);top->SetLineStyle(2);
3276    bottom->SetLineColor(kBlue);bottom->SetLineStyle(2);
3277    center->SetLineColor(kBlue);
# Line 3031 | Line 3285 | void zjets_prediction_comparison(string
3285    leg2->AddEntry(bottom,"syst. envelope","l");
3286    leg2->Draw("same");
3287    DrawMCPrelim(simulatedlumi);
3288 <  CompleteSave(zcan,"Systematics/ZJets/zjets_eemm_prediction_ratio");
3288 >  CompleteSave(zcan,"Systematics/ZJets/zjets_eemm_prediction_ratio"+any2string(massregionname));
3289    
3290    TCut reducedNJets(cutnJets);
3291    
3292 <  TH1F *TAUhJZBpos = systsamples.Draw("TAUhJZBpos",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY"));
3293 <  TH1F *LcorrJZBeemm     = systsamples.Draw("LcorrJZBeemm",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY"));
3294 <  TH1F *RcorrJZBem       = systsamples.Draw("RcorrJZBem",var,binning, "JZB [GeV]", "events",cutmass&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY"));
3295 <  TH1F *LcorrJZBem       = systsamples.Draw("LcorrJZBem",var,binning, "JZB [GeV]", "events",cutmass&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY"));
3292 >  TH1F *TAUhJZBpos       = systsamples.Draw("TAUhJZBpos",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kPos&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY"));
3293 >  TH1F *LcorrJZBeemm     = systsamples.Draw("LcorrJZBeemm",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kNeg&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY"));
3294 >  TH1F *RcorrJZBem       = systsamples.Draw("RcorrJZBem",var,binning, "JZB [GeV]", "events",cutmass&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kPos&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY"));
3295 >  TH1F *LcorrJZBem       = systsamples.Draw("LcorrJZBem",var,binning, "JZB [GeV]", "events",cutmass&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kNeg&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY"));
3296  
3297 +  cout << __LINE__ << endl;
3298    TH1F *RcorrJZBSBem;
3299    TH1F *LcorrJZBSBem;
3300    TH1F *RcorrJZBSBeemm;
3301    TH1F *LcorrJZBSBeemm;
3302  
3303 +  cout << __LINE__ << endl;
3304    if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) {
3305 <    RcorrJZBSBem   = systsamples.Draw("RcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY"));
3306 <    LcorrJZBSBem   = systsamples.Draw("LcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY"));
3307 <    RcorrJZBSBeemm = systsamples.Draw("RcorrJZBSBeemm",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY"));
3308 <    LcorrJZBSBeemm = systsamples.Draw("LcorrJZBSBeemm",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY"));
3305 >    RcorrJZBSBem   = systsamples.Draw("RcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kPos&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY"));
3306 >    LcorrJZBSBem   = systsamples.Draw("LcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kNeg&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY"));
3307 >    RcorrJZBSBeemm = systsamples.Draw("RcorrJZBSBeemm",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kPos&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY"));
3308 >    LcorrJZBSBeemm = systsamples.Draw("LcorrJZBSBeemm",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kNeg&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY"));
3309    }
3310    
3311    TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred");
# Line 3067 | Line 3323 | void zjets_prediction_comparison(string
3323    
3324    Bpred->SetLineColor(kRed);
3325  
3326 +  cout << __LINE__ << endl;
3327    TAUhJZBpos->SetLineColor(kBlack);
3328    Bpred->SetLineColor(kRed);
3329    
# Line 3080 | Line 3337 | void zjets_prediction_comparison(string
3337    TAUleg->AddEntry(Bpred,"Predicted","l");
3338    TAUleg->Draw("same");
3339    DrawMCPrelim(simulatedlumi);
3340 <  CompleteSave(zcan,"Systematics/ZJets/zjets_eemumutautau_prediction");
3340 >  CompleteSave(zcan,"Systematics/ZJets/zjets_eemumutautau_prediction__"+any2string(massregionname));
3341    
3342    TH1F* TAUhratio = (TH1F*)TAUhJZBpos->Clone("TAUhratio");
3343    TAUhratio->Divide(Bpred);
# Line 3103 | Line 3360 | void zjets_prediction_comparison(string
3360    TAUleg2->AddEntry(bottom,"syst. envelope","l");
3361    TAUleg2->Draw("same");
3362    DrawMCPrelim(simulatedlumi);
3363 <  CompleteSave(zcan,"Systematics/ZJets/zjets_eemumutautau_prediction_ratio");
3363 >  CompleteSave(zcan,"Systematics/ZJets/zjets_eemumutautau_prediction_ratio"+any2string(massregionname));
3364    
3365    delete Bpred;
3366    delete TAUhJZBpos;
3367    delete LcorrJZBeemm;
3368    delete RcorrJZBem;
3369    delete LcorrJZBem;
3370 +  delete hJZBpos;
3371 +  delete hJZBneg;
3372    
3373    if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) {
3374      delete RcorrJZBSBem;
# Line 3122 | Line 3381 | void zjets_prediction_comparison(string
3381    delete zcan;
3382    cutWeight=weightbackup;
3383  
3384 +  cout << __LINE__ << endl;
3385   }
3386  
3387  
3388 <
3388 > void zjets_prediction_comparison(string mcjzbWithPUa) {
3389 >  zjets_prediction_comparison(mcjzbWithPUa, TCut(""), "nomasscut");
3390 >  zjets_prediction_comparison(mcjzbWithPUa, TCut("abs(mll-91)<20"), "Zwindow_20");
3391 >  zjets_prediction_comparison(mcjzbWithPUa, TCut("mll>20&&mll<70"), "LowMassRegion2070");
3392 >  zjets_prediction_comparison(mcjzbWithPUa, TCut("mll>110"), "HighMassRegion110");
3393 > }
3394 >  
3395   void sideband_assessment(string datajzb, float min=30.0, float max=50.0) {
3396    tout << endl << endl;
3397    stringstream bordercut;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines