29 throw std::runtime_error(
30 "A systematic variation was requested for a custom Fill action, but the type of the object to be filled does "
31 "not implement a Reset method, so we cannot safely re-initialize variations of the result. Aborting.");
36 h->SetDirectory(
nullptr);
40CountHelper::CountHelper(
const std::shared_ptr<ULong64_t> &
resultCount,
const unsigned int nSlots)
45void CountHelper::Exec(
unsigned int slot)
50void CountHelper::Finalize()
53 for (
auto &
c : fCounts) {
63void BufferedFillHelper::UpdateMinMax(
unsigned int slot,
double v)
71BufferedFillHelper::BufferedFillHelper(
const std::shared_ptr<Hist_t> &
h,
const unsigned int nSlots)
76 fBuffers.reserve(fNSlots);
78 for (
unsigned int i = 0; i < fNSlots; ++i) {
81 fBuffers.emplace_back(
v);
86void BufferedFillHelper::Exec(
unsigned int slot,
double v)
89 fBuffers[
slot].emplace_back(
v);
92void BufferedFillHelper::Exec(
unsigned int slot,
double v,
double w)
95 fBuffers[
slot].emplace_back(
v);
99Hist_t &BufferedFillHelper::PartialUpdate(
unsigned int slot)
110void BufferedFillHelper::Finalize()
112 for (
unsigned int i = 0; i < fNSlots; ++i) {
114 throw std::runtime_error(
"Cannot fill weighted histogram with values in containers of different sizes.");
122 globalMax != std::numeric_limits<BufEl_t>::lowest()) {
126 for (
unsigned int i = 0; i < fNSlots; ++i) {
132MeanHelper::MeanHelper(
const std::shared_ptr<double> &
meanVPtr,
const unsigned int nSlots)
137void MeanHelper::Exec(
unsigned int slot,
double v)
147void MeanHelper::Finalize()
161 for (
auto &
c : fCounts)
166double &MeanHelper::PartialUpdate(
unsigned int slot)
172StdDevHelper::StdDevHelper(
const std::shared_ptr<double> &
meanVPtr,
const unsigned int nSlots)
177void StdDevHelper::Exec(
unsigned int slot,
double v)
180 auto count = ++fCounts[
slot];
181 auto delta =
v - fMeans[
slot];
182 auto mean = fMeans[
slot] + delta / count;
186 fCounts[
slot] = count;
191void StdDevHelper::Finalize()
195 for (
auto c : fCounts) {
205 for (
unsigned int i = 0; i < fNSlots; ++i) {
211 for (
unsigned int i = 0; i < fNSlots; ++i) {
212 if (fCounts[i] == 0) {
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Basic types used by ROOT and required by TInterpreter.
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
TH1 is the base class of all histogram classes in ROOT.
Statistical variable, defined by its mean and variance (RMS).
void ResetIfPossible(TStatistic *h)
constexpr std::size_t CacheLineStep()
Stepping through CacheLineStep<T> values in a vector<T> brings you to a new cache line.
void UnsetDirectoryIfPossible(TH1 *h)
Namespace for new ROOT classes and functions.