11#include <tracking/trackFindingVXD/sectorMapTools/MinMaxCollector.h>
12#include <framework/logging/Logger.h>
38 std::pair<double, double> quantiles,
39 unsigned maxSizeThreshold = 100000) :
40 m_collector((quantiles.first > (1. - quantiles.second) ? quantiles.first * 2. : (1. - quantiles.second) * 2.)),
45 if (
double(expectedSize) / (
double(maxSizeThreshold) * 0.05) >
double(maxSizeThreshold))
46 { B2FATAL(
"RawDataCollectedMinMax: expected data to big, can not execute!"); }
48 if (maxSizeThreshold < expectedSize) {
54 void add(
double newVal)
96 [](
const std::pair<double, double>& a,
const std::pair<double, double>& b) ->
bool { return a.first < b.first; });
100 [](
const std::pair<double, double>& a,
const std::pair<double, double>& b) ->
bool { return a.second < b.second; });
A container for collecting data, where min- and max-quantiles near q(0) and q(1) are to be found.
unsigned m_fillIntermediateThreshold
an internal threshold taking care of collecting intermediate results during sample collection
MinMaxCollector< double > m_collector
collects raw data in an RAM-saving way.
unsigned getSampleSize() const
returns current sample size (which is not the actual size of the container).
std::pair< double, double > getMinMax()
returns current best estimates for min and max cuts.
unsigned m_currentSize
the current size of the data sample.
std::vector< std::pair< double, double > > m_intermediateValues
collects intermediate threshold if expected size is too big.
std::pair< double, double > m_minMaxQuantiles
the quantiles to be collected in the end (defined in [0;1])
RawDataCollectedMinMax(unsigned expectedSize, std::pair< double, double > quantiles, unsigned maxSizeThreshold=100000)
constructor. please use for quantiles [min, max] min ~0 & max ~1 (range 0-1)
void add(double newVal)
adds value to collector.
Abstract base class for different kinds of events.