6 #include "core/baby_full.hpp" 29 if(mj <= 300.)
return orig * (1.3 - 0.4*mj/300.);
35 gErrorIgnoreLevel = 6000;
37 Palette colors(
"txt/colors.txt",
"default");
39 string folder_mc=
"/net/cms2/cms2r0/babymaker/babies/2016_06_14/mc/skim_nleps2/";
41 NamedFunc mll =
"mumuv_m*(mumuv_m>0&&mumu_pt1>25)+elelv_m*(elelv_m>0&&elel_pt1>30)";
42 NamedFunc baseline = mll>80. && mll<100. &&
"(nels>=2||nmus>=2)&&njets>=4&&ht>500&&pass";
45 {folder_mc+
"*_DYJetsToLL*.root"},
48 {folder_mc+
"*_TTJets*Lept*.root", folder_mc+
"*_TTJets_HT*.root"},
49 baseline&&
"ntruleps<=1&&stitch");
51 {folder_mc+
"*_TTJets*Lept*.root", folder_mc+
"*_TTJets_HT*.root"},
52 baseline&&
"ntruleps>=2&&stitch");
54 {folder_mc+
"*_TTWJetsTo*.root", folder_mc+
"*_TTZTo*.root"},
57 {folder_mc+
"*_WJetsToLNu_HT-*.root", folder_mc+
"*_QCD_HT*.root",
58 folder_mc+
"*_TTGJets*.root", folder_mc+
"*_TTTT*.root",
59 folder_mc+
"*_WH_HToBB*.root", folder_mc+
"*_WWTo*.root",
60 folder_mc+
"*_WZTo*.root", folder_mc+
"*_ZH*.root",
61 folder_mc+
"*_ZZ*.root", folder_mc+
"*_ttHJetTobb*.root",
62 folder_mc+
"*_ST*channel*.root"},
65 {
"/net/cms2/cms2r0/babymaker/babies/2016_06_26/data/skim_nleps2/*.root"},
66 baseline&&
"json2p6&&pass&&(trig[4]||trig[8]||trig[13]||trig[33])");
67 vector<shared_ptr<Process> > procs = {data, zjets,
tt1l,
tt2l, ttv, other};
68 PlotOpt log_lumi(
"txt/plot_styles.txt",
"CMSPaper");
69 log_lumi.
Title(TitleType::info)
71 .
YAxis(YAxisType::log)
72 .
Stack(StackType::data_norm);
73 vector<PlotOpt> plot_types = {log_lumi};
76 pm.
Push<
Hist1D>(
Axis(24, 0., 600,
"mj14",
"M_{J} (with lep) [GeV]", {250., 400.}),
77 true, procs, plot_types).
Tag(
"orig");
78 pm.
Push<
Hist1D>(
Axis(24, 0., 600,
"mj14",
"M_{J} (with lep) [GeV]", {250., 400.}),
79 true, procs, plot_types).
Tag(
"orig").
Weight(
"weight/eff_trig*w_toppt");
80 pm.
Push<
Hist1D>(
Axis(24, 0., 600,
"mj14",
"M_{J} (with lep) [GeV]", {250., 400.}),
82 pm.
Push<
Hist1D>(
Axis(24, 0., 600,
"mj14",
"M_{J} (with lep) [GeV]", {250., 400.}),
PlotOpt & Stack(PlotOptTypes::StackType stack_type)
PlotOpt & YAxis(PlotOptTypes::YAxisType y_axis_type)
const NamedFunc njets_weights_ttisr
float const & eff_trig() const
Get eff_trig for current event and cache it.
NamedFunc isr_weight("isr_weight", [](const Baby &b) -> NamedFunc::ScalarType{if(b.ntrupv()< 0) return b.weight();return b.SampleType()==20?Functions::njets_weights_ttisr.GetScalar(b):b.weight()/(b.eff_trig()*b.w_toppt());})
Abstract base class for access to ntuple variables.
Hist1D & Weight(const NamedFunc &weight)
ScalarType GetScalar(const Baby &b) const
Evaluate scalar function with b as argument.
Combines a callable function taking a Baby and returning a scalar or vector with its string represent...
float const & w_toppt() const
Get w_toppt for current event and cache it.
float const & mj14() const
Get mj14 for current event and cache it.
NamedFunc full_weight("full_weight", [](const Baby &b) -> NamedFunc::ScalarType{if(b.ntrupv()< 0) return b.weight();double orig=isr_weight.GetScalar(b);double mj=b.mj14();if(mj<=300.) return orig *(1.3-0.4 *mj/300.);else return orig *0.9;})
FigureType & Push(Args &&...args)
Organizes efficient production of plots with single loop over each process.
PlotOpt & Bottom(PlotOptTypes::BottomType bottom_type)
float const & weight() const
Get weight for current event and cache it.
A full 1D plot with stacked/overlayed histograms.
int const & ntrupv() const
Get ntrupv for current event and cache it.
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)
Loads colors from a text configuration file.