15 #include "core/baby.hpp" 34 int main(
int argc,
char *argv[]){
35 gErrorIgnoreLevel = 6000;
40 string base_path =
"";
41 string hostname =
execute(
"echo $HOSTNAME");
43 base_path =
"/net/cms2";
45 string mc_dir = base_path+
"/cms2r0/babymaker/babies/2016_08_10/mc/merged_mcbase_stdnj5/";
47 Palette colors(
"txt/colors.txt",
"default");
50 {mc_dir+
"*_TTJets*Lept*.root", mc_dir+
"*_TTJets_HT*.root"},
51 "ntruleps<=1&&stitch");
52 tt1l->SetMarkerStyle(23);
53 tt1l->SetMarkerSize(0.8);
55 {mc_dir+
"*_TTJets*Lept*.root", mc_dir+
"*_TTJets_HT*.root"},
56 "ntruleps>=2&&stitch");
57 tt1l->SetMarkerStyle(22);
58 tt1l->SetMarkerSize(0.8);
60 {mc_dir+
"*_WJetsToLNu*.root"});
62 {mc_dir+
"*_ST_*.root"});
64 {mc_dir+
"*_TTWJets*.root", mc_dir+
"*_TTZTo*.root"});
66 {mc_dir+
"*DYJetsToLL*.root", mc_dir+
"*_QCD_HT*.root",
67 mc_dir+
"*_ZJet*.root", mc_dir+
"*_WWTo*.root",
68 mc_dir+
"*ggZH_HToBB*.root", mc_dir+
"*ttHJetTobb*.root",
69 mc_dir+
"*_TTGJets*.root", mc_dir+
"*_TTTT_*.root",
70 mc_dir+
"*_WH_HToBB*.root", mc_dir+
"*_WZTo*.root",
71 mc_dir+
"*_ZH_HToBB*.root", mc_dir+
"*_ZZ_*.root"});
73 auto t1tttt_nc = Process::MakeShared<Baby_full>(
"T1tttt(1500,100)",
Process::Type::signal, colors(
"t1tttt"),
74 {mc_dir+
"*SMS-T1tttt_mGluino-1500_mLSP-100*.root"});
75 t1tttt_nc->SetMarkerStyle(21);
76 t1tttt_nc->SetMarkerSize(0.9);
77 auto t1tttt_c = Process::MakeShared<Baby_full>(
"T1tttt(1200,800)",
Process::Type::signal, colors(
"t1tttt"),
78 {mc_dir+
"*SMS-T1tttt_mGluino-1200_mLSP-800*.root"});
79 t1tttt_c->SetLineStyle(2);
80 t1tttt_c->SetMarkerStyle(21);
81 t1tttt_c->SetMarkerSize(0.9);
84 {base_path+
"/cms2r0/babymaker/babies/2016_08_10/data/merged_database_stdnj5/*.root"},
"pass&&trig_ra4&&json12p9");
85 data->SetMarkerStyle(20);
86 data->SetMarkerSize(1.);
88 vector<shared_ptr<Process> > full_trig_skim = {
data, t1tttt_nc, t1tttt_c,
tt1l,
tt2l, wjets, single_t, ttv, other};
90 PlotOpt log_lumi(
"txt/plot_styles.txt",
"CMSPaper");
91 log_lumi.
Title(TitleType::preliminary)
93 .
YAxis(YAxisType::log)
94 .
Stack(StackType::data_norm);
98 PlotOpt lin_shapes = log_shapes().
YAxis(YAxisType::linear);
99 PlotOpt log_lumi_info = log_lumi().
Title(TitleType::info);
100 PlotOpt lin_lumi_info = lin_lumi().
Title(TitleType::info);
101 PlotOpt log_shapes_info = log_shapes().
Title(TitleType::info);
102 PlotOpt lin_shapes_info = lin_shapes().
Title(TitleType::info);
103 vector<PlotOpt> all_plot_types = {log_lumi, lin_lumi, log_shapes, lin_shapes,
104 log_lumi_info, lin_lumi_info, log_shapes_info, lin_shapes_info};
105 PlotOpt style2D(
"txt/plot_styles.txt",
"Scatter");
106 vector<PlotOpt> bkg_hist = {style2D().
Stack(StackType::data_norm).
Title(TitleType::preliminary)};
107 vector<PlotOpt> bkg_pts = {style2D().
Stack(StackType::lumi_shapes).
Title(TitleType::info)};
110 pm.
Push<
Hist1D>(
Axis(7, -0.5, 6.5,
"nleps",
"Num. Leptons", {0.5, 1.5}),
111 "st>500&&met>200&&njets>=6&&nbm>=1", full_trig_skim, all_plot_types);
113 "nleps==1&&met>200&&njets>=6&&nbm>=1", full_trig_skim, all_plot_types);
114 pm.
Push<
Hist1D>(
Axis(40, 0, 1000.,
"met",
"MET [GeV]", {200., 400.}),
115 "nleps==1&&st>500&&njets>=6&&nbm>=1", full_trig_skim, all_plot_types);
116 pm.
Push<
Hist1D>(
Axis(16, -0.5, 15.5,
"njets",
"Num. AK4 Jets", {5.5, 8.5}),
117 "nleps==1&&st>500&&met>200&&nbm>=1", full_trig_skim, all_plot_types);
118 pm.
Push<
Hist1D>(
Axis(11, -0.5, 10.5,
"nbm",
"Num. b-Tagged Jets", {0.5, 1.5, 2.5}),
119 "nleps==1&&st>500&&met>200&&njets>=6", full_trig_skim, all_plot_types);
120 pm.
Push<
Hist1D>(
Axis(24, 0., 1200.,
"mj14",
"M_{J} [GeV]", {250., 400.}),
121 "nleps==1&&st>500&&met>200&&njets>=6&&nbm>=1", full_trig_skim, all_plot_types);
123 "nleps==1&&st>500&&met>200&&njets>=6&&nbm>=1", full_trig_skim, all_plot_types);
124 pm.
Push<
Hist1D>(
Axis(15, 0., 1500.,
"mj14",
"M_{J} [GeV]", {400.}),
125 "nleps==1&&st>500&&met>200", full_trig_skim, all_plot_types)
126 .
Tag(
"changing_tags_and_weights").
Weight(
"1.2345*weight").
RatioTitle(
"Numerator",
"Denominator");
130 TableRow(
"$1\\ell$, $H_{T}>500$, $E_{\\text{T}}^{\\text{miss}}>200$",
"nleps==1&&st>500&&met>200"),
131 TableRow(
"$N_{\\text{jets}}\\geq6$",
"nleps==1&&st>500&&met>200&&njets>=6"),
132 TableRow(
"$N_{b}\\geq1$",
"nleps==1&&st>500&&met>200&&njets>=6&&nbm>=1"),
133 TableRow(
"$M_{J}>250$",
"nleps==1&&st>500&&met>200&&njets>=6&&nbm>=1&&mj14>250", 1, 0),
135 TableRow(
"$m_{T}>140$",
"nleps==1&&st>500&&met>200&&njets>=6&&nbm>=1&&mj14>250&&mt>140"),
136 TableRow(
"$M_{J}>400$",
"nleps==1&&st>500&&met>200&&njets>=6&&nbm>=1&&mj14>400&&mt>140"),
138 TableRow(
"$E_{\\text{T}}^{\\text{miss}}>500$",
"nleps==1&&st>500&&met>500&&njets>=6&&nbm>=1&&mj14>400&&mt>140"),
139 TableRow(
"$N_{\\text{jets}}\\geq9$",
"nleps==1&&st>500&&met>500&&njets>=9&&nbm>=1&&mj14>400&&mt>140"),
140 TableRow(
"$N_{b}\\geq3$",
"nleps==1&&st>500&&met>500&&njets>=9&&nbm>=3&&mj14>400&&mt>140")
142 pm.
Push<
EventScan>(
"scan",
true, vector<NamedFunc>{
"weight",
"met"}, vector<shared_ptr<Process> >{
tt1l});
143 pm.
Push<
Hist2D>(
Axis(48, 0., 1200.,
"mj14",
"M_{J} [GeV]", {250., 400.}),
144 Axis(25, 0., 700.,
"mt",
"m_{T} [GeV]", {140.}),
145 "nleps==1&&st>500&&met>200&&njets>=6&&nbm>=1",
146 full_trig_skim, bkg_hist);
147 pm.
Push<
Hist2D>(
Axis(48, 0., 1200.,
"mj14",
"M_{J} [GeV]", {250., 400.}),
148 Axis(25, 0., 700.,
"mt",
"m_{T} [GeV]", {140.}),
149 "nleps==1&&st>500&&met>200&&njets>=6&&nbm>=1",
150 vector<shared_ptr<Process> >{
tt1l,
tt2l, t1tttt_nc}, bkg_pts);
156 for(
const auto &yield: yields){
157 cout << yield << endl;
163 static struct option long_options[] = {
164 {
"single_thread", no_argument, 0,
's'},
170 opt = getopt_long(argc, argv,
"s", long_options, &option_index);
172 if( opt == -1)
break;
180 optname = long_options[option_index].name;
183 printf(
"Bad option! Found option name %s\n", optname.c_str());
187 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)
Hist1D & Weight(const NamedFunc &weight)
bool Contains(const std::string &str, const std::string &pat)
std::string execute(const std::string &cmd)
Hist1D & RatioTitle(const std::string &numerator, const std::string &denominator)
FigureType & Push(Args &&...args)
std::vector< GammaParams > BackgroundYield(double luminosity) const
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.
Hist1D & Tag(const std::string &tag)
PlotOpt & Title(PlotOptTypes::TitleType title_type)
int main(int argc, char *argv[])
void GetOptions(int argc, char *argv[])
Loads colors from a text configuration file.