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_mc+
"*_QCD_HT*00_Tune*.root", trig_skim_mc+
"*_QCD_HT*Inf_Tune*.root"});
50 {trig_skim_mc+
"*_QCD_bEnriched*.root", trig_skim_mc+
"*_QCD_HT*BGenFilter*.root"});
52 vector<shared_ptr<Process> > full_trig_skim = {qcd, Bqcd};
54 PlotOpt log_lumi(
"txt/plot_styles.txt",
"CMSPaper");
55 log_lumi.
Title(TitleType::preliminary)
57 .
YAxis(YAxisType::log)
58 .
Stack(StackType::data_norm);
62 PlotOpt lin_shapes = log_shapes().
YAxis(YAxisType::linear);
63 PlotOpt log_lumi_info = log_lumi().
Title(TitleType::info);
64 PlotOpt lin_lumi_info = lin_lumi().
Title(TitleType::info);
65 PlotOpt log_shapes_info = log_shapes().
Title(TitleType::info);
66 PlotOpt lin_shapes_info = lin_shapes().
Title(TitleType::info);
67 vector<PlotOpt> all_plot_types = {log_lumi_info, log_shapes_info};
71 vector<TString> nbcuts;
72 nbcuts.push_back(
" nbt >= 2 && nbl <= 3");
73 nbcuts.push_back(
" nbt >= 2 && nbl >= 4");
74 TString metskim(
"nbm>=2&&njets>=4&&njets<=5&&met>100&&nvleps==0");
75 TString trkskim(
"njets>=4&&njets<=5&&met>250&&nvleps==0");
76 TString
skim(
"njets>=4&&njets<=5&&met>250&&nvleps==0&&ntks==0");
78 TString DeltaR(
"hig_drmax < 2.2");
79 TString AverageM(
"hig_am > 100 && hig_am < 140");
80 TString DeltaM(
"hig_dm < 40");
81 TString LDP(
"!low_dphi");
84 metskim, full_trig_skim, all_plot_types);
86 pm.
Push<
Table>(
"QCD_cutflow", vector<TableRow>{
88 TableRow(
"$\\text{1M b-tags}$",
"nbm>=1"),
89 TableRow(
"$\\text{2M b-tags}$",
"nbm>=2"),
90 TableRow(
"$\\text{3M b-tags}$",
"nbm>=3"),
91 TableRow(
"$\\text{4M b-tags}$",
"nbm>=4"),
92 TableRow(
"$\\text{5M b-tags}$",
"nbm>=5"),
93 TableRow(
"$\\text{1T b-tags}$",
"nbt>=1"),
94 TableRow(
"$\\text{2T b-tags}$",
"nbt>=2"),
95 TableRow(
"$\\text{3T b-tags}$",
"nbt>=3"),
96 TableRow(
"$\\text{4T b-tags}$",
"nbt>=4"),
106 static struct option long_options[] = {
107 {
"single_thread", no_argument, 0,
's'},
113 opt = getopt_long(argc, argv,
"s", long_options, &option_index);
115 if( opt == -1)
break;
123 optname = long_options[option_index].name;
126 printf(
"Bad option! Found option name %s\n", optname.c_str());
130 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)
void GetOptions(int argc, char *argv[])
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)
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)
int main(int argc, char *argv[])
Loads colors from a text configuration file.