12 #include "core/baby.hpp" 32 int main(
int argc,
char *argv[]){
33 gErrorIgnoreLevel = 6000;
39 string hostname =
execute(
"HOSTNAME");
41 bfolder =
"/net/cms2";
42 string lowmet_fndata(bfolder+
"/cms2r0/babymaker/babies/2016_06_26/data/merged_met150/");
43 string himet_fndata(bfolder+
"/cms2r0/babymaker/babies/2016_06_26/data/merged_standard/");
44 string himet_fodata(bfolder+
"/cms2r0/babymaker/babies/2016_04_29/data/merged_1lht500met200/");
45 string lowmet_fmc(bfolder+
"/cms2r0/babymaker/babies/2016_06_14/mc/merged_met150/");
46 string himet_fmc(bfolder+
"/cms2r0/babymaker/babies/2016_06_14/mc/merged_standard/");
48 string baseline(
"nleps>=1 && ht>500 && met>150 && met<500 && pass && njets>=5");
55 vector<string> abcdcuts_2l = {
"mt<=140 && mj14<=400 && nleps==1 && nveto==0 && nbm>=1 && njets>=6",
56 "mt<=140 && mj14>400 && nleps==1 && nveto==0 && nbm>=1 && njets>=6",
57 " mj14<=400 && nels==1 && nmus==1 && nbm<=2 && njets>=5",
58 " mj14>400 && nels==1 && nmus==1 && nbm<=2 && njets>=5"};
60 Palette colors(
"txt/colors.txt",
"default");
72 auto ndata = Process::MakeShared<Baby_full>(
"Data (2016, 2.6 fb^{-1})",
Process::Type::data, kBlack, {lowmet_fndata+
"/*.root", himet_fndata+
"/*.root"},
73 baseline+
"&&json2p6 && (trig[4]||trig[8]||trig[13]||trig[33])");
74 auto odata = Process::MakeShared<Baby_full>(
"Data (2015, 2.3 fb^{-1})",
Process::Type::data, kRed+1, {himet_fodata+
"/*.root"},
75 baseline+
" && (trig[4]||trig[8]||trig[28]||trig[14])");
78 {lowmet_fmc+
"*_TTJets*Lept*.root", lowmet_fmc+
"*_TTJets_HT*.root",
79 himet_fmc+
"*_TTJets*Lept*.root", himet_fmc+
"*_TTJets_HT*.root"},
80 baseline+
" && stitch && ntruleps==1");
82 {lowmet_fmc+
"*_TTJets*Lept*.root", lowmet_fmc+
"*_TTJets_HT*.root",
83 himet_fmc+
"*_TTJets*Lept*.root", himet_fmc+
"*_TTJets_HT*.root"},
84 baseline+
" && stitch && ntruleps==2");
86 {lowmet_fmc+
"*_WJetsToLNu*.root",lowmet_fmc+
"*_ST_*.root",
87 lowmet_fmc+
"*_TTW*.root",lowmet_fmc+
"*_TTZ*.root",
88 lowmet_fmc+
"*DYJetsToLL*.root",lowmet_fmc+
"*QCD_HT*.root",
89 lowmet_fmc+
"*_ZJet*.root",lowmet_fmc+
"*_ttHJetTobb*.root",
90 lowmet_fmc+
"*_TTGJets*.root",lowmet_fmc+
"*_TTTT*.root",
91 lowmet_fmc+
"*_WH_HToBB*.root",lowmet_fmc+
"*_ZH_HToBB*.root",
92 lowmet_fmc+
"*_WWTo*.root",lowmet_fmc+
"*_WZ*.root",lowmet_fmc+
"*_ZZ_*.root",
93 himet_fmc+
"*_WJetsToLNu*.root",himet_fmc+
"*_ST_*.root",
94 himet_fmc+
"*_TTW*.root",himet_fmc+
"*_TTZ*.root",
95 himet_fmc+
"*DYJetsToLL*.root",himet_fmc+
"*QCD_HT*.root",
96 himet_fmc+
"*_ZJet*.root",himet_fmc+
"*_ttHJetTobb*.root",
97 himet_fmc+
"*_TTGJets*.root",himet_fmc+
"*_TTTT*.root",
98 himet_fmc+
"*_WH_HToBB*.root",himet_fmc+
"*_ZH_HToBB*.root",
99 himet_fmc+
"*_WWTo*.root",himet_fmc+
"*_WZ*.root",himet_fmc+
"*_ZZ_*.root"},
100 baseline+
" && stitch");
102 vector<shared_ptr<Process> > lowmet_procs = {ndata,
tt1l,
tt2l, other};
103 vector<shared_ptr<Process> > himet_procs = {ndata, odata,
tt1l,
tt2l, other};
104 vector<shared_ptr<Process> > allmet_procs = {ndata, odata,
tt1l,
tt2l, other};
106 PlotOpt log_lumi(
"txt/plot_styles.txt",
"CMSPaper");
107 log_lumi.
Title(TitleType::preliminary)
108 .
Bottom(BottomType::ratio)
109 .
YAxis(YAxisType::log)
110 .
Stack(StackType::data_norm);
112 PlotOpt log_shapes = log_lumi().
Stack(StackType::shapes)
115 PlotOpt lin_shapes = log_shapes().
YAxis(YAxisType::linear);
116 PlotOpt log_lumi_info = log_lumi().
Title(TitleType::info);
117 PlotOpt lin_lumi_info = lin_lumi().
Title(TitleType::info);
118 PlotOpt log_shapes_info = log_shapes().
Title(TitleType::info);
119 PlotOpt lin_shapes_info = lin_shapes().
Title(TitleType::info);
123 vector<PlotOpt> plot_types = {lin_lumi_info};
149 pm.
Push<
Hist1D>(
Axis(13, 25, 1000,
"mj14",
"M_{J} [GeV]", {250.,400.}),
"met>150&&met<200 && nels==1 && nmus==1 && nbm<=2 && njets>=5", lowmet_procs, plot_types);
154 pm.
Push<
Hist1D>(
Axis(10,0.,280.,
"mt",
"m_{T} [GeV]", {140.}),
"met>150&&met<200 && nels==1 && nmus==1 && nbm<=2 && njets>=5",lowmet_procs, plot_types);
155 pm.
Push<
Hist1D>(
Axis(10,0.,280.,
"mt",
"m_{T} [GeV]", {140.}),
"mj14>400 && met>150&&met<200 && nels==1 && nmus==1 && nbm<=2 && njets>=5",lowmet_procs, plot_types);
160 pm.
Push<
Hist1D>(
Axis(10,0.,400.,
"mus_pt[0]",
"p_{T} (#mu) [GeV]"),
"met>150&&met<200 && nleps==2 && nmus>=1 && nbm<=2 && njets>=5",lowmet_procs, plot_types);
161 pm.
Push<
Hist1D>(
Axis(10,0.,400.,
"els_pt[0]",
"p_{T} (e)[GeV]"),
"met>150&&met<200 && nleps==2 && nels>=1 && nbm<=2 && njets>=5",lowmet_procs, plot_types);
162 pm.
Push<
Hist1D>(
Axis(10,0.,400.,
"mus_pt[0]",
"p_{T} (#mu) [GeV]"),
"mj14>400 && met>150&&met<200 && nleps==2 && nmus>=1 && nbm<=2 && njets>=5",lowmet_procs, plot_types);
163 pm.
Push<
Hist1D>(
Axis(10,0.,400.,
"els_pt[0]",
"p_{T} (e)[GeV]"),
"mj14>400 && met>150&&met<200 && nleps==2 && nels>=1 && nbm<=2 && njets>=5",lowmet_procs, plot_types);
166 pm.
Push<
Hist1D>(
Axis(13, 25, 1000,
"mj14",
"M_{J} [GeV]",{250.,400.}),
"met>200&&met<350 && nels==1 && nmus==1 && nbm<=2 && njets>=5",himet_procs, plot_types);
171 pm.
Push<
Hist1D>(
Axis(10,0.,280.,
"mt",
"m_{T} [GeV]",{140.}),
"met>200&&met<350 && nels==1 && nmus==1 && nbm<=2 && njets>=5",himet_procs, plot_types);
172 pm.
Push<
Hist1D>(
Axis(10,0.,280.,
"mt",
"m_{T} [GeV]",{140.}),
"mj14>400 && met>200&&met<350 && nels==1 && nmus==1 && nbm<=2 && njets>=5",himet_procs, plot_types);
177 pm.
Push<
Hist1D>(
Axis(10,0.,400.,
"mus_pt[0]",
"p_{T} (#mu) [GeV]"),
"met>200&&met<350 && nleps==2 && nmus>=1 && nbm<=2 && njets>=5",himet_procs, plot_types);
178 pm.
Push<
Hist1D>(
Axis(10,0.,400.,
"els_pt[0]",
"p_{T} (e)[GeV]"),
"met>200&&met<350 && nleps==2 && nels>=1 && nbm<=2 && njets>=5",himet_procs, plot_types);
179 pm.
Push<
Hist1D>(
Axis(10,0.,400.,
"mus_pt[0]",
"p_{T} (#mu) [GeV]"),
"mj14>400 && met>200&&met<350 && nleps==2 && nmus>=1 && nbm<=2 && njets>=5",himet_procs, plot_types);
180 pm.
Push<
Hist1D>(
Axis(10,0.,400.,
"els_pt[0]",
"p_{T} (e)[GeV]"),
"mj14>400 && met>200&&met<350 && nleps==2 && nels>=1 && nbm<=2 && njets>=5",himet_procs, plot_types);
183 pm.
Push<
Hist1D>(
Axis(12,200.,500.,
"met",
"MET[GeV]",{350.}),
"met>200 && nels==1 && nmus==1 && nbm<=2 && njets>=5",allmet_procs, plot_types);
184 pm.
Push<
Hist1D>(
Axis(12,200.,500.,
"met",
"MET[GeV]",{350.}),
"mj14>400 && met>200 && nels==1 && nmus==1 && nbm<=2 && njets>=5",allmet_procs, plot_types);
195 static struct option long_options[] = {
196 {
"single_thread", no_argument, 0,
's'},
202 opt = getopt_long(argc, argv,
"s", long_options, &option_index);
204 if( opt == -1)
break;
212 optname = long_options[option_index].name;
215 printf(
"Bad option! Found option name %s\n", optname.c_str());
219 printf(
"Bad option! getopt_long returned character code 0%o\n", opt);
PlotOpt & Stack(PlotOptTypes::StackType stack_type)
PlotOpt & YAxis(PlotOptTypes::YAxisType y_axis_type)
bool Contains(const std::string &str, const std::string &pat)
std::string execute(const std::string &cmd)
FigureType & Push(Args &&...args)
int main(int argc, char *argv[])
Organizes efficient production of plots with single loop over each process.
PlotOpt & Bottom(PlotOptTypes::BottomType bottom_type)
void GetOptions(int argc, char *argv[])
PlotOpt & ShowBackgroundError(bool show_background_error)
A full 1D plot with stacked/overlayed histograms.
void MakePlots(double luminosity, const std::string &subdir="")
Prints all added plots with given luminosity.
PlotOpt & Title(PlotOptTypes::TitleType title_type)
Loads colors from a text configuration file.