15 #include "core/baby.hpp" 33 int main(
int argc,
char *argv[]){
35 string hostname =
execute(
"echo $HOSTNAME");
37 bfolder =
"/net/cms2";
38 gErrorIgnoreLevel = 6000;
43 string trig_skim_mc =
"/cms2r0/babymaker/babies/2016_08_10/mc/merged_higmc_higloose/";
44 string trig_skim_signal =
"/cms2r0/babymaker/babies/2016_08_10/TChiHH/merged_higmc_higloose/";
46 Palette colors(
"txt/colors.txt",
"default");
48 {trig_skim_signal+
"*TChiHH_mGluino-400*.root"});
50 {trig_skim_mc+
"*_TTJets*Lept*.root", trig_skim_mc+
"*_TTJets_HT*.root"},
"stitch");
52 {trig_skim_mc+
"*_WJetsToLNu*.root"});
56 {trig_skim_mc+
"*ST_tW*.root"});
58 {trig_skim_mc+
"*_QCD_HT*00_Tune*.root", trig_skim_mc+
"*_QCD_HT*Inf_Tune*.root"});
60 {trig_skim_mc+
"*DYJetsToLL*.root", trig_skim_mc+
"*TTTT*.root", trig_skim_mc+
"*_TTWJets*.root",
61 trig_skim_mc+
"*_WH_*.root", trig_skim_mc+
"*_ttHJet*.root", trig_skim_mc+
"*_ZH_*.root",
62 trig_skim_mc+
"*_ST_*channel*.root", trig_skim_mc+
"*_TTGJets*.root", trig_skim_mc+
"*_TTZTo*.root"});
65 vector<shared_ptr<Process> > full_trig_skim = {tchi, tt, wjets, wt, qcd, other};
67 PlotOpt log_lumi(
"txt/plot_styles.txt",
"CMSPaper");
68 log_lumi.
Title(TitleType::preliminary)
70 .
YAxis(YAxisType::log)
71 .
Stack(StackType::data_norm);
75 PlotOpt lin_shapes = log_shapes().
YAxis(YAxisType::linear);
76 PlotOpt log_lumi_info = log_lumi().
Title(TitleType::info);
77 PlotOpt lin_lumi_info = lin_lumi().
Title(TitleType::info);
78 PlotOpt log_shapes_info = log_shapes().
Title(TitleType::info);
79 PlotOpt lin_shapes_info = lin_shapes().
Title(TitleType::info);
80 vector<PlotOpt> all_plot_types = {log_lumi_info};
84 vector<NamedFunc> nbcuts;
85 nbcuts.push_back(
" nbt >= 2 && nbl <= 3");
86 nbcuts.push_back(
" nbt >= 2 && nbl >= 4");
87 NamedFunc metskim(
"njets>=4&&njets<=5&&met>100&&nvleps==0");
88 NamedFunc trkskim(
"njets>=4&&njets<=5&&met>250&&nvleps==0");
89 NamedFunc skim(
"njets>=4&&njets<=5&&met>250&&nvleps==0&&ntks==0");
91 NamedFunc AverageM(
"hig_am > 100 && hig_am < 140");
96 skim&&DeltaR&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
98 skim&&DeltaR&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
100 skim&&DeltaR&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
102 for(
auto inb: nbcuts) {
103 pm.
Push<
Hist1D>(
Axis(20,100,600,
"met",
"E_{T}^{miss} [GeV]", {150., 250.}),
104 inb&&metskim&&DeltaR&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
106 inb&&skim&&DeltaR&&AverageM&&LDP, full_trig_skim, all_plot_types);
107 pm.
Push<
Hist1D>(
Axis(25,0,250,
"hig_am",
"<m> [GeV]", {100., 140.}),
108 inb&&skim&&DeltaR&&DeltaM&&LDP, full_trig_skim, all_plot_types);
110 inb&&skim&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
112 inb&&skim&&DeltaR&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
114 inb&&skim&&DeltaR&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
116 inb&&trkskim&&DeltaR&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
118 inb&&skim&&DeltaR&&AverageM&&DeltaM, full_trig_skim, all_plot_types);
120 inb&&skim&&DeltaR&&AverageM&&DeltaM, full_trig_skim, all_plot_types);
122 inb&&skim&&DeltaR&&AverageM&&DeltaM, full_trig_skim, all_plot_types);
123 pm.
Push<
Hist1D>(
Axis(30,0,600,
"jets_pt[0]",
"Jet 1 p_{T} [GeV]", {50.}),
124 inb&&skim&&DeltaR&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
125 pm.
Push<
Hist1D>(
Axis(35,0,350,
"jets_pt[1]",
"Jet 2 p_{T} [GeV]", {50.}),
126 inb&&skim&&DeltaR&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
128 inb&&skim&&DeltaR&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
130 inb&&skim&&DeltaR&&AverageM&&DeltaM&&LDP, full_trig_skim, all_plot_types);
133 pm.
Push<
Table>(
"cutflow", vector<TableRow>{
134 TableRow(
"$MET > 100$, $\\text{2M b-tags}$, $\\text{4 or 5 jets}$, $0\\ell$",
"1"),
135 TableRow(
"$\\Delta\\phi_{\\text{min}}$", LDP),
136 TableRow(
"$\\Delta m < 40$", DeltaM&&LDP,1,0),
137 TableRow(
"$\\left< m \\right> \\in (100,140)$", AverageM&&LDP),
138 TableRow(
"$\\Delta R_{\\text{max}} < 2.2$", DeltaR&&LDP)
148 static struct option long_options[] = {
149 {
"single_thread", no_argument, 0,
's'},
155 opt = getopt_long(argc, argv,
"s", long_options, &option_index);
157 if( opt == -1)
break;
165 optname = long_options[option_index].name;
168 printf(
"Bad option! Found option name %s\n", optname.c_str());
172 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)
int main(int argc, char *argv[])
Combines a callable function taking a Baby and returning a scalar or vector with its string represent...
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)
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.