#include <FastTemplate.h>
Public Types | |
typedef double | T |
Public Member Functions | |
void | Clear () |
void | CopyValues (const FastTemplate &other) |
void | CopyValues (const TH1 &other) |
void | CopyValues (const TH2 &other) |
void | CropUnderflows (T minimum=1e-9) |
protect from underflows (*this = max(*this, minimum)); | |
void | Dump () const |
void | Exp () |
*this = exp(*this) | |
FastTemplate (const TH1 &other) | |
FastTemplate (unsigned int size) | |
FastTemplate (const TH2 &other) | |
FastTemplate (const FastTemplate &other) | |
FastTemplate () | |
T | Integral () const |
void | Log () |
*this = log(*this) | |
void | LogRatio (const FastTemplate &reference) |
*this = log(*this)/(reference) | |
void | Meld (const FastTemplate &diff, const FastTemplate &sum, T x, T y) |
Does this += x * (diff + (sum)*y) | |
FastTemplate & | operator= (const FastTemplate &other) |
FastTemplate & | operator= (const TH1 &other) |
T & | operator[] (unsigned int i) |
const T & | operator[] (unsigned int i) const |
void | Resize (unsigned int newsize) |
void | Scale (T factor) |
const unsigned int | size () const |
void | Subtract (const FastTemplate &reference) |
*this = *this - reference | |
~FastTemplate () | |
Static Public Member Functions | |
static void | SumDiff (const FastTemplate &h1, const FastTemplate &h2, FastTemplate &sum, FastTemplate &diff) |
assigns sum and diff | |
Protected Attributes | |
unsigned int | size_ |
T * | values_ |
Definition at line 8 of file FastTemplate.h.
typedef double FastTemplate::T |
Definition at line 10 of file FastTemplate.h.
FastTemplate::FastTemplate | ( | ) | [inline] |
Definition at line 11 of file FastTemplate.h.
FastTemplate::FastTemplate | ( | unsigned int | size | ) | [inline] |
FastTemplate::FastTemplate | ( | const FastTemplate & | other | ) | [inline] |
Definition at line 13 of file FastTemplate.h.
References CopyValues(), and size_.
FastTemplate::FastTemplate | ( | const TH1 & | other | ) | [inline] |
Definition at line 14 of file FastTemplate.h.
References CopyValues().
: size_(other.GetNbinsX()), values_(new T[size_]) { CopyValues(other); }
FastTemplate::FastTemplate | ( | const TH2 & | other | ) | [inline] |
Definition at line 15 of file FastTemplate.h.
References CopyValues().
: size_(other.GetNbinsX()*other.GetNbinsY()), values_(new T[size_]) { CopyValues(other); }
FastTemplate::~FastTemplate | ( | ) | [inline] |
void FastTemplate::Clear | ( | ) |
void FastTemplate::CopyValues | ( | const TH1 & | other | ) |
void FastTemplate::CopyValues | ( | const TH2 & | other | ) |
Definition at line 30 of file FastTemplate.cc.
{ for (unsigned int i = 0, ix = 1, nx = other.GetNbinsX(), ny = other.GetNbinsY(); ix <= nx; ++ix) { for (unsigned int iy = 1; iy <= ny; ++iy, ++i) { values_[i] = other.GetBinContent(ix,iy); //printf("FastTemplate::CopyValues from %s: (ix,iy) = (%d/%d,%d/%d), i = %d/%d, val = %.5f\n", other.GetName(), ix, nx, iy, ny, i, size_, values_[i]); } } }
void FastTemplate::CopyValues | ( | const FastTemplate & | other | ) |
Definition at line 22 of file FastTemplate.cc.
References size_, and values_.
Referenced by FastTemplate(), FastHisto::operator=(), FastHisto2D::operator=(), operator=(), and FastVerticalInterpHistPdfBase::syncTotal().
void FastTemplate::CropUnderflows | ( | T | minimum = 1e-9 | ) |
protect from underflows (*this = max(*this, minimum));
Definition at line 220 of file FastTemplate.cc.
References i, size_, and values_.
Referenced by FastVerticalInterpHistPdfBase::syncTotal().
void FastTemplate::Dump | ( | void | ) | const |
Reimplemented in FastHisto, and FastHisto2D.
Definition at line 39 of file FastTemplate.cc.
void FastTemplate::Exp | ( | ) |
FastTemplate::T FastTemplate::Integral | ( | ) | const |
void FastTemplate::Log | ( | ) |
*this = log(*this)
Definition at line 208 of file FastTemplate.cc.
References i, create_public_lumi_plots::log, size_, and values_.
Referenced by FastVerticalInterpHistPdf::syncNominal(), and FastVerticalInterpHistPdf2D::syncNominal().
void FastTemplate::LogRatio | ( | const FastTemplate & | reference | ) |
*this = log(*this)/(reference)
Definition at line 196 of file FastTemplate.cc.
References size_, and values_.
Referenced by FastVerticalInterpHistPdfBase::syncMorph().
void FastTemplate::Meld | ( | const FastTemplate & | diff, |
const FastTemplate & | sum, | ||
T | x, | ||
T | y | ||
) |
Does this += x * (diff + (sum)*y)
Definition at line 204 of file FastTemplate.cc.
References size_, and values_.
Referenced by FastVerticalInterpHistPdfBase::syncTotal().
FastTemplate& FastTemplate::operator= | ( | const TH1 & | other | ) | [inline] |
Reimplemented in FastHisto.
Definition at line 22 of file FastTemplate.h.
References CopyValues(), size_, and values_.
FastTemplate& FastTemplate::operator= | ( | const FastTemplate & | other | ) | [inline] |
Definition at line 16 of file FastTemplate.h.
References CopyValues(), size_, and values_.
const T& FastTemplate::operator[] | ( | unsigned int | i | ) | const [inline] |
T& FastTemplate::operator[] | ( | unsigned int | i | ) | [inline] |
void FastTemplate::Resize | ( | unsigned int | newsize | ) | [inline] |
void FastTemplate::Scale | ( | T | factor | ) |
Definition at line 14 of file FastTemplate.cc.
References i, size_, and values_.
Referenced by FastHisto2D::Normalize(), and FastHisto::Normalize().
const unsigned int FastTemplate::size | ( | void | ) | const [inline] |
Definition at line 42 of file FastTemplate.h.
References size_.
Referenced by FastVerticalInterpHistPdf2D::evaluate(), FastVerticalInterpHistPdf::evaluate(), FastVerticalInterpHistPdf::hasCache(), FastVerticalInterpHistPdf2D::hasCache(), FastVerticalInterpHistPdf::isCacheReady(), FastVerticalInterpHistPdf2D::isCacheReady(), FastVerticalInterpHistPdf::setupCaches(), and FastVerticalInterpHistPdf2D::setupCaches().
{ return size_; }
void FastTemplate::Subtract | ( | const FastTemplate & | reference | ) |
*this = *this - reference
Definition at line 193 of file FastTemplate.cc.
References size_, python::rootplot::rootmath::subtract(), and values_.
Referenced by FastVerticalInterpHistPdfBase::syncMorph().
void FastTemplate::SumDiff | ( | const FastTemplate & | h1, |
const FastTemplate & | h2, | ||
FastTemplate & | sum, | ||
FastTemplate & | diff | ||
) | [static] |
assigns sum and diff
Definition at line 199 of file FastTemplate.cc.
References size_.
Referenced by FastVerticalInterpHistPdfBase::syncMorph().
{ sumdiff(&sum[0], &diff[0], h1.size_, &h1[0], &h2[0]); }
unsigned int FastTemplate::size_ [protected] |
Definition at line 61 of file FastTemplate.h.
Referenced by Clear(), CopyValues(), CropUnderflows(), FastHisto::Dump(), FastHisto2D::Dump(), Dump(), Exp(), FastHisto::FastHisto(), FastHisto2D::FastHisto2D(), FastTemplate(), FastHisto::GetAt(), Integral(), FastHisto::IntegralWidth(), FastHisto2D::IntegralWidth(), Log(), LogRatio(), Meld(), FastHisto::operator=(), operator=(), Resize(), Scale(), size(), Subtract(), SumDiff(), FastHisto2D::swap(), and FastHisto::swap().
T* FastTemplate::values_ [protected] |
Definition at line 62 of file FastTemplate.h.
Referenced by Clear(), CopyValues(), CropUnderflows(), FastHisto::Dump(), FastHisto2D::Dump(), Dump(), Exp(), FastHisto2D::GetAt(), FastHisto::GetAt(), Integral(), FastHisto::IntegralWidth(), FastHisto2D::IntegralWidth(), Log(), LogRatio(), Meld(), FastHisto2D::NormalizeXSlices(), operator=(), operator[](), Resize(), Scale(), Subtract(), FastHisto2D::swap(), FastHisto::swap(), and ~FastTemplate().