#include "/cvmfs/nova.opensciencegrid.org/externals/cafanacore/v01.12/src/CAFAna/Core/Hist.h"
Public Member Functions | |
Hist (const Hist &) | |
Hist (Hist &&) | |
Hist & | operator= (const Hist &) |
Hist & | operator= (Hist &&) |
~Hist () | |
bool | Initialized () const |
TH1D * | ToTH1 (const Binning &bins) const |
bool | HasStan () const |
const Eigen::ArrayXd & | GetEigen () const |
const Eigen::ArrayXstan & | GetEigenStan () const |
int | GetNbinsX () const |
double | GetBinError (int i) const |
double | Integral () const |
void | Fill (const Binning &bins, double x, double w) |
void | Scale (double s) |
void | Scale (const stan::math::var &s) |
void | ResetErrors () |
double | GetBinContent (int i) const |
void | SetBinContent (int i, double x) |
void | Reset () |
void | Add (const Hist &rhs, double scale=1) |
void | Multiply (const Hist &rhs) |
void | Divide (const Hist &rhs) |
void | Write (const Binning &bins) const |
Static Public Member Functions | |
static Hist | Uninitialized () |
static Hist | Zero (int nbins) |
static Hist | ZeroSparse (int nbins) |
static Hist | AdoptSparse (Eigen::SparseVector< double > &&v) |
static Hist | AdoptStan (Eigen::ArrayXstan &&v) |
static Hist | Adopt (Eigen::ArrayXd &&v) |
static Hist | FromDirectory (TDirectory *dir) |
Protected Types | |
enum | EType { kUninitialized, kDense, kDenseStan, kSparse } |
Protected Member Functions | |
Hist () | |
void | Add (const Eigen::SparseVector< double > &rhs, double scale) |
void | Add (const Eigen::ArrayXstan &rhs, double scale) |
void | Add (const Eigen::ArrayXd &rhs, double scale) |
Protected Attributes | |
EType | fType |
Eigen::SparseVector< double > | fDataSparse |
Eigen::ArrayXstan | fDataStan |
Eigen::ArrayXd | fData |
Eigen::ArrayXd | fSumSq |
Accumulate errors, if enabled. More... | |
bool | fSqrtErrs |
Special case when filled with unweighted data. More... | |
|
protected |
ana::Hist::Hist | ( | const Hist & | rhs | ) |
Definition at line 61 of file Hist.cxx.
References ana::assert(), fData, fDataSparse, fDataStan, fSqrtErrs, fSumSq, fType, and Initialized().
ana::Hist::Hist | ( | Hist && | rhs | ) |
Definition at line 76 of file Hist.cxx.
References ana::assert(), fData, fDataSparse, fDataStan, fSqrtErrs, fSumSq, fType, and std::swap().
|
protected |
Definition at line 455 of file Hist.cxx.
References ana::assert(), fData, fDataSparse, fDataStan, fSqrtErrs, fSumSq, fType, Initialized(), kDense, kDenseStan, and kSparse.
Referenced by ana::Spectrum::PlusEqualsHelper().
|
protected |
|
protected |
|
protected |
|
static |
Definition at line 149 of file Hist.cxx.
References fData, fType, kDense, runNovaSAM::ret, and registry_explorer::v.
Referenced by ana::ReweightableSpectrum::UnWeighted(), ana::ReweightableSpectrum::WeightedBy(), and ana::ReweightableSpectrum::WeightingVariable().
|
static |
Definition at line 131 of file Hist.cxx.
References fDataSparse, fType, kSparse, runNovaSAM::ret, and registry_explorer::v.
|
static |
Definition at line 140 of file Hist.cxx.
References fDataStan, fType, kDenseStan, runNovaSAM::ret, and registry_explorer::v.
Referenced by ana::ReweightableSpectrum::WeightedBy().
Definition at line 531 of file Hist.cxx.
References ana::assert(), om::cout, allTimeWatchdog::endl, fData, fDataStan, fSqrtErrs, fSumSq, fType, Initialized(), kDense, kDenseStan, kSparse, and util::sqr().
Referenced by ana::Ratio::operator/=(), ana::Spectrum::operator/=(), and ana::Ratio::Ratio().
Definition at line 265 of file Hist.cxx.
References ana::assert(), bin, om::cout, allTimeWatchdog::endl, fData, fDataSparse, ana::Binning::FindBin(), fSqrtErrs, fSumSq, fType, gStatErrs, Initialized(), kDense, kDenseStan, kSparse, and w.
Referenced by ana::Spectrum::Fill().
|
static |
Definition at line 158 of file Hist.cxx.
References ana::assert(), d, fData, fDataSparse, fSumSq, fType, gStatErrs, make_syst_table_plots::h, MECModelEnuComparisons::i, compare_h5_caf::idx, kDense, kSparse, nbins, runNovaSAM::ret, util::sqr(), and submit_syst::y.
Referenced by ana::Spectrum::LoadFrom().
double ana::Hist::GetBinContent | ( | int | i | ) | const |
Definition at line 349 of file Hist.cxx.
References ana::assert(), fData, fDataSparse, fDataStan, fType, MECModelEnuComparisons::i, Initialized(), kDense, kDenseStan, and kSparse.
Referenced by GetBinError(), ana::Spectrum::Mean(), ana::Spectrum::MockData(), and ana::Ratio::Ratio().
double ana::Hist::GetBinError | ( | int | i | ) | const |
Definition at line 241 of file Hist.cxx.
References ana::assert(), fSqrtErrs, fSumSq, GetBinContent(), Initialized(), and std::sqrt().
Referenced by ana::Spectrum::Integral(), and ToTH1().
|
inline |
Definition at line 53 of file Hist.h.
References ana::assert().
Referenced by ana::Ratio::GetEigen(), and ana::Spectrum::GetEigen().
|
inline |
Definition at line 54 of file Hist.h.
References ana::assert(), Divide(), Fill(), MECModelEnuComparisons::i, Integral(), slidt::Reset(), scale, Scale(), SetBinContent(), w, Write(), and submit_syst::x.
Referenced by ana::Ratio::GetEigenStan(), and ana::Spectrum::GetEigenStan().
int ana::Hist::GetNbinsX | ( | ) | const |
Definition at line 228 of file Hist.cxx.
References ana::assert(), fData, fDataSparse, fDataStan, fType, Initialized(), kDense, kDenseStan, and kSparse.
Referenced by ana::Spectrum::Integral(), ana::Spectrum::MockData(), and ana::Ratio::Ratio().
|
inline |
Definition at line 52 of file Hist.h.
Referenced by ana::Ratio::HasStan(), and ana::Spectrum::HasStan().
|
inline |
Definition at line 39 of file Hist.h.
References bins, dir, nbins, registry_explorer::v, and Zero().
Referenced by Add(), Divide(), Fill(), GetBinContent(), GetBinError(), GetNbinsX(), Hist(), Integral(), Multiply(), operator=(), ana::Spectrum::PlusEqualsHelper(), Scale(), SetBinContent(), ToTH1(), and Write().
double ana::Hist::Integral | ( | ) | const |
Definition at line 252 of file Hist.cxx.
References ana::assert(), fData, fDataSparse, fDataStan, fType, Initialized(), kDense, kDenseStan, and kSparse.
Referenced by ana::Spectrum::Integral(), and ana::Spectrum::PlusEqualsHelper().
Definition at line 479 of file Hist.cxx.
References ana::assert(), om::cout, allTimeWatchdog::endl, fData, fDataStan, fSqrtErrs, fSumSq, fType, Initialized(), kDense, kDenseStan, kSparse, and util::sqr().
Referenced by ana::Ratio::operator*=(), and ana::Spectrum::operator*=().
Definition at line 90 of file Hist.cxx.
References ana::assert(), fData, fDataSparse, fDataStan, fSqrtErrs, fSumSq, fType, and Initialized().
Definition at line 109 of file Hist.cxx.
References ana::assert(), fData, fDataSparse, fDataStan, fSqrtErrs, fSumSq, fType, and std::swap().
Definition at line 382 of file Hist.cxx.
References fData, fDataSparse, fDataStan, fSqrtErrs, fSumSq, fType, kDense, kDenseStan, and kSparse.
Referenced by ana::Spectrum::Clear().
void ana::Hist::ResetErrors | ( | ) |
Definition at line 342 of file Hist.cxx.
References fSqrtErrs, and fSumSq.
Referenced by ana::Spectrum::AsimovData(), and ana::Spectrum::MockData().
void ana::Hist::Scale | ( | double | s | ) |
Definition at line 296 of file Hist.cxx.
References ana::assert(), fData, fDataSparse, fDataStan, fSqrtErrs, fSumSq, fType, Initialized(), kDense, kDenseStan, and kSparse.
Referenced by ana::Spectrum::AsimovData(), ana::Ratio::Ratio(), and ana::Spectrum::Scale().
void ana::Hist::Scale | ( | const stan::math::var & | s | ) |
Definition at line 313 of file Hist.cxx.
References ana::assert(), fData, fDataSparse, fDataStan, fSqrtErrs, fSumSq, fType, Initialized(), kDense, kDenseStan, kSparse, and stan::math::var::val().
Definition at line 363 of file Hist.cxx.
References ana::assert(), om::cout, allTimeWatchdog::endl, fData, fDataSparse, fSqrtErrs, fSumSq, fType, MECModelEnuComparisons::i, Initialized(), kDense, kDenseStan, kSparse, and submit_syst::x.
Referenced by ana::Spectrum::MockData(), and ana::Ratio::Ratio().
TH1D * ana::Hist::ToTH1 | ( | const Binning & | bins | ) | const |
Definition at line 207 of file Hist.cxx.
References ana::assert(), fData, fDataSparse, fDataStan, fSqrtErrs, fSumSq, fType, GetBinError(), MECModelEnuComparisons::i, Initialized(), kDense, kDenseStan, kSparse, ana::MakeTH1D(), ana::Binning::NBins(), runNovaSAM::ret, ana::UniqueName(), and febshutoff_auto::val.
Referenced by ana::Ratio::ToTH1(), ana::Spectrum::ToTH1(), and Write().
Definition at line 583 of file Hist.cxx.
References ana::assert(), om::cout, allTimeWatchdog::endl, fDataSparse, fSqrtErrs, fType, make_syst_table_plots::h, compare_h5_caf::idx, Initialized(), ana::Binning::IsSimple(), it, kDense, kDenseStan, kSparse, ana::Binning::Max(), ana::Binning::Min(), getGoodRuns4SAM::n, ana::Binning::NBins(), std::sqrt(), ToTH1(), and x1.
Referenced by ana::Spectrum::SaveTo().
Definition at line 41 of file Hist.cxx.
References fData, fSqrtErrs, fType, kDense, runNovaSAM::ret, and Zero().
Referenced by ana::Spectrum::Spectrum().
Definition at line 51 of file Hist.cxx.
References fDataSparse, fSqrtErrs, fType, kSparse, and runNovaSAM::ret.
Referenced by ana::Spectrum::Spectrum().
|
protected |
Definition at line 88 of file Hist.h.
Referenced by Add(), Adopt(), Divide(), Fill(), FromDirectory(), GetBinContent(), GetNbinsX(), Hist(), Integral(), Multiply(), operator=(), Reset(), Scale(), SetBinContent(), ToTH1(), and Zero().
|
protected |
Definition at line 86 of file Hist.h.
Referenced by Add(), AdoptSparse(), Fill(), FromDirectory(), GetBinContent(), GetNbinsX(), Hist(), Integral(), operator=(), Reset(), Scale(), SetBinContent(), ToTH1(), Write(), and ZeroSparse().
|
protected |
Definition at line 87 of file Hist.h.
Referenced by Add(), AdoptStan(), Divide(), GetBinContent(), GetNbinsX(), Hist(), Integral(), Multiply(), operator=(), Reset(), Scale(), and ToTH1().
|
protected |
Special case when filled with unweighted data.
Definition at line 90 of file Hist.h.
Referenced by Add(), Divide(), Fill(), GetBinError(), Hist(), Multiply(), operator=(), Reset(), ResetErrors(), Scale(), SetBinContent(), ToTH1(), Write(), Zero(), and ZeroSparse().
|
protected |
Accumulate errors, if enabled.
Definition at line 89 of file Hist.h.
Referenced by Add(), Divide(), Fill(), FromDirectory(), GetBinError(), Hist(), Multiply(), operator=(), Reset(), ResetErrors(), Scale(), SetBinContent(), and ToTH1().
|
protected |
Definition at line 84 of file Hist.h.
Referenced by Add(), Adopt(), AdoptSparse(), AdoptStan(), Divide(), Fill(), FromDirectory(), GetBinContent(), GetNbinsX(), Hist(), Integral(), Multiply(), operator=(), Reset(), Scale(), SetBinContent(), ToTH1(), Write(), Zero(), and ZeroSparse().