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 base1l =
"mj14>250 && nleps==1 && nveto==0 && st>500 && met>200 && pass && weight<1 && njets>=6 && nbm>=1";
44 string base2l =
"mj14>250 && ((nleps==1 && nveto==1 && njets>=6 && nbm>=1 && mt>140) || (nleps==2 && njets>=5 && nbm<=2)) && st>500 && met>200 && met<500 && pass && weight<1";
46 string ntupletag =
"*metG200*.root";
48 {foldermc+
"*_TTJets*SingleLept"+ntupletag, foldermc+
"*_TTJets_HT"+ntupletag},
49 "stitch && ntruleps==1");
51 {foldermc+
"*_TTJets*DiLept"+ntupletag, foldermc+
"*_TTJets_HT"+ntupletag},
52 "stitch && ntruleps==2 ");
54 {foldermc+
"*_WJetsToLNu"+ntupletag},
"stitch");
56 {foldermc+
"*_ST_"+ntupletag},
"1");
58 {foldermc+
"*_TTWJets"+ntupletag, foldermc+
"*_TTZ"+ntupletag},
"1");
60 {foldermc+
"*DYJetsToLL"+ntupletag,foldermc+
"*QCD_HT*0_Tune"+ntupletag,foldermc+
"*QCD_HT*Inf_Tune"+ntupletag,
61 foldermc+
"*_ZJet"+ntupletag,foldermc+
"*_ttHJetTobb"+ntupletag,
62 foldermc+
"*_TTGJets"+ntupletag,foldermc+
"*_TTTT"+ntupletag,
63 foldermc+
"*_WH_HToBB"+ntupletag,foldermc+
"*_ZH_HToBB"+ntupletag,
64 foldermc+
"*_WWTo"+ntupletag,foldermc+
"*_WZ"+ntupletag,foldermc+
"*_ZZ_"+ntupletag},
67 vector<shared_ptr<Process> > all_procs = {proc_tt1l, proc_tt2l, proc_wjets, proc_single_t, proc_ttv, proc_other};
70 cuts.push_back(base1l +
"&& mt<=140 && mj14<=400");
71 cuts.push_back(base1l +
"&& mt<=140 && mj14>400");
72 cuts.push_back(base1l +
"&& mt>140 && mj14<=400");
73 cuts.push_back(base1l +
"&& mt>140 && mj14>400");
74 cuts.push_back(base2l +
"&& mj14<=400");
75 cuts.push_back(base2l +
"&& mj14>400");
77 vector<TableRow> table_cuts;
78 for(
size_t icut=0; icut<cuts.size(); icut++){
79 table_cuts.push_back(
TableRow(cuts2tex(cuts[icut]).Data(), cuts[icut].Data()));
83 pm.
Push<
Table>(
"chart", table_cuts, all_procs,
true,
true,
true);
88 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)
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.