31 throw std::runtime_error(
32 "A systematic variation was requested for a custom Fill action, but the type of the object to be filled does "
33 "not implement a Reset method, so we cannot safely re-initialize variations of the result. Aborting.");
38 h->SetDirectory(
nullptr);
42CountHelper::CountHelper(
const std::shared_ptr<ULong64_t> &
resultCount,
const unsigned int nSlots)
47void CountHelper::Exec(
unsigned int slot)
52void CountHelper::Finalize()
55 for (
auto &
c : fCounts) {
65void BufferedFillHelper::UpdateMinMax(
unsigned int slot,
double v)
73BufferedFillHelper::BufferedFillHelper(
const std::shared_ptr<Hist_t> &
h,
const unsigned int nSlots)
78 fBuffers.reserve(fNSlots);
80 for (
unsigned int i = 0; i < fNSlots; ++i) {
83 fBuffers.emplace_back(
v);
88void BufferedFillHelper::Exec(
unsigned int slot,
double v)
91 fBuffers[
slot].emplace_back(
v);
94void BufferedFillHelper::Exec(
unsigned int slot,
double v,
double w)
97 fBuffers[
slot].emplace_back(
v);
101Hist_t &BufferedFillHelper::PartialUpdate(
unsigned int slot)
112void BufferedFillHelper::Finalize()
114 for (
unsigned int i = 0; i < fNSlots; ++i) {
116 throw std::runtime_error(
"Cannot fill weighted histogram with values in containers of different sizes.");
124 globalMax != std::numeric_limits<BufEl_t>::lowest()) {
128 for (
unsigned int i = 0; i < fNSlots; ++i) {
134MeanHelper::MeanHelper(
const std::shared_ptr<double> &
meanVPtr,
const unsigned int nSlots)
139void MeanHelper::Exec(
unsigned int slot,
double v)
149void MeanHelper::Finalize()
163 for (
auto &
c : fCounts)
168double &MeanHelper::PartialUpdate(
unsigned int slot)
174StdDevHelper::StdDevHelper(
const std::shared_ptr<double> &
meanVPtr,
const unsigned int nSlots)
179void StdDevHelper::Exec(
unsigned int slot,
double v)
182 auto count = ++fCounts[
slot];
183 auto delta =
v - fMeans[
slot];
184 auto mean = fMeans[
slot] + delta / count;
188 fCounts[
slot] = count;
193void StdDevHelper::Finalize()
197 for (
auto c : fCounts) {
207 for (
unsigned int i = 0; i < fNSlots; ++i) {
213 for (
unsigned int i = 0; i < fNSlots; ++i) {
214 if (fCounts[i] == 0) {
225MedianHelper::MedianHelper(
const std::shared_ptr<double> &
meanVPtr,
const unsigned int nSlots)
230void MedianHelper::Exec(
unsigned int slot,
double v)
232 fBuffers[
slot].push_back(
v);
235void MedianHelper::Finalize()
239 for (
const auto &buffer : fBuffers) {
244 *fResult = std::numeric_limits<double>::signaling_NaN();
250 for (
const auto &buffer : fBuffers)
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
const_iterator begin() const
const_iterator end() const
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)