15 #include "core/baby.hpp" 31 int main(
int argc,
char *argv[]){
32 gErrorIgnoreLevel = 6000;
37 string base_path =
"";
38 string hostname =
execute(
"echo $HOSTNAME");
40 base_path =
"/net/cms2";
42 string mc_dir = base_path+
"/cms2r0/babymaker/babies/2016_08_10/mc/merged_mcbase_stdnj5/";
44 Palette colors(
"txt/colors.txt",
"default");
47 {mc_dir+
"*_TTJets*Lept*.root", mc_dir+
"*_TTJets_HT*.root"},
48 "ntruleps<=1&&stitch");
49 tt1l->SetMarkerStyle(23);
50 tt1l->SetMarkerSize(0.8);
52 {mc_dir+
"*_TTJets*Lept*.root", mc_dir+
"*_TTJets_HT*.root"},
53 "ntruleps>=2&&stitch");
54 tt2l->SetMarkerStyle(22);
55 tt2l->SetMarkerSize(0.8);
57 {mc_dir+
"*_WJetsToLNu*.root"});
59 {mc_dir+
"*_ST_*.root"});
61 {mc_dir+
"*_TTWJets*.root", mc_dir+
"*_TTZTo*.root"});
63 {mc_dir+
"*DYJetsToLL*.root", mc_dir+
"*_QCD_HT*.root",
64 mc_dir+
"*_ZJet*.root", mc_dir+
"*_WWTo*.root",
65 mc_dir+
"*ggZH_HToBB*.root", mc_dir+
"*ttHJetTobb*.root",
66 mc_dir+
"*_TTGJets*.root", mc_dir+
"*_TTTT_*.root",
67 mc_dir+
"*_WH_HToBB*.root", mc_dir+
"*_WZTo*.root",
68 mc_dir+
"*_ZH_HToBB*.root", mc_dir+
"*_ZZ_*.root"});
70 auto t1tttt = Process::MakeShared<Baby_full>(
"T1tttt(1500,100)",
Process::Type::signal, colors(
"t1tttt"),
71 {mc_dir+
"*SMS-T1tttt_mGluino-1500_mLSP-100*.root"});
72 t1tttt->SetMarkerStyle(21);
73 t1tttt->SetMarkerSize(0.9);
76 {base_path+
"/cms2r0/babymaker/babies/2016_08_10/data/merged_database_stdnj5/*.root"},
"pass&&trig_ra4&&json12p9");
77 data->SetMarkerStyle(20);
78 data->SetMarkerSize(1.);
80 vector<shared_ptr<Process> > all_procs = {
data, t1tttt,
tt1l,
tt2l, wjets, single_t, ttv, other};
81 vector<shared_ptr<Process> > tt_sig = {
tt1l,
tt2l, t1tttt};
83 PlotOpt style(
"txt/plot_styles.txt",
"Scatter");
84 vector<PlotOpt> bkg_hist = {style().
Stack(StackType::data_norm).
Title(TitleType::preliminary)};
85 vector<PlotOpt> bkg_pts = {style().
Stack(StackType::lumi_shapes).
Title(TitleType::info)};
87 NamedFunc baseline =
"nleps==1&&st>500&&met>150&&njets>=6&&nbm>=1";
89 vector<NamedFunc> met_bins = {
"met>200",
"met>150&&met<=200",
"met>200&&met<=350",
"met>350&&met<500",
"met>500"};
90 vector<NamedFunc> nbm_bins = {
"nbm>=1",
"nbm==1",
"nbm>=2"};
93 for(
const auto &met_bin: met_bins){
94 for(
const auto &nbm_bin: nbm_bins){
95 NamedFunc cut = baseline && met_bin && nbm_bin;
96 pm.
Push<
Hist2D>(
Axis(48, 0., 1200.,
"mj14",
"M_{J} [GeV]", {250., 400.}),
97 Axis(25, 0., 700.,
"mt",
"m_{T} [GeV]", {140.}),
98 cut, all_procs, bkg_hist);
99 pm.
Push<
Hist2D>(
Axis(48, 0., 1200.,
"mj14",
"M_{J} [GeV]", {250., 400.}),
100 Axis(25, 0., 700.,
"mt",
"m_{T} [GeV]", {140.}),
101 cut, tt_sig, bkg_pts);
111 static struct option long_options[] = {
112 {
"single_thread", no_argument, 0,
's'},
118 opt = getopt_long(argc, argv,
"s", long_options, &option_index);
120 if( opt == -1)
break;
128 optname = long_options[option_index].name;
131 printf(
"Bad option! Found option name %s\n", optname.c_str());
135 printf(
"Bad option! getopt_long returned character code 0%o\n", opt);
PlotOpt & Stack(PlotOptTypes::StackType stack_type)
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)
int main(int argc, char *argv[])
std::string execute(const std::string &cmd)
FigureType & Push(Args &&...args)
static Int_t RGB(Int_t r, Int_t g, Int_t b)
Gets the ROOT color number corresponding to a given RGB color.
Organizes efficient production of plots with single loop over each process.
void GetOptions(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)
Loads colors from a text configuration file.