ra4_macros  bede988c286599a3a84b77a4d788ac0a971e89f9
plot_PU.cxx
Go to the documentation of this file.
1 // plot_dps: Macro that plots variables both for comissioning DPS
2 
3 #include <iostream>
4 #include <vector>
5 
6 #include "TChain.h"
7 #include "TH1D.h"
8 #include "TCanvas.h"
9 #include "TLegend.h"
10 #include "TLine.h"
11 #include "TString.h"
12 #include "TColor.h"
13 
14 #include "styles.hpp"
15 #include "utilities.hpp"
16 #include "utilities_macros.hpp"
17 
18 namespace {
19  TString minjets("5");
20  TString mjthresh("400");
21  TString metcut("met_nohf>150");
22  TString minht("400");
23  TString minbm("1");
24  TString luminosity="0.0419"; // in ifb
25  TString plot_type=".pdf";
26  TString plot_style="CMSPaper";
27 }
28 
29 using namespace std;
30 using std::cout;
31 using std::endl;
32 
33 int main(){
34  TString folder_ns="/net/cms2/cms2r0/ald77/archive/2015_08_13/";
35  TString DY = "/net/cms29/cms29r0/heller/susy_cfa/out/DY_NLO/";
36  TString singlelep = "/net/cms29/cms29r0/heller/susy_cfa/out/SingleLep/";
37  TString doublelep = "/net/cms29/cms29r0/heller/susy_cfa/out/DoubleLep/";
38 
39  vector<TString> s_singlelep;
40  s_singlelep.push_back(singlelep+"*.root");
41  vector<TString> s_doublelep;
42  s_doublelep.push_back(doublelep+"*.root");
43  vector<TString> s_tt;
44  s_tt.push_back(folder_ns+"*_TTJet*50ns*");
45  vector<TString> s_DY;
46  s_DY.push_back(DY+"*DY*");
47  vector<TString> s_otherDY;
48  s_otherDY.push_back(folder_ns+"*_ZJet*");
49  s_otherDY.push_back(folder_ns+"*WH_HToBB*");
50  s_otherDY.push_back(folder_ns+"*ST_*");
51  s_otherDY.push_back(folder_ns+"*_WJets*");
52  s_otherDY.push_back(folder_ns+"*QCD_Pt*");
53 
54  // Reading ntuples
55  vector<sfeats> Samples;
56 
57  Samples.push_back(sfeats(s_doublelep, "Data",kBlack,1,
58  "(trig[25]||trig[15])&&json_golden")); Samples.back().isData = true;
59  Samples.push_back(sfeats(s_singlelep, "Data",kBlack,1,
60  "(trig[20]||trig[32])&&json_golden")); Samples.back().isData = true;
61  Samples.push_back(sfeats(s_DY, "Z+jets", dps::c_qcd));
62  Samples.push_back(sfeats(s_tt, "ttbar", dps::c_tt_2l));
63  Samples.push_back(sfeats(s_otherDY, "Other", dps::c_other));
64 
65  vector<int> npv_dl;
66  npv_dl.push_back(0);
67  npv_dl.push_back(2);
68  npv_dl.push_back(3);
69  npv_dl.push_back(4);
70 
71  vector<int> npv_sl;
72  npv_sl.push_back(1);
73  npv_sl.push_back(2);
74  npv_sl.push_back(3);
75  npv_sl.push_back(4);
76 
77 
78 
79 
80  vector<hfeats> vars;
81 
82  TString mll("&&(mumuv_m*(mumuv_m>0)+elelv_m*(elelv_m>0))>80&&(mumuv_m*(mumuv_m>0)+elelv_m*(elelv_m>0))<100");
83 
84  /* vars.push_back(hfeats("npv",40,0,40, npv_dl, "NPV",
85  "pass&&nmus>=2"+mll));
86  vars.back().whichPlots = "2"; vars.back().normalize = true;
87 
88  vars.push_back(hfeats("npv",40,0,40, npv_dl, "NPV",
89  "pass&&nels>=2"+mll));
90  vars.back().whichPlots = "2"; vars.back().normalize = true;*/
91 
92  vars.push_back(hfeats("npv",40,0,40, npv_dl, "NPV",
93  "(nmus>=2||nels>=2)&&pass"+mll));
94  vars.back().whichPlots = "2"; vars.back().normalize = true; vars.back().PU_reweight = true;
95  /*
96 
97  vars.push_back(hfeats("npv",40,0,40, npv_sl, "NPV",
98  "nmus>=2&&pass"+mll));
99  vars.back().whichPlots = "2"; vars.back().normalize = true;
100 
101  vars.push_back(hfeats("npv",40,0,40, npv_sl, "NPV",
102  "nels>=2&&pass"+mll));
103  vars.back().whichPlots = "2"; vars.back().normalize = true;
104 
105  vars.push_back(hfeats("npv",40,0,40, npv_sl, "NPV",
106  "(nmus>=2||nels>=2)&&pass"+mll));
107  vars.back().whichPlots = "2"; vars.back().normalize = true;
108  */
109 
110 
111  plot_distributions(Samples, vars, luminosity, plot_type, plot_style, "1d",true);
112 
113 
114 }
115 
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)
TString metcut("met_nohf>150")
STL namespace.
int main()
Definition: plot_PU.cxx:33