ra4_macros  bede988c286599a3a84b77a4d788ac0a971e89f9
plot_rohanplot.cxx
Go to the documentation of this file.
1 #include <iostream>
2 #include <vector>
3 
4 #include "TString.h"
5 
7 
8 using namespace std;
9 
10 int main(){
11 
12  TString bfolder("");
13  string hostname = execute("echo $HOSTNAME");
14  if(Contains(hostname, "cms") || Contains(hostname, "compute-"))
15  bfolder = "/net/cms2"; // In laptops, you can't create a /net folder
16  TString folder=bfolder+"/cms2r0/babymaker/babies/2016_06_14/mc/skim_standard/";
17  vector<TString> s_tt;
18  s_tt.push_back(folder+"*TTJets*Lept*");
19  s_tt.push_back(folder+"*TTJets*HT*");
20 
21  // Reading ntuples
22  vector<sfeats> Samples;
23  Samples.push_back(sfeats(s_tt, "t#bar{t}, 2 true leptons: m_{T} > 140 GeV", kViolet+9,25, "mt>140&&ntruleps==2&&nveto==0&&stitch")); Samples.back().isData = true;
24  Samples.push_back(sfeats(s_tt, "t#bar{t}, 1 true lepton: m_{T} > 140 GeV", kViolet+9,25,"mt>140&&ntruleps==1&&nveto==0&&stitch")); Samples.back().isData = true;
25  Samples.push_back(sfeats(s_tt, "t#bar{t}, 2 true leptons: m_{T} #leq 140 GeV", 31,1, "mt<=140&&ntruleps==2&&stitch"));
26  Samples.push_back(sfeats(s_tt, "t#bar{t}, 1 true lepton: m_{T} #leq 140 GeV", 31,1,"mt<=140&&ntruleps==1&&stitch"));
27 
28  vector<int> mt140;
29  mt140.push_back(3);
30  mt140.push_back(0);
31 
32  vector<int> mt140_2l;
33  mt140_2l.push_back(2);
34  mt140_2l.push_back(0);
35 
36  vector<int> mt140_1l;
37  mt140_1l.push_back(3);
38  mt140_1l.push_back(1);
39 
40  TString noCuts = "1";
41  TString baseline = "ht>500&&met>200&&njets>=6&&nbm>=1&&nleps==1&&stitch&&pass";
42 
43  vector<hfeats> vars_paper, vars_aux;
44 
45  vars_paper.push_back(hfeats("mj14",30,0,1500, mt140, "M_{J} [GeV]",baseline,400,"eventselection"));
46  vars_paper.back().whichPlots = "14"; vars_paper.back().maxRatio = 0.19;
47  vars_aux.push_back(hfeats("mj14",30,0,1500, mt140_1l, "M_{J} [GeV]",baseline,400,"syst"));
48  vars_aux.back().whichPlots = "14"; vars_aux.back().maxRatio = 0.19;
49 
50  baseline = "mj14>250&&ht>500&&met>200&&nbm>=1&&nleps==1&&stitch&&pass";
51  vars_paper.push_back(hfeats("njets",7,5.5,12.5, mt140, "N_{jets}",baseline, -1, "eventselection"));
52  vars_paper.back().whichPlots = "13"; vars_paper.back().maxRatio = 0.19;
53 
54  //NOTE: Make sure RohanHack is turned off
55  plot_distributions(Samples, vars_paper, "2.3", ".pdf", "CMSPaper","rohan",true);
56  plot_distributions(Samples, vars_aux, "2.3", ".pdf", "CMSPaper_Supplementary","aux",true);
57 }
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()
bool Contains(const std::string &text, const std::string &pattern)
STL namespace.
std::string execute(const std::string &cmd)