ra4_draw  4bd0201e3d922d42bd545d4b045ed44db33454a4
plot_mj_radii.cxx
Go to the documentation of this file.
1 #include <iostream>
2 #include <string>
3 #include <vector>
4 #include <memory>
5 
6 #include "TError.h"
7 #include "TColor.h"
8 
9 #include "core/baby.hpp"
10 #include "core/process.hpp"
11 #include "core/named_func.hpp"
12 #include "core/plot_maker.hpp"
13 #include "core/plot_opt.hpp"
14 #include "core/palette.hpp"
15 #include "core/hist1d.hpp"
16 
17 using namespace std;
18 using namespace PlotOptTypes;
19 
20 int main(){
21  gErrorIgnoreLevel = 6000;
22 
23  double lumi = 10.0;
24 
25  string trig_skim_mc = "/net/cms27/cms27r0/babymaker/2016_04_29/mc/merged_baseline/";
26  string trig_skim_data = "/net/cms27/cms27r0/babymaker/2016_04_29/mc/T1tttt/skim_baseline/";
27 
28  Palette colors("txt/colors.txt", "default");
29 
30  auto tt = Process::MakeShared<Baby_full>("t#bar{t}", Process::Type::background, colors("tt_1l"),
31  {trig_skim_mc+"*_TTJets*Lept*.root", trig_skim_mc+"*_TTJets_HT*.root"},
32  "stitch");
33 
34  auto t1tttt_nc = Process::MakeShared<Baby_full>("T1tttt(1800,200)", Process::Type::signal, colors("t1tttt"),
35  {trig_skim_data+"*SMS-T1tttt_mGluino-1800_mLSP-200_*.root"});
36  auto t1tttt_c = Process::MakeShared<Baby_full>("T1tttt(1400,1000)", Process::Type::signal, colors("t1tttt"),
37  {trig_skim_data+"*SMS-T1tttt_mGluino-1400_mLSP-1000_*.root"});
38  t1tttt_c->SetLineStyle(2);
39 
40  vector<shared_ptr<Process> > full_trig_skim = {t1tttt_nc, t1tttt_c, tt};
41 
42  PlotOpt log_lumi("txt/plot_styles.txt", "CMSPaper");
43  log_lumi.Title(TitleType::preliminary)
44  .Bottom(BottomType::ratio)
45  .YAxis(YAxisType::log)
46  .Stack(StackType::data_norm)
47  .FileExtensions({"pdf","root"});
48  PlotOpt lin_lumi = log_lumi().YAxis(YAxisType::linear);
49  PlotOpt log_shapes = log_lumi().Stack(StackType::shapes)
50  .Bottom(BottomType::off)
51  .ShowBackgroundError(false);
52  PlotOpt lin_shapes = log_shapes().YAxis(YAxisType::linear);
53  PlotOpt log_lumi_info = log_lumi().Title(TitleType::info);
54  PlotOpt lin_lumi_info = lin_lumi().Title(TitleType::info);
55  PlotOpt log_shapes_info = log_shapes().Title(TitleType::info);
56  PlotOpt lin_shapes_info = lin_shapes().Title(TitleType::info);
57  vector<PlotOpt> all_plot_types = {log_lumi, lin_lumi, log_shapes, lin_shapes,
58  log_lumi_info, lin_lumi_info, log_shapes_info, lin_shapes_info};
59 
60  PlotMaker pm;
61  pm.Push<Hist1D>(Axis(30, 0., 1500., "mj", "M_{J}^{R=1.2} [GeV]", {250., 400.}),
62  "nleps==1&&ht>500&&met>200&&njets>=6&&nbm>=1", full_trig_skim, all_plot_types);
63  pm.Push<Hist1D>(Axis(30, 0., 1500., "mj14", "M_{J}^{R=1.4} [GeV]", {250., 400.}),
64  "nleps==1&&ht>500&&met>200&&njets>=6&&nbm>=1", full_trig_skim, all_plot_types);
65 
66  pm.MakePlots(lumi);
67 }
PlotOpt & Stack(PlotOptTypes::StackType stack_type)
Definition: plot_opt.cpp:120
PlotOpt & FileExtensions(const std::set< std::string > &file_extensions)
Definition: plot_opt.cpp:138
PlotOpt & YAxis(PlotOptTypes::YAxisType y_axis_type)
Definition: plot_opt.cpp:102
STL namespace.
int main()
FigureType & Push(Args &&...args)
Definition: plot_maker.hpp:24
Definition: axis.hpp:12
Organizes efficient production of plots with single loop over each process.
Definition: plot_maker.hpp:14
PlotOpt & Bottom(PlotOptTypes::BottomType bottom_type)
Definition: plot_opt.cpp:93
PlotOpt & ShowBackgroundError(bool show_background_error)
Definition: plot_opt.cpp:386
A full 1D plot with stacked/overlayed histograms.
Definition: hist1d.hpp:23
void MakePlots(double luminosity, const std::string &subdir="")
Prints all added plots with given luminosity.
Definition: plot_maker.cpp:54
PlotOpt & Title(PlotOptTypes::TitleType title_type)
Definition: plot_opt.cpp:111
Loads colors from a text configuration file.
Definition: palette.hpp:8