LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Keeps track of the minimum and maximum value we observed. More...
#include "StatCollector.h"
Public Types | |
using | Data_t = T |
type of data we collect More... | |
using | This_t = MinMaxCollector< T > |
this type More... | |
Public Member Functions | |
bool | has_data () const |
Returns whether at least one datum has been added. More... | |
Data_t | min () const |
Returns the accumulated minimum, or a very large number if no values. More... | |
Data_t | max () const |
Returns the accumulated maximum, or a very small number if no values. More... | |
void | clear () |
Removes all statistics and reinitializes the object. More... | |
template<typename Iter > | |
lar::util::MinMaxCollector< T > & | add (Iter begin, Iter end) |
MinMaxCollector ()=default | |
Default constructor: no data collected so far. More... | |
MinMaxCollector (std::initializer_list< Data_t > init) | |
Constructor: starts with parsing the specified data. More... | |
template<typename Iter > | |
MinMaxCollector (Iter begin, Iter end) | |
Include a sequence of values in the statistics. More... | |
Inserters | |
This_t & | add (Data_t value) |
Include a single value in the statistics. More... | |
This_t & | add (std::initializer_list< Data_t > values) |
Include a sequence of values in the statistics. More... | |
template<typename Iter > | |
This_t & | add (Iter begin, Iter end) |
Include a sequence of values in the statistics. More... | |
Protected Attributes | |
Data_t | minimum = std::numeric_limits<Data_t>::max() |
the accumulated minimum More... | |
Data_t | maximum = std::numeric_limits<Data_t>::min() |
the accumulated maximum More... | |
Keeps track of the minimum and maximum value we observed.
T | type of datum |
Implementation note: a similar class with an arbitrary comparison rule would require a careful choice of initial values for minimum and maximum, or a entry count that should be checked at each insertion. We save that slight overhead here.
Definition at line 751 of file StatCollector.h.
using lar::util::MinMaxCollector< T >::Data_t = T |
type of data we collect
Definition at line 753 of file StatCollector.h.
using lar::util::MinMaxCollector< T >::This_t = MinMaxCollector<T> |
this type
Definition at line 754 of file StatCollector.h.
|
default |
Default constructor: no data collected so far.
|
inline |
Constructor: starts with parsing the specified data.
Definition at line 761 of file StatCollector.h.
|
inline |
Include a sequence of values in the statistics.
Iter | type of an iterator on values |
begin | iterator pointing to the first value to be included |
end | iterator pointing to the last value to be included |
Definition at line 770 of file StatCollector.h.
lar::util::MinMaxCollector< T > & lar::util::MinMaxCollector< T >::add | ( | Data_t | value | ) |
Include a single value in the statistics.
value | the value to be added |
Definition at line 1056 of file StatCollector.h.
References value.
Referenced by dump::raw::OpDetWaveformDumper::dump(), detsim::DumpRawDigits::PrintRawDigit(), and caldata::DumpWires::PrintWire().
|
inline |
Include a sequence of values in the statistics.
values | the values to be added |
Definition at line 1064 of file StatCollector.h.
This_t& lar::util::MinMaxCollector< T >::add | ( | Iter | begin, |
Iter | end | ||
) |
Include a sequence of values in the statistics.
Iter | type of an iterator on values |
begin | iterator pointing to the first value to be included |
end | iterator pointing to the last value to be included |
|
inline |
Definition at line 1072 of file StatCollector.h.
References value.
|
inline |
Removes all statistics and reinitializes the object.
Definition at line 1079 of file StatCollector.h.
|
inline |
Returns whether at least one datum has been added.
Definition at line 806 of file StatCollector.h.
|
inline |
Returns the accumulated maximum, or a very small number if no values.
Definition at line 812 of file StatCollector.h.
Referenced by dump::raw::OpDetWaveformDumper::dump(), detsim::DumpRawDigits::PrintRawDigit(), and caldata::DumpWires::PrintWire().
|
inline |
Returns the accumulated minimum, or a very large number if no values.
Definition at line 809 of file StatCollector.h.
Referenced by evd::details::RawDigitInfo_t::CollectSampleInfo(), dump::raw::OpDetWaveformDumper::dump(), detsim::DumpRawDigits::PrintRawDigit(), and caldata::DumpWires::PrintWire().
|
protected |
the accumulated maximum
Definition at line 822 of file StatCollector.h.
|
protected |
the accumulated minimum
Definition at line 819 of file StatCollector.h.