ra4_macros  bede988c286599a3a84b77a4d788ac0a971e89f9
plot_t5tttt.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 foldert1(bfolder+"/cms2r0/babymaker/babies/2016_01_11/mc/scan/");
36  TString foldert5(bfolder+"/cms2r0/babymaker/babies/2016_02_09/mc/T5tttt/");
37 
38  vector<TString> s_t1m0;
39  s_t1m0.push_back(foldert1+"*T1tttt*1400_*-0_*");
40  vector<TString> s_t1m300;
41  s_t1m300.push_back(foldert1+"*T1tttt*1400_*-300_*");
42  vector<TString> s_t1m1100;
43  s_t1m1100.push_back(foldert1+"*T1tttt*1400_*-1100_*");
44 
45  vector<TString> s_t5m0;
46  s_t5m0.push_back(foldert5+"*T5tttt*1400_*-0_*");
47  vector<TString> s_t5m300;
48  s_t5m300.push_back(foldert5+"*T5tttt*1400_*-300_*");
49  vector<TString> s_t5m1100;
50  s_t5m1100.push_back(foldert5+"*T5tttt*1400_*-1100_*");
51 
52 
53  // Reading ntuples
54  // TString lsp = "#tilde{#chi}#lower[0.2]{#scale[0.85]{^{0}}}#kern[-1.3]{#scale[0.85]{_{1}}}";
55  // TString t1t_label = "#scale[0.92]{#tilde{g}#kern[0.2]{#tilde{g}}, #tilde{g}#rightarrowt#bar{t}"+lsp;
56  vector<sfeats> Samples;
57  Samples.push_back(sfeats(s_t1m0, "T1(1400,0)", kGreen+1, 1));
58  Samples.push_back(sfeats(s_t1m300, "T1(1400,300)", kAzure+2, 1));
59  Samples.push_back(sfeats(s_t1m1100, "T1(1400,1100)", kRed, 1));
60  Samples.push_back(sfeats(s_t5m0, "T5(1400,0)", kGreen+1, 2));
61  Samples.push_back(sfeats(s_t5m300, "T5(1400,300)", kAzure+2, 2));
62  Samples.push_back(sfeats(s_t5m1100, "T5(1400,1100)", kRed, 2));
63 
64  vector<int> all_sam;
65  unsigned nsam(Samples.size());
66  for(unsigned sam(0); sam < nsam; sam++){
67  all_sam.push_back(sam);
68  } // Loop over samples
69 
70 
71  vector<hfeats> vars;
72 
73  vars.push_back(hfeats("leps_pt[0]",40,0,400, all_sam, "Lepton p_{T} [GeV]","nleps==1&&ht>500&&met>200&&njets>=6"));
74  vars.back().whichPlots = "34";
75  vars.push_back(hfeats("met",40,0,1200, all_sam, "MET [GeV]","nleps==1&&ht>500&&njets>=6", 200));
76  vars.back().whichPlots = "34";
77  vars.push_back(hfeats("mt",40,0,800, all_sam, "m_{T} [GeV]","nleps==1&&ht>500&&njets>=6", 140));
78  vars.back().whichPlots = "34";
79  vars.push_back(hfeats("mt",40,0,800, all_sam, "m_{T} [GeV]","nleps==1&&ht>500&&met>200&&njets>=6", 140));
80  vars.back().whichPlots = "34";
81  vars.push_back(hfeats("ht",40,0,3000, all_sam, "H_{T} [GeV]","nleps==1&&met>200&&njets>=6", 500));
82  vars.back().whichPlots = "34";
83  vars.push_back(hfeats("mj",40,0,1500, all_sam, "M_{J} [GeV]","nleps==1&&ht>500&&met>200&&njets>=6", 400));
84  vars.back().whichPlots = "34";
85  vars.push_back(hfeats("nbm",6,-0.5,5.5, all_sam, "n_{b}","nleps==1&&ht>500&&met>200&&njets>=6", 0.5));
86  vars.back().whichPlots = "34";
87  vars.push_back(hfeats("njets",13,1.5,14.5, all_sam, "n_{jets}","nleps==1&&ht>500&&met>200", 5.5));
88  vars.back().whichPlots = "34";
89  vars.push_back(hfeats("nleps",5,-0.5,4.5, all_sam, "n_{leps}","1"));
90  vars.back().whichPlots = "34";
91 
92  plot_distributions(Samples, vars, luminosity, plot_type, plot_style, "t5tttt",false, true);
93 
94 }
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)
int main()
Definition: plot_t5tttt.cxx:28
bool Contains(const std::string &text, const std::string &pattern)
STL namespace.
std::string execute(const std::string &cmd)