16 #include "TGraphAsymmErrors.h" 28 const std::shared_ptr<Process> &process,
37 double GetMax(
double max_bound = std::numeric_limits<double>::infinity(),
38 bool include_error_bar =
false,
39 bool include_overflow =
false)
const;
40 double GetMin(
double max_bound = 0.,
41 bool include_error_bar =
false,
42 bool include_overflow =
false)
const;
56 const std::vector<std::shared_ptr<Process> > &processes,
57 const std::vector<PlotOpt> &plot_options = {
PlotOpt()});
62 void Print(
double luminosity,
63 const std::string &subdir)
final;
69 std::string
Name()
const;
70 std::string
Title()
const;
75 const std::string &denominator);
87 std::vector<std::unique_ptr<SingleHist1D> >
signals_;
88 std::vector<std::unique_ptr<SingleHist1D> >
datas_;
113 void GetPads(std::unique_ptr<TCanvas> &c,
114 std::unique_ptr<TPad> &top,
115 std::unique_ptr<TPad> &bottom)
const;
117 void FixYAxis(std::vector<TH1D> &bottom_plots)
const;
121 std::vector<TLine>
GetCutLines(
double y_min,
double y_max,
bool adjust_bottom)
const;
122 std::vector<TH1D>
GetBottomPlots(
double &the_min,
double &the_max)
const;
127 double GetMaxDraw(
double max_bound = std::numeric_limits<double>::infinity())
const;
128 double GetMinDraw(
double min_bound = 0.)
const;
130 std::vector<std::shared_ptr<TLegend> >
GetLegends();
131 void AddEntries(std::vector<std::shared_ptr<TLegend> > &legends,
132 const std::vector<std::unique_ptr<SingleHist1D> > &hists,
133 const std::string &style,
134 std::size_t n_entries,
135 std::size_t &entries_added)
const;
138 double GetYield(std::vector<std::unique_ptr<SingleHist1D> >::const_iterator h)
const;
139 double GetMean(std::vector<std::unique_ptr<SingleHist1D> >::const_iterator h)
const;
141 void GetTitleSize(
double &width,
double &height,
bool in_pixels)
const;
double GetMean(std::vector< std::unique_ptr< SingleHist1D > >::const_iterator h) const
Get mean of histogram.
std::vector< ScalarType > VectorType
TLine GetBottomHorizontal() const
Get horizontal line drawn at "agreement" value for bottom plots.
FigureComponent * GetComponent(const Process *process) final
void SetRanges() const
Set y-axis plotting range.
NamedFunc::VectorType cut_vector_
void ScaleHistos() const
Scales histograms to required luminosity.
NamedFunc cut_
Event selection.
Axis xaxis_
Specification of content: plotted variable, binning, etc.
Abstract base class for access to ntuple variables.
std::string tag_
Filename tag to identify plot.
double GetYield(std::vector< std::unique_ptr< SingleHist1D > >::const_iterator h) const
Get integrated number of weighted entries in histogram.
Hist1D & Weight(const NamedFunc &weight)
const std::vector< std::unique_ptr< SingleHist1D > > & GetComponentList(const Process *process)
Combines a callable function taking a Baby and returning a scalar or vector with its string represent...
void RecordEvent(const Baby &baby) final
std::vector< std::unique_ptr< SingleHist1D > > backgrounds_
Background components of the figure.
NamedFunc proc_and_hist_cut_
PlotOpt this_opt_
Plot style currently being drawn.
void NormalizeHistos() const
Normalize histograms to data or 100%*(bin width) if needed for current style.
void Print(double luminosity, const std::string &subdir) final
Produce and save formatted plots at given luminosity.
std::string ratio_numerator_
Label for numerator in ratio plot.
double GetMin(double max_bound=0., bool include_error_bar=false, bool include_overflow=false) const
double mc_scale_
data/MC normalization
double GetMaxDraw(double max_bound=std::numeric_limits< double >::infinity()) const
Get highest drawn point below max_bound across all component histograms.
std::vector< PlotOpt > plot_options_
Styles with which to draw plot.
std::vector< std::unique_ptr< SingleHist1D > > datas_
Data components of the figure.
Hist1D & RatioTitle(const std::string &numerator, const std::string &denominator)
NamedFunc::VectorType val_vector_
void RefreshScaledHistos()
Generates stacked and scaled histograms from unstacked and unscaled ones.
std::vector< std::unique_ptr< SingleHist1D > > signals_
Signal components of the figure.
void StyleHisto(TH1D &h) const
Set label styles and title for a histogram.
std::vector< TH1D > GetBottomPlots(double &the_min, double &the_max) const
Get ratio or other plots drawn on the lower pad.
Container for a TH1D associated with a single Process.
NamedFunc::VectorType wgt_vector_
void ApplyStyles() const
Set label styles and title for all histograms.
void AddEntries(std::vector< std::shared_ptr< TLegend > > &legends, const std::vector< std::unique_ptr< SingleHist1D > > &hists, const std::string &style, std::size_t n_entries, std::size_t &entries_added) const
Distribute processes from list of histograms across legends.
std::vector< TLine > GetCutLines(double y_min, double y_max, bool adjust_bottom) const
Get vertical lines at cut values.
void GetTitleSize(double &width, double &height, bool in_pixels) const
Get width and height of title region.
std::set< const Process * > GetProcesses() const final
double mc_scale_error_
data/MC normalization uncertainty
void StackHistos() const
Stacks histograms if necessary for current plot style.
void FixYAxis(std::vector< TH1D > &bottom_plots) const
Adjust y-axis title offset based on y-axis range.
void AdjustFillStyles() const
Make histograms a hollow line for unstacked styles.
std::vector< std::shared_ptr< TLegend > > GetLegends()
Get list of legends emulating single legend with multiple columns.
void MergeOverflow() const
Moves overflow (underflow) contents into last (first) visible bin.
std::vector< std::shared_ptr< TLatex > > GetTitleTexts() const
Get text to print at top of plot.
double GetMax(double max_bound=std::numeric_limits< double >::infinity(), bool include_error_bar=false, bool include_overflow=false) const
TH1D scaled_hist_
Kludge. Mutable storage of scaled and stacked histogram.
A full 1D plot with stacked/overlayed histograms.
void GetPads(std::unique_ptr< TCanvas > &c, std::unique_ptr< TPad > &top, std::unique_ptr< TPad > &bottom) const
Generated canvas and pads for top and bottom plots.
double luminosity_
Luminosity currently being drawn.
std::string ratio_denominator_
Label for denominator in ratio plot.
TH1D raw_hist_
Histogram storing distribution before stacking and luminosity weighting.
std::string Title() const
SingleHist1D & operator=(const SingleHist1D &)=delete
Hist1D & Tag(const std::string &tag)
void StripTopPlotLabels() const
NamedFunc weight_
Event weight.
void InitializeHistos() const
Sets all Hist1D::SingleHist1D::scaled_hist_ to corresponding Hist1D::SingleHist1D::raw_hist_.
TGraphAsymmErrors GetBackgroundError() const
Get uncertainty on total background.
double GetMinDraw(double min_bound=0.) const
Get lowest drawn point above min_bound across all component histograms.
double GetLegendRatio() const
Get factor by which to expand y-axis range to fit legend.