Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "TH1F.h"
7 #include "THStack.h"
8 #include "TLine.h"
9 
10 #include "boca/plotting/Canvas.hh"
11 #include "boca/plotting/Legend.hh"
12 #include "boca/latex/Names.hh"
13 
14 namespace boca
15 {
16 
17 class Histograms : public Canvas
18 {
19 
20 public:
21 
22  Histograms();
23 
24  Histograms(std::string const& path, std::string const& name, bool show_title = false);
25 
26  ~Histograms();
27 
28  void AddHistogram(const std::vector< double >& values, const Names& name, const boca::Rectangle< double >& range);
29 
30  void AddHistogram(const std::vector< double >& values, const Names& name, boca::Range<double> const& range, bool is_int = false);
31 
32  void SetLegend(Orientation orientation, std::string const& title = "");
33 
34  void Draw();
35 
36  void SetXAxis(latex::String const& title, Range<double> const& range = Range<double>());
37 
38  void SetYAxis(latex::String const& title, Range<double> const& range = Range<double>());
39 
40  void AddLine(double x_value, std::string const& title = "");
41 
42 private:
43 
44  Range<double> RangeY();
45 
46  Range<double> RangeX();
47 
48  void AddHistograms();
49 
50  THStack stack_;
51 
52  Legend legend_;
53 
54  std::vector<TH1F> histograms_;
55 
56  std::vector<TLine> lines_;
57 
58  Rectangle<double> range_;
59 
60 };
61 
62 }
void SetXAxis(latex::String const &title, Range< double > const &range=Range< double >())
Definition: Histograms.cpp:75
Definition: Names.hh:11
~Histograms()
Definition: Histograms.cpp:23
void AddHistogram(const std::vector< double > &values, const Names &name, const boca::Rectangle< double > &range)
Definition: Histograms.cpp:45
Histograms()
Definition: Histograms.cpp:12
Definition: String.hh:45
Boosted Collider Analysis.
Definition: Analysis.hh:15
Definition: Canvas.hh:14
void SetYAxis(latex::String const &title, Range< double > const &range=Range< double >())
Definition: Histograms.cpp:84
Definition: Histograms.hh:17
Definition: Legend.hh:15
void AddLine(double x_value, std::string const &title="")
Definition: Histograms.cpp:125
Orientation
Orientation of the Legend.
Definition: Orientation.hh:20
void Draw()
Definition: Histograms.cpp:60
void SetLegend(Orientation orientation, std::string const &title="")
Definition: Histograms.cpp:52