12 #include "core/baby.hpp" 32 int main(
int argc,
char *argv[]){
33 gErrorIgnoreLevel = 6000;
40 if(do_rc) rcfolder =
"reclustered/";
43 string hostname =
execute(
"echo $HOSTNAME");
45 bfolder =
"/net/cms2";
46 string lowmet_fndata(bfolder+
"/cms2r0/babymaker/babies/"+rcfolder+
"2016_06_26/data/merged_met150/");
47 string himet_fndata(bfolder+
"/cms2r0/babymaker/babies/"+rcfolder+
"2016_06_26/data/merged_standard/");
48 string himet_fodata(bfolder+
"/cms2r0/babymaker/babies/"+rcfolder+
"2016_04_29/data/merged_1lht500met200/");
49 string himet_fmc_74x(bfolder+
"/cms2r0/babymaker/babies/"+rcfolder+
"2016_04_29/mc/merged_1lht500met200/");
50 string lowmet_fmc(bfolder+
"/cms2r0/babymaker/babies/"+rcfolder+
"2016_06_14/mc/merged_met150/");
51 string himet_fmc(bfolder+
"/cms2r0/babymaker/babies/"+rcfolder+
"2016_06_14/mc/merged_standard/");
53 string baseline(
"nleps>=1 && ht>500 && met>150 && met<500 && pass && njets>=3");
55 Palette colors(
"txt/colors.txt",
"default");
57 auto ndata = Process::MakeShared<Baby_full>(
"Data (2016, 2.6 fb^{-1})",
Process::Type::data, kBlack,
58 {lowmet_fndata+
"/*.root", himet_fndata+
"/*.root"},
59 baseline+
"&&json2p6 && (trig[4]||trig[8]||trig[13]||trig[33])");
60 auto odata = Process::MakeShared<Baby_full>(
"Data (2015, 2.3 fb^{-1})",
Process::Type::data, kRed+1, {himet_fodata+
"/*.root"},
61 baseline+
" && (trig[4]||trig[8]||trig[28]||trig[14])");
65 {lowmet_fmc+
"*_TTJets*Lept*.root", lowmet_fmc+
"*_TTJets_HT*.root",
66 himet_fmc+
"*_TTJets*Lept*.root", himet_fmc+
"*_TTJets_HT*.root"},
67 baseline+
" && stitch && ntruleps==1");
69 {lowmet_fmc+
"*_TTJets*Lept*.root", lowmet_fmc+
"*_TTJets_HT*.root",
70 himet_fmc+
"*_TTJets*Lept*.root", himet_fmc+
"*_TTJets_HT*.root"},
71 baseline+
" && stitch && ntruleps==2");
73 {lowmet_fmc+
"*_WJetsToLNu*.root",lowmet_fmc+
"*_ST_*.root",
74 lowmet_fmc+
"*_TTW*.root",lowmet_fmc+
"*_TTZ*.root",
75 lowmet_fmc+
"*DYJetsToLL*.root",lowmet_fmc+
"*QCD_HT*.root",
76 lowmet_fmc+
"*_ZJet*.root",lowmet_fmc+
"*_ttHJetTobb*.root",
77 lowmet_fmc+
"*_TTGJets*.root",lowmet_fmc+
"*_TTTT*.root",
78 lowmet_fmc+
"*_WH_HToBB*.root",lowmet_fmc+
"*_ZH_HToBB*.root",
79 lowmet_fmc+
"*_WWTo*.root",lowmet_fmc+
"*_WZ*.root",lowmet_fmc+
"*_ZZ_*.root",
80 himet_fmc+
"*_WJetsToLNu*.root",himet_fmc+
"*_ST_*.root",
81 himet_fmc+
"*_TTW*.root",himet_fmc+
"*_TTZ*.root",
82 himet_fmc+
"*DYJetsToLL*.root",himet_fmc+
"*QCD_HT*.root",
83 himet_fmc+
"*_ZJet*.root",himet_fmc+
"*_ttHJetTobb*.root",
84 himet_fmc+
"*_TTGJets*.root",himet_fmc+
"*_TTTT*.root",
85 himet_fmc+
"*_WH_HToBB*.root",himet_fmc+
"*_ZH_HToBB*.root",
86 himet_fmc+
"*_WWTo*.root",himet_fmc+
"*_WZ*.root",himet_fmc+
"*_ZZ_*.root"},
87 baseline+
" && stitch");
90 {himet_fmc_74x+
"*_TTJets*Lept*.root", himet_fmc_74x+
"*_TTJets_HT*.root"},
91 baseline+
" && stitch && ntruleps==1");
93 {himet_fmc_74x+
"*_TTJets*Lept*.root", himet_fmc_74x+
"*_TTJets_HT*.root"},
94 baseline+
" && stitch && ntruleps==2");
96 {himet_fmc_74x+
"*_WJetsToLNu*.root",himet_fmc_74x+
"*_ST_*.root",
97 himet_fmc_74x+
"*_TTW*.root",himet_fmc_74x+
"*_TTZ*.root",
98 himet_fmc_74x+
"*DYJetsToLL*.root",himet_fmc_74x+
"*QCD_HT*.root",
99 himet_fmc_74x+
"*_ZJet*.root",himet_fmc_74x+
"*_ttHJetTobb*.root",
100 himet_fmc_74x+
"*_TTGJets*.root",himet_fmc_74x+
"*_TTTT*.root",
101 himet_fmc_74x+
"*_WH_HToBB*.root",himet_fmc_74x+
"*_ZH_HToBB*.root",
102 himet_fmc_74x+
"*_WWTo*.root",himet_fmc_74x+
"*_WZ*.root",himet_fmc_74x+
"*_ZZ_*.root"},
103 baseline+
" && stitch");
105 vector<shared_ptr<Process> > procs_2015 = {odata, tt1l_74x, tt2l_74x, other_74x};
106 vector<shared_ptr<Process> > lowmet_procs = {ndata,
tt1l,
tt2l, other};
108 PlotOpt log_lumi(
"txt/plot_styles.txt",
"CMSPaper");
109 log_lumi.
Title(TitleType::preliminary)
110 .
Bottom(BottomType::ratio)
111 .
YAxis(YAxisType::log)
112 .
Stack(StackType::data_norm);
114 PlotOpt log_lumi_info = log_lumi().
Title(TitleType::info);
115 PlotOpt lin_lumi_info = lin_lumi().
Title(TitleType::info);
117 vector<PlotOpt> plot_types = {lin_lumi_info};
121 float minx(0), maxx(460);
122 int nbins(static_cast<int>((maxx-minx)/10));
123 minx = 25; maxx = 1000; nbins =
static_cast<int>((maxx-minx)/75);
125 string mjname =
"M_{J}^{with lep}";
126 if(do_rc) mjname =
"M_{J}^{no lep}";
129 Axis mj_axis(nbins, minx, maxx,
"mj14", mjname+
" [GeV]", {250., 400.});
130 pm_2015.
Push<
Hist1D>(mj_axis,
"met>200&&met<500 && mt<=140 && nleps==1 && nbm>=1 && njets>=3",
131 procs_2015, plot_types);
133 pm_2015.
Push<
Hist1D>(mj_axis,
"met>200&&met<500 && nels==1 && nmus==1 && nbm<=2 && njets>=5",
134 procs_2015, plot_types);
135 pm_2015.
Push<
Hist1D>(mj_axis,
"met>200&&met<500 && mt<=140 && nleps==1 && nbm>=1 && njets>=6",
136 procs_2015, plot_types);
138 pm.
Push<
Hist1D>(mj_axis,
"met>150&&met<500 && mt<=140 && nleps==1 && nbm>=1 && njets>=3",
139 lowmet_procs, plot_types);
141 pm.
Push<
Hist1D>(mj_axis,
"met>150&&met<500 && nels==1 && nmus==1 && nbm<=2 && njets>=5",
142 lowmet_procs, plot_types);
143 pm.
Push<
Hist1D>(mj_axis,
"met>150&&met<500 && mt<=140 && nleps==1 && nbm>=1 && njets>=6",
144 lowmet_procs, plot_types);
148 pm_2015.
Push<
Hist1D>(mj_axis,
"met>200&&met<500 && nels==1 && nmus==1 && nbm<=2 && njets>=3",
149 procs_2015, plot_types);
151 pm_2015.
Push<
Hist1D>(mj_axis,
"met>200&&met<500 && mt<=140 && nleps==1 && nbm>=1 && njets>=5",
152 procs_2015, plot_types);
153 pm_2015.
Push<
Hist1D>(mj_axis,
"met>200&&met<500 && nels==1 && nmus==1 && nbm<=2 && njets>=6",
154 procs_2015, plot_types);
157 pm.
Push<
Hist1D>(mj_axis,
"met>150&&met<500 && nels==1 && nmus==1 && nbm<=2 && njets>=3",
158 lowmet_procs, plot_types);
160 pm.
Push<
Hist1D>(mj_axis,
"met>200&&met<500 && nels==1 && nmus==1 && nbm<=2 && njets==3",
161 lowmet_procs, plot_types);
162 pm.
Push<
Hist1D>(mj_axis,
"met>200&&met<500 && nels==1 && nmus==1 && nbm<=2 && njets==4",
163 lowmet_procs, plot_types);
164 pm.
Push<
Hist1D>(mj_axis,
"met>150&&met<500 && mt<=140 && nleps==1 && nbm>=1 && njets>=5",
165 lowmet_procs, plot_types);
166 pm.
Push<
Hist1D>(mj_axis,
"met>150&&met<500 && nels==1 && nmus==1 && nbm<=2 && njets>=6",
167 lowmet_procs, plot_types);
179 static struct option long_options[] = {
180 {
"single_thread", no_argument, 0,
's'},
186 opt = getopt_long(argc, argv,
"s", long_options, &option_index);
188 if( opt == -1)
break;
196 optname = long_options[option_index].name;
199 printf(
"Bad option! Found option name %s\n", optname.c_str());
203 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)
Organizes efficient production of plots with single loop over each process.
PlotOpt & Bottom(PlotOptTypes::BottomType bottom_type)
A full 1D plot with stacked/overlayed histograms.
int main(int argc, char *argv[])
void MakePlots(double luminosity, const std::string &subdir="")
Prints all added plots with given luminosity.
PlotOpt & Title(PlotOptTypes::TitleType title_type)
void GetOptions(int argc, char *argv[])
Loads colors from a text configuration file.