#include <FastTemplate.h>
Public Member Functions | |
void | Dump () const |
FastHisto () | |
FastHisto (const TH1 &hist) | |
FastHisto (const FastHisto &other) | |
T | GetAt (const T &x) const |
T | IntegralWidth () const |
void | Normalize () |
FastHisto & | operator= (const FastHisto &other) |
FastHisto & | operator= (const TH1 &other) |
void | swap (FastHisto &other) |
~FastHisto () | |
Private Attributes | |
T * | binEdges_ |
T * | binWidths_ |
Definition at line 64 of file FastTemplate.h.
FastHisto::FastHisto | ( | ) | [inline] |
Definition at line 66 of file FastTemplate.h.
: FastTemplate(), binEdges_(0), binWidths_(0) {}
FastHisto::FastHisto | ( | const TH1 & | hist | ) |
Definition at line 45 of file FastTemplate.cc.
References binEdges_, binWidths_, i, and FastTemplate::size_.
FastHisto::FastHisto | ( | const FastHisto & | other | ) |
Definition at line 57 of file FastTemplate.cc.
References binEdges_, binWidths_, and FastTemplate::size_.
: FastTemplate(other), binEdges_(size_ ? new T[size_+1] : 0), binWidths_(size_ ? new T[size_] : 0) { if (size_) { memcpy(binEdges_, other.binEdges_, (size_+1)*sizeof(T)); memcpy(binWidths_, other.binWidths_, size_*sizeof(T)); } }
FastHisto::~FastHisto | ( | ) | [inline] |
Definition at line 83 of file FastTemplate.h.
References binEdges_, and binWidths_.
{ delete [] binEdges_; delete [] binWidths_; }
void FastHisto::Dump | ( | void | ) | const |
Reimplemented from FastTemplate.
Definition at line 80 of file FastTemplate.cc.
References binEdges_, binWidths_, i, FastTemplate::size_, and FastTemplate::values_.
{ printf("--- dumping histo template with %d bins in range %.2f - %.2f (@%p)---\n", size_+1, binEdges_[0], binEdges_[size_], (void*)values_); for (unsigned int i = 0; i < size_; ++i) { printf(" bin %3d, x = %6.2f: yval = %9.5f, width = %6.3f\n", i, 0.5*(binEdges_[i]+binEdges_[i+1]), values_[i], binWidths_[i]); } printf("\n"); }
FastHisto::T FastHisto::GetAt | ( | const T & | x | ) | const |
Definition at line 68 of file FastTemplate.cc.
References binEdges_, match(), FastTemplate::size_, and FastTemplate::values_.
Referenced by FastVerticalInterpHistPdf::evaluate().
FastHisto::T FastHisto::IntegralWidth | ( | ) | const |
Definition at line 74 of file FastTemplate.cc.
References binWidths_, i, FastTemplate::size_, pileupDistInMC::total, and FastTemplate::values_.
Referenced by Normalize().
void FastHisto::Normalize | ( | ) | [inline] |
Definition at line 92 of file FastTemplate.h.
References f, IntegralWidth(), and FastTemplate::Scale().
Referenced by FastVerticalInterpHistPdf::syncComponents(), FastVerticalInterpHistPdf::syncNominal(), and FastVerticalInterpHistPdf::syncTotal().
{ T sum = IntegralWidth(); if (sum > 0) Scale(1.0f/sum); }
FastHisto& FastHisto::operator= | ( | const TH1 & | other | ) | [inline] |
Reimplemented from FastTemplate.
Definition at line 76 of file FastTemplate.h.
References FastTemplate::CopyValues(), FastTemplate::size_, and swap().
{ if (size_ != unsigned(other.GetNbinsX())) { FastHisto fh(other); swap(fh); } else CopyValues(other); CopyValues(other); return *this; }
Definition at line 69 of file FastTemplate.h.
References FastTemplate::CopyValues(), FastTemplate::size_, and swap().
{ if (size_ != other.size_) { FastHisto fh(other); swap(fh); } else CopyValues(other); return *this; }
void FastHisto::swap | ( | FastHisto & | other | ) | [inline] |
Definition at line 84 of file FastTemplate.h.
References binEdges_, binWidths_, FastTemplate::size_, and FastTemplate::values_.
Referenced by operator=().
T* FastHisto::binEdges_ [private] |
Definition at line 99 of file FastTemplate.h.
Referenced by Dump(), FastHisto(), GetAt(), swap(), and ~FastHisto().
T* FastHisto::binWidths_ [private] |
Definition at line 100 of file FastTemplate.h.
Referenced by Dump(), FastHisto(), IntegralWidth(), swap(), and ~FastHisto().