All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ratio.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace ana
6 {
7  /// Represent the ratio between two spectra
8  class Ratio
9  {
10  public:
11  friend class Spectrum;
12 
13  /// \param num Numerator of the ratio
14  /// \param denom Denominator of the ratio
15  /// \param purOrEffErrs Does this ratio represent a purity or efficiency
16  /// plot? If so, error bars are calculated differently.
17  Ratio(const Spectrum& num, const Spectrum& denom,
18  bool purOrEffErrs = false);
19 
20  /// Don't use this constructor unless you REALLY KNOW what you're doing.
21  Ratio(TH1* h, std::string varName = "");
22  virtual ~Ratio();
23 
24  Ratio(const Ratio& rhs);
25  Ratio& operator=(const Ratio& rhs);
26 
27  Ratio& operator*=(const Ratio& rhs);
28  Ratio operator*(const Ratio& rhs) const;
29 
30  Ratio& operator/=(const Ratio& rhs);
31  Ratio operator/(const Ratio& rhs) const;
32 
33  TH1D* ToTH1(Color_t col = kBlack,
34  Style_t style = kSolid) const;
35  protected:
36  TH1D* fHist;
37  };
38 
39  inline Ratio operator/(const Spectrum& lhs, const Spectrum& rhs){return Ratio(lhs, rhs);}
40 } // namespace
TH1D * ToTH1(Color_t col=kBlack, Style_t style=kSolid) const
Definition: Ratio.cxx:116
Ratio & operator=(const Ratio &rhs)
Definition: Ratio.cxx:73
Ratio & operator*=(const Ratio &rhs)
Definition: Ratio.cxx:86
def style
Definition: util.py:237
process_name opflashCryoW ana
Ratio & operator/=(const Ratio &rhs)
Definition: Ratio.cxx:101
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:30
Ratio operator*(const Ratio &rhs) const
Definition: Ratio.cxx:93
while getopts h
Ratio(const Spectrum &num, const Spectrum &denom, bool purOrEffErrs=false)
Definition: Ratio.cxx:13
TH1D * fHist
Definition: Ratio.h:36
Ratio operator/(const Ratio &rhs) const
Definition: Ratio.cxx:108
EnsembleRatio operator/(const EnsembleSpectrum &lhs, const EnsembleSpectrum &rhs)
Definition: EnsembleRatio.h:39
Represent the ratio between two spectra.
Definition: Ratio.h:8
virtual ~Ratio()
Definition: Ratio.cxx:58