ra4_macros  bede988c286599a3a84b77a4d788ac0a971e89f9
plot_t2tt.cxx
Go to the documentation of this file.
1 // plot_t5tttt: Compares kinematic distributions of T1tttt and T5tttt
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 luminosity="2.25";
20  TString plot_type=".pdf";
21  TString plot_style="CMSPaperNoRatio";
22 }
23 
24 using namespace std;
25 using std::cout;
26 using std::endl;
27 
28 int main(){
29 
30  TString bfolder("");
31  string hostname = execute("echo $HOSTNAME");
32  if(Contains(hostname, "cms") || Contains(hostname, "compute-"))
33  bfolder = "/net/cms2"; // In laptops, you can't create a /net folder
34 
35  TString foldert2(bfolder+"/cms2r0/babymaker/babies/2016_02_09/mc/T2tt/");
36 
37  vector<TString> s_t2vh;
38  s_t2vh.push_back(foldert2+"*T2tt*250_*-0_*");
39  vector<TString> s_t2h;
40  s_t2h.push_back(foldert2+"*T2tt*175_*-0_*");
41  vector<TString> s_t2m;
42  s_t2m.push_back(foldert2+"*T2tt*150_*-0_*");
43  vector<TString> s_t2l;
44  s_t2l.push_back(foldert2+"*T2tt*100_*-0_*");
45 
46  // vector<TString> s_t22vh;
47  // s_t22vh.push_back(foldert2+"*T2tt*250_*-0_*");
48  // vector<TString> s_t22mh;
49  // s_t22mh.push_back(foldert2+"*T2tt*950_*-0_*");
50  // vector<TString> s_t22h;
51  // s_t22h.push_back(foldert2+"*T2tt*600_*-0_*");
52  // vector<TString> s_t22m;
53  // s_t22m.push_back(foldert2+"*T2tt*300_*-0_*");
54  // vector<TString> s_t22ml;
55  // s_t22ml.push_back(foldert2+"*T2tt*200_*-0_*");
56  // vector<TString> s_t22l;
57  // s_t22l.push_back(foldert2+"*T2tt*100_*-0_*");
58 
59  // vector<TString> s_t22vh;
60  // s_t22vh.push_back(foldert2+"*T2tt*250_*-0_*");
61  // vector<TString> s_t22mh;
62  // s_t22mh.push_back(foldert2+"*T2tt*200_*-0_*");
63  // vector<TString> s_t22h;
64  // s_t22h.push_back(foldert2+"*T2tt*175_*-0_*");
65  // vector<TString> s_t22m;
66  // s_t22m.push_back(foldert2+"*T2tt*150_*-0_*");
67  // vector<TString> s_t22ml;
68  // s_t22ml.push_back(foldert2+"*T2tt*125_*-0_*");
69  // vector<TString> s_t22l;
70  // s_t22l.push_back(foldert2+"*T2tt*100_*-0_*");
71 
72  vector<TString> s_t22vh;
73  s_t22vh.push_back(foldert2+"*T2tt*350_*-100_*");
74  vector<TString> s_t22mh;
75  s_t22mh.push_back(foldert2+"*T2tt*300_*-100_*");
76  vector<TString> s_t22h;
77  s_t22h.push_back(foldert2+"*T2tt*275_*-100_*");
78  vector<TString> s_t22m;
79  s_t22m.push_back(foldert2+"*T2tt*250_*-100_*");
80  vector<TString> s_t22ml;
81  s_t22ml.push_back(foldert2+"*T2tt*225_*-100_*");
82  vector<TString> s_t22l;
83  s_t22l.push_back(foldert2+"*T2tt*200_*-100_*");
84 
85  // vector<TString> s_t22vh;
86  // s_t22vh.push_back(foldert2+"*T2tt*550_*-300_*");
87  // vector<TString> s_t22mh;
88  // s_t22mh.push_back(foldert2+"*T2tt*500_*-300_*");
89  // vector<TString> s_t22h;
90  // s_t22h.push_back(foldert2+"*T2tt*475_*-300_*");
91  // vector<TString> s_t22m;
92  // s_t22m.push_back(foldert2+"*T2tt*450_*-300_*");
93  // vector<TString> s_t22ml;
94  // s_t22ml.push_back(foldert2+"*T2tt*425_*-300_*");
95  // vector<TString> s_t22l;
96  // s_t22l.push_back(foldert2+"*T2tt*400_*-300_*");
97 
98 
99  // Reading ntuples
100  // TString lsp = "#tilde{#chi}#lower[0.2]{#scale[0.85]{^{0}}}#kern[-1.3]{#scale[0.85]{_{1}}}";
101  // TString t1t_label = "#scale[0.92]{#tilde{g}#kern[0.2]{#tilde{g}}, #tilde{g}#rightarrowt#bar{t}"+lsp;
102  vector<sfeats> Samples;
103  // Samples.push_back(sfeats(s_t2vh, "T2(250,0)", kGreen+1, 1));
104  // Samples.push_back(sfeats(s_t2h, "T2(175,0)", kAzure+2, 1));
105  // Samples.push_back(sfeats(s_t2m, "T2(150,0)", kRed, 1));
106  // Samples.push_back(sfeats(s_t2l, "T2(100,0)", kGreen+3, 1));
107 
108  Samples.push_back(sfeats(s_t22vh, "T2(350,100)", kGreen, 1));
109  Samples.push_back(sfeats(s_t22mh, "T2(300,100)", kAzure+2, 1));
110  Samples.push_back(sfeats(s_t22h, "T2(275,100)", kBlue, 1));
111  Samples.push_back(sfeats(s_t22m, "T2(250,100)", kRed, 1));
112  Samples.push_back(sfeats(s_t22ml, "T2(225,100)", kMagenta, 1));
113 
114  // Samples.push_back(sfeats(s_t22vh, "T2(250,0)", kGreen+1, 1));
115  // Samples.push_back(sfeats(s_t22mh, "T2tt(200,0)", kAzure, 1));
116  // Samples.push_back(sfeats(s_t22h, "T2tt(175,0)", kBlue+4, 1));
117  // Samples.push_back(sfeats(s_t22m, "T2tt(150,0)", kRed, 1));
118  // Samples.push_back(sfeats(s_t22ml, "T2tt(125,0)", kOrange+10, 1));
119  // Samples.push_back(sfeats(s_t22l, "T2tt(125,0)", kOrange+10, 1));
120 
121  // Samples.push_back(sfeats(s_t22vh, "T2(250,0)", kGreen+1, 1));
122  //Samples.push_back(sfeats(s_t22ml, "T2tt(200,0)", kOrange+10, 1));
123  // Samples.push_back(sfeats(s_t22l, "T2tt(100,0)", kOrange+8, 1));
124  // Samples.push_back(sfeats(s_t22m, "T2tt(300,0)", kRed-1, 1));
125  // Samples.push_back(sfeats(s_t22h, "T2tt(600,0)", kBlue, 1));
126  // Samples.push_back(sfeats(s_t22mh, "T2tt(950,0)", kGreen+1, 1));
127 
128  vector<int> all_sam;
129  unsigned nsam(Samples.size());
130  for(unsigned sam(0); sam < nsam; sam++){
131  all_sam.push_back(sam);
132  } // Loop over samples
133 
134 
135  vector<hfeats> vars;
136 
137  vars.push_back(hfeats("mc_pt",60,0,300, all_sam, "LSP p_{T} [GeV]","abs(mc_id)==1000022"));
138  vars.back().whichPlots = "34";
139 
140  // vars.push_back(hfeats("met",60,0,300, all_sam, "MET [GeV]","1",-1,"mLSP-0"));
141  // vars.back().whichPlots = "34";
142 
143  // vars.push_back(hfeats("mc_pt",50,0,1000, all_sam, "Stop p_{T} [GeV]","abs(mc_id)==1000006"));
144  // vars.back().whichPlots = "34";
145 
146  // vars.push_back(hfeats("mc_pt",40,0,900, all_sam, "Stop p_{T} [GeV]","nvleps==0&&ht>500&&njets>=4&&abs(mc_id)==1000006"));
147  // vars.back().whichPlots = "34";
148 
149  vars.push_back(hfeats("met",40,0,500, all_sam, "MET [GeV]","nvleps==0&&ht>500&&njets>=4"));
150  vars.back().whichPlots = "34";
151  vars.push_back(hfeats("ht",40,0,2000, all_sam, "H_{T} [GeV]","nvleps==0&&met>200&&njets>=4"));
152  vars.back().whichPlots = "34";
153  vars.push_back(hfeats("nbm",5,-0.5,4.5, all_sam, "n_{b}","nvleps==0&&ht>500&&met>200&&njets>=4"));
154  vars.back().whichPlots = "34";
155  vars.push_back(hfeats("njets",12,0.5,12.5, all_sam, "n_{jets}","nvleps==0&&ht>500&&met>200"));
156  vars.back().whichPlots = "34";
157 
158  plot_distributions(Samples, vars, luminosity, plot_type, plot_style, "t2tt",false, true);
159 
160 }
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)
bool Contains(const std::string &text, const std::string &pattern)
STL namespace.
std::string execute(const std::string &cmd)
int main()
Definition: plot_t2tt.cxx:28