ra4_macros  bede988c286599a3a84b77a4d788ac0a971e89f9
plot_isr.cxx
Go to the documentation of this file.
1 #include "styles.hpp"
2 #include "utilities.hpp"
3 #include "utilities_macros.hpp"
4 
5 namespace {
6  TString luminosity="2.1";
7  TString plot_type=".pdf";
8  TString plot_style="CMSPaper";
9 }
10 
11 using namespace std;
12 
13 int main(){
14 
15  TString skim = "zisr";
16  TString folder1l("/cms2r0/babymaker/babies/2015_11_20/data/singlelep/combined/skim_"+skim+"/");
17  TString foldermc("/cms2r0/babymaker/babies/2015_11_28/mc/skim_"+skim+"/");
18  TString folderdy("/cms2r0/babymaker/babies/2015_11_28/mc/skim_"+skim+"/");
19 
20  vector<TString> s_slep;
21  s_slep.push_back(folder1l+"*root");
22 
23  vector<TString> s_t1t;
24  s_t1t.push_back(foldermc+"*T1tttt*1500_*");
25  vector<TString> s_t1tc;
26  s_t1tc.push_back(foldermc+"*T1tttt*1200_*");
27  vector<TString> s_tt;
28  s_tt.push_back(foldermc+"*_TTJets*Lept*");
29  s_tt.push_back(foldermc+"*_TTJets_HT*");
30  vector<TString> s_ttv;
31  s_ttv.push_back(foldermc+"*_TTWJets*");
32  s_ttv.push_back(foldermc+"*_TTZTo*");
33  s_ttv.push_back(foldermc+"*_TTG*");
34  s_ttv.push_back(foldermc+"*_TTTT*");
35  vector<TString> s_vv;
36  s_vv.push_back(foldermc+"*_WZTo*");
37  s_vv.push_back(foldermc+"*_WWTo*");
38  s_vv.push_back(foldermc+"*_ZZTo*");
39  vector<TString> s_dy;
40  s_dy.push_back(folderdy+"*DYJetsToLL_M-50_*");
41  vector<TString> s_other;
42  s_other.push_back(foldermc+"*_ZJet*");
43  s_other.push_back(foldermc+"*_WJetsToLNu*");
44  s_other.push_back(foldermc+"*_ST_*");
45  s_other.push_back(foldermc+"*ggZH_HToBB*");
46  s_other.push_back(foldermc+"*ttHJetTobb*");
47  // s_other.push_back(foldermc+"*QCD*");
48 
49 
50  // Reading ntuples
51 
52  vector<sfeats> Samples;
53  if (skim=="zisr"){
54  Samples.push_back(sfeats(s_slep, "Data", kBlack,1,"pass&&(trig[18]||trig[21]||trig[23]||trig[24])")); Samples.back().isData = true;
55  Samples.push_back(sfeats(s_dy, "Z+jets", dps::c_qcd,1,"stitch"));
56  Samples.push_back(sfeats(s_tt, "t#bar{t}, 2 true leptons", dps::c_tt_2l,1,"ntruleps>=2&&stitch"));
57  Samples.push_back(sfeats(s_tt, "t#bar{t}, 1 true lepton", dps::c_tt_1l, 1,"ntruleps<=1&&stitch"));
58  Samples.push_back(sfeats(s_vv, "VV", dps::c_singlet));
59  Samples.push_back(sfeats(s_ttv, "ttV", ra4::c_ttv));
60  Samples.push_back(sfeats(s_other, "Other", dps::c_other, 1));
61  } else {
62  Samples.push_back(sfeats(s_slep, "Data", kBlack,1,"pass&&(trig[18]||trig[21]||trig[23]||trig[24])")); Samples.back().isData = true;
63  Samples.push_back(sfeats(s_tt, "t#bar{t}, 2 true leptons", dps::c_tt_2l,1,"ntruleps>=2&&stitch"));
64  Samples.push_back(sfeats(s_tt, "t#bar{t}, 1 true lepton", dps::c_tt_1l, 1,"ntruleps<=1&&stitch"));
65  Samples.push_back(sfeats(s_dy, "Z+jets", dps::c_qcd,1,"stitch"));
66  Samples.push_back(sfeats(s_vv, "Single top", dps::c_singlet));
67  Samples.push_back(sfeats(s_ttv, "ttV", ra4::c_ttv));
68  Samples.push_back(sfeats(s_other, "Other", dps::c_other, 1));
69  }
70 
71  vector<int> ra4_sam;
72  unsigned nsam(Samples.size());
73  for(unsigned sam(0); sam < nsam; sam++){
74  ra4_sam.push_back(sam);
75  } // Loop over samples
76 
77 
78 
79  vector<hfeats> vars;
80  float ibinning[] = {0., 50., 100., 150., 200., 300., 400.,600., 800.};
81  int nbins = sizeof(ibinning)/sizeof(float)-1;
82 
83  if (skim=="zisr"){
84  //---------- Z+jets ISR --------------------
85  vars.push_back(hfeats("elelv_pt*(elelv_m>0)+mumuv_pt*(mumuv_m>0)",nbins,ibinning, ra4_sam, "p_{T}(ll) [GeV]",
86  "nvleps==2&&nleps>=1&&Max$(leps_pt)>30&&((elelv_m>80&&elelv_m<100)||(mumuv_m>80&&mumuv_m<100))"));
87  vars.back().whichPlots = "1";
88  } else {
89  //---------- TTBAR ISR --------------------
90  vars.push_back(hfeats("jetsys_nob_pt",nbins,ibinning, ra4_sam, "p_{T}(ISR jets) [GeV]",
91  "nleps==2&&Max$(leps_pt)>30&&njets>2&&nbm==2"));
92  vars.back().whichPlots = "12"; vars.back().normalize = true;
93  }
94  plot_distributions(Samples, vars, luminosity, plot_type, plot_style, "1d_dec11",true);
95 
96 }
97 
98 
void plot_distributions(std::vector< sfeats > Samples, std::vector< hfeats > vars, TString luminosity="10", TString filetype=".eps", TString namestyle="LargeLabels", TString dir="1d", bool doRatio=false, bool showcuts=false)
STL namespace.
int main()
Definition: plot_isr.cxx:13