#include <EnsembleRatio.h>
Definition at line 13 of file EnsembleRatio.h.
Definition at line 11 of file EnsembleRatio.cxx.
13 :
fNom(num.Nominal(), denom.Nominal())
15 assert(num.NUniverses() == denom.NUniverses());
16 fUnivs.reserve(num.NUniverses());
17 for(
unsigned int i = 0; i < num.NUniverses(); ++i)
18 fUnivs.emplace_back(num.Universe(i), denom.Universe(i));
std::vector< Ratio > fUnivs
TGraphAsymmErrors * ana::EnsembleRatio::ErrorBand |
( |
| ) |
const |
Definition at line 22 of file EnsembleRatio.cxx.
26 std::vector<std::unique_ptr<TH1D>> hunivs;
27 hunivs.reserve(
fUnivs.size());
28 for(
const Ratio& u:
fUnivs) hunivs.emplace_back(u.ToTH1());
30 TGraphAsymmErrors*
g =
new TGraphAsymmErrors;
32 for(
int binIdx = 0; binIdx < hnom->GetNbinsX()+2; ++binIdx){
33 const double xnom = hnom->GetXaxis()->GetBinCenter(binIdx);
34 const double ynom = hnom->GetBinContent(binIdx);
35 g->SetPoint(binIdx, xnom, ynom);
37 const double dx = hnom->GetXaxis()->GetBinWidth(binIdx);
39 std::vector<double> ys;
40 ys.reserve(hunivs.size());
41 for(
const std::unique_ptr<TH1D>& hu: hunivs){
42 ys.push_back(hu->GetBinContent(binIdx));
51 g->SetPointError(binIdx, dx/2, dx/2,
52 std::max(ynom-y0, 0.),
53 std::max(y1-ynom, 0.));
TH1D * ToTH1(Color_t col=kBlack, Style_t style=kSolid) const
double FindQuantile(double frac, std::vector< double > &xs)
std::vector< Ratio > fUnivs
Ratio ana::EnsembleRatio::Nominal |
( |
| ) |
const |
|
inline |
unsigned int ana::EnsembleRatio::NUniverses |
( |
| ) |
const |
|
inline |
Definition at line 70 of file EnsembleRatio.cxx.
EnsembleRatio(const EnsembleSpectrum &nom, const EnsembleSpectrum &denom)
Definition at line 60 of file EnsembleRatio.cxx.
62 assert(rhs.NUniverses() ==
fUnivs.size());
64 for(
unsigned int i = 0; i <
fUnivs.size(); ++i)
65 fUnivs[i] *= rhs.fUnivs[i];
std::vector< Ratio > fUnivs
Definition at line 88 of file EnsembleRatio.cxx.
EnsembleRatio(const EnsembleSpectrum &nom, const EnsembleSpectrum &denom)
Definition at line 78 of file EnsembleRatio.cxx.
80 assert(rhs.NUniverses() ==
fUnivs.size());
82 for(
unsigned int i = 0; i <
fUnivs.size(); ++i)
83 fUnivs[i] /= rhs.fUnivs[i];
std::vector< Ratio > fUnivs
Ratio ana::EnsembleRatio::Universe |
( |
unsigned int |
i | ) |
const |
|
inline |
Ratio ana::EnsembleRatio::fNom |
|
protected |
std::vector<Ratio> ana::EnsembleRatio::fUnivs |
|
protected |
The documentation for this class was generated from the following files: