5 #include "TGraphAsymmErrors.h"
13 : fNom(num.Nominal(), denom.Nominal())
17 for(
unsigned int i = 0; i < num.
NUniverses(); ++i)
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.));
64 for(
unsigned int i = 0; i <
fUnivs.size(); ++i)
82 for(
unsigned int i = 0; i <
fUnivs.size(); ++i)
EnsembleRatio & operator/=(const EnsembleRatio &rhs)
TH1D * ToTH1(Color_t col=kBlack, Style_t style=kSolid) const
EnsembleRatio operator/(const EnsembleRatio &rhs) const
double FindQuantile(double frac, std::vector< double > &xs)
process_name opflashCryoW ana
TGraphAsymmErrors * ErrorBand() const
EnsembleRatio & operator*=(const EnsembleRatio &rhs)
EnsembleRatio(const EnsembleSpectrum &nom, const EnsembleSpectrum &denom)
Represent the ratio between two spectra.
unsigned int NUniverses() const
std::vector< Ratio > fUnivs
EnsembleRatio operator*(const EnsembleRatio &rhs) const
Spectrum Universe(unsigned int i) const
unsigned int NUniverses() const