11 #include "core/baby.hpp" 26 gErrorIgnoreLevel=6000;
28 time_t begtime, endtime;
34 string hostname =
execute(
"echo $HOSTNAME");
36 bfolder =
"/net/cms2";
38 string foldermc(bfolder+
"/cms2r0/babymaker/babies/2016_08_10/mc/merged_mcbase_stdnj5/");
40 Palette colors(
"txt/colors.txt",
"default");
43 string baseline =
"mj14>250 && nleps>=1 && ht>500 && met>150 && pass && njets>=5 && weight<1";
47 {foldermc+
"*_TTJets*SingleLept*.root", foldermc+
"*_TTJets_HT*.root"},
48 baseline+
" && stitch && ntruleps==1");
50 {foldermc+
"*_TTJets*DiLept*.root", foldermc+
"*_TTJets_HT*.root"},
51 baseline+
" && stitch && ntruleps==2 && ntrutaush==0");
53 {foldermc+
"*_TTJets*DiLept*.root", foldermc+
"*_TTJets_HT*.root"},
54 baseline+
" && stitch && ntruleps==2 && ntrutaush>=1");
56 {foldermc+
"*_WJetsToLNu*.root"}, baseline+
" && stitch");
58 {foldermc+
"*_ST_*.root"}, baseline);
60 {foldermc+
"*_TTWJets*.root", foldermc+
"*_TTZ*.root"}, baseline);
62 {foldermc+
"*DYJetsToLL*.root",foldermc+
"*QCD_HT*0_Tune*.root",foldermc+
"*QCD_HT*Inf_Tune*.root",
63 foldermc+
"*_ZJet*.root",foldermc+
"*_ttHJetTobb*.root",
64 foldermc+
"*_TTGJets*.root",foldermc+
"*_TTTT*.root",
65 foldermc+
"*_WH_HToBB*.root",foldermc+
"*_ZH_HToBB*.root",
66 foldermc+
"*_WWTo*.root",foldermc+
"*_WZ*.root",foldermc+
"*_ZZ_*.root"},
67 baseline+
" && stitch");
78 vector<shared_ptr<Process> > all_procs = {proc_tt1l, proc_tt2l, proc_ttltau, proc_wjets, proc_single_t, proc_ttv, proc_other};
82 TString c_vlowmet =
"met>150 && met<=200";
83 TString c_lowmet =
"met>200 && met<=350";
84 TString c_midmet =
"met>350 && met<=500";
85 TString c_higmet =
"met>500";
86 vector<TString> metcuts({c_vlowmet, c_lowmet, c_midmet, c_higmet});
90 TString c_lownb =
"nbm==1";
91 TString c_midnb =
"nbm==2";
92 TString c_hignb =
"nbm>=3";
93 vector<TString> nbcuts({c_lownb, c_midnb, c_hignb});
97 TString c_lownj =
"njets>=6 && njets<=8";
98 TString c_hignj =
"njets>=9";
99 TString c_nj5 =
"njets==5";
100 vector<TString> njcuts({c_nj5, c_lownj, c_hignj});
104 TString c_lowmt =
"mt<=140";
105 TString c_higmt =
"mt>140";
106 vector<TString> mtcuts({c_lowmt, c_higmt});
109 vector<TString> cuts;
110 for(
size_t imet=0; imet<metcuts.size(); imet++)
111 for(
size_t inb=0; inb<nbcuts.size(); inb++)
112 for(
size_t inj=0; inj<njcuts.size(); inj++)
113 for(
size_t imt=0; imt<mtcuts.size(); imt++){
114 cuts.push_back(
"nleps==1 && nveto==0 && "+metcuts[imet]+
"&&"+nbcuts[inb]+
"&&"+njcuts[inj]+
"&&"+mtcuts[imt]);
115 cuts.push_back(
"nleps==1 && nveto==1 && "+metcuts[imet]+
"&&"+nbcuts[inb]+
"&&"+njcuts[inj]+
"&&"+mtcuts[imt]);
119 njcuts = vector<TString>({
"njets>=5 && njets<=7",
"njets>=8"});
120 for(
size_t imet=0; imet<metcuts.size(); imet++)
121 for(
size_t inj=0; inj<njcuts.size(); inj++)
122 cuts.push_back(
"nleps==2 && "+metcuts[imet]+
"&&"+njcuts[inj]);
124 vector<TableRow> table_cuts;
125 for(
size_t icut=0; icut<cuts.size(); icut++){
130 pm.
Push<
Table>(
"chart", table_cuts, all_procs,
true,
true,
true);
135 cout<<endl<<
"Making "<<table_cuts.size()<<
" piecharts took "<<difftime(endtime, begtime)<<
" seconds"<<endl<<endl;
bool Contains(const std::string &str, const std::string &pat)
std::string execute(const std::string &cmd)
FigureType & Push(Args &&...args)
std::string CodeToLatex(std::string code)
Organizes efficient production of plots with single loop over each process.
void MakePlots(double luminosity, const std::string &subdir="")
Prints all added plots with given luminosity.
Loads colors from a text configuration file.