LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
lar::util::details::SimplePolyFitterDataBase< T, D > Class Template Reference

Base class providing data collection for the simple polynomial fitters. More...

#include "SimpleFits.h"

Inheritance diagram for lar::util::details::SimplePolyFitterDataBase< T, D >:
lar::util::details::SimplePolyFitterBase< T, D > lar::util::details::SimplePolyFitterBase< T, 1U > lar::util::details::SimplePolyFitterBase< T, 2U > lar::util::LinearFit< T > lar::util::QuadraticFit< T >

Public Types

using Data_t = typename Collector_t::Data_t
 type of the data More...
 
using Measurement_t = typename Collector_t::Measurement_t
 type of measurement without uncertainty More...
 
using MeasurementAndUncertainty_t = typename Collector_t::MeasurementAndUncertainty_t
 type of measurement with uncertainty More...
 

Public Member Functions

void clear ()
 Clears all the statistics. More...
 
template<typename Stream >
void PrintStats (Stream &out) const
 Prints the collected statistics into a stream. More...
 
Add elements
bool add (Data_t x, Data_t y, Data_t sy=Data_t(1.0))
 
bool add (Measurement_t value, Data_t sy=Data_t(1.0))
 
bool add (MeasurementAndUncertainty_t value)
 
template<typename Iter >
void add_without_uncertainty (Iter begin, Iter end)
 
template<typename Iter , typename Pred >
void add_without_uncertainty (Iter begin, Iter end, Pred extractor)
 
template<typename Cont , typename Pred >
void add_without_uncertainty (Cont cont, Pred extractor)
 
template<typename Cont >
void add_without_uncertainty (Cont cont)
 
template<typename VIter , typename UIter , typename VPred , typename UPred = identity>
unsigned int add_with_uncertainty (VIter begin_value, VIter end_value, UIter begin_uncertainty, VPred value_extractor, UPred uncertainty_extractor=UPred())
 
template<typename Iter >
unsigned int add_with_uncertainty (Iter begin, Iter end)
 
template<typename Cont >
unsigned int add_with_uncertainty (Cont cont)
 
Statistic retrieval
int N () const
 
Data_t AverageUncertainty () const
 

Static Public Member Functions

template<typename V >
static constexpr V sqr (V const &v)
 Returns the square of the specified value. More...
 

Static Public Attributes

static constexpr unsigned int Degree = Collector_t::Degree
 Degree of the fit. More...
 

Protected Member Functions

Data_t XN (unsigned int n) const
 Returns the weighted sum of x^n. More...
 
Data_t XNY (unsigned int n) const
 Returns the weighted sum of x^n y. More...
 

Protected Attributes

Collector_t stats
 statistics collected from fit data input More...
 

Private Types

using Collector_t = FitDataCollector< T, D >
 class storing input More...
 

Detailed Description

template<typename T, unsigned int D>
class lar::util::details::SimplePolyFitterDataBase< T, D >

Base class providing data collection for the simple polynomial fitters.

Definition at line 344 of file SimpleFits.h.

Member Typedef Documentation

template<typename T , unsigned int D>
using lar::util::details::SimplePolyFitterDataBase< T, D >::Collector_t = FitDataCollector<T, D>
private

class storing input

Definition at line 345 of file SimpleFits.h.

template<typename T , unsigned int D>
using lar::util::details::SimplePolyFitterDataBase< T, D >::Data_t = typename Collector_t::Data_t

type of the data

Definition at line 351 of file SimpleFits.h.

template<typename T , unsigned int D>
using lar::util::details::SimplePolyFitterDataBase< T, D >::Measurement_t = typename Collector_t::Measurement_t

type of measurement without uncertainty

Definition at line 354 of file SimpleFits.h.

type of measurement with uncertainty

Definition at line 358 of file SimpleFits.h.

Member Function Documentation

template<typename T , unsigned int D>
bool lar::util::details::SimplePolyFitterDataBase< T, D >::add ( Data_t  x,
Data_t  y,
Data_t  sy = Data_t(1.0) 
)
inline

Definition at line 366 of file SimpleFits.h.

Referenced by cluster::ClusterParamsAlg::IntegrateFitCharge().

367  { return stats.add(x, y, sy); }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
bool add(Data_t x, Data_t y, Data_t sy=Data_t(1.0))
Adds one entry with specified x, y and uncertainty.
Definition: SimpleFits.h:1446
template<typename T , unsigned int D>
bool lar::util::details::SimplePolyFitterDataBase< T, D >::add ( Measurement_t  value,
Data_t  sy = Data_t(1.0) 
)
inline

Definition at line 369 of file SimpleFits.h.

370  { return stats.add(value, sy); }
std::string value(boost::any const &)
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
bool add(Data_t x, Data_t y, Data_t sy=Data_t(1.0))
Adds one entry with specified x, y and uncertainty.
Definition: SimpleFits.h:1446
template<typename T , unsigned int D>
bool lar::util::details::SimplePolyFitterDataBase< T, D >::add ( MeasurementAndUncertainty_t  value)
inline

Definition at line 372 of file SimpleFits.h.

373  { return stats.add(value); }
std::string value(boost::any const &)
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
bool add(Data_t x, Data_t y, Data_t sy=Data_t(1.0))
Adds one entry with specified x, y and uncertainty.
Definition: SimpleFits.h:1446
template<typename T , unsigned int D>
template<typename VIter , typename UIter , typename VPred , typename UPred = identity>
unsigned int lar::util::details::SimplePolyFitterDataBase< T, D >::add_with_uncertainty ( VIter  begin_value,
VIter  end_value,
UIter  begin_uncertainty,
VPred  value_extractor,
UPred  uncertainty_extractor = UPred() 
)
inline

Definition at line 397 of file SimpleFits.h.

403  {
405  begin_value, end_value, begin_uncertainty,
406  value_extractor, uncertainty_extractor);
407  }
unsigned int add_with_uncertainty(VIter begin_value, VIter end_value, UIter begin_uncertainty, VPred value_extractor, UPred uncertainty_extractor=UPred())
Adds measurements with uncertainties from a sequence.
Definition: SimpleFits.h:1477
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
template<typename Iter >
unsigned int lar::util::details::SimplePolyFitterDataBase< T, D >::add_with_uncertainty ( Iter  begin,
Iter  end 
)
inline

Definition at line 411 of file SimpleFits.h.

412  { return stats.add_with_uncertainty(begin, end); }
unsigned int add_with_uncertainty(VIter begin_value, VIter end_value, UIter begin_uncertainty, VPred value_extractor, UPred uncertainty_extractor=UPred())
Adds measurements with uncertainties from a sequence.
Definition: SimpleFits.h:1477
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
template<typename Cont >
unsigned int lar::util::details::SimplePolyFitterDataBase< T, D >::add_with_uncertainty ( Cont  cont)
inline

Definition at line 415 of file SimpleFits.h.

416  { return stats.add_with_uncertainty(cont); }
unsigned int add_with_uncertainty(VIter begin_value, VIter end_value, UIter begin_uncertainty, VPred value_extractor, UPred uncertainty_extractor=UPred())
Adds measurements with uncertainties from a sequence.
Definition: SimpleFits.h:1477
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
template<typename Iter >
void lar::util::details::SimplePolyFitterDataBase< T, D >::add_without_uncertainty ( Iter  begin,
Iter  end 
)
inline

Definition at line 377 of file SimpleFits.h.

void add_without_uncertainty(Iter begin, Iter end)
Adds measurements from a sequence, with no uncertainty.
Definition: SimpleFits.h:135
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
template<typename Iter , typename Pred >
void lar::util::details::SimplePolyFitterDataBase< T, D >::add_without_uncertainty ( Iter  begin,
Iter  end,
Pred  extractor 
)
inline

Definition at line 381 of file SimpleFits.h.

382  { stats.add_without_uncertainty(begin, end, extractor); }
void add_without_uncertainty(Iter begin, Iter end)
Adds measurements from a sequence, with no uncertainty.
Definition: SimpleFits.h:135
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
template<typename Cont , typename Pred >
void lar::util::details::SimplePolyFitterDataBase< T, D >::add_without_uncertainty ( Cont  cont,
Pred  extractor 
)
inline

Definition at line 385 of file SimpleFits.h.

386  { stats.add_without_uncertainty(cont, extractor); }
void add_without_uncertainty(Iter begin, Iter end)
Adds measurements from a sequence, with no uncertainty.
Definition: SimpleFits.h:135
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
template<typename Cont >
void lar::util::details::SimplePolyFitterDataBase< T, D >::add_without_uncertainty ( Cont  cont)
inline

Definition at line 389 of file SimpleFits.h.

390  { stats.add_without_uncertainty(cont); }
void add_without_uncertainty(Iter begin, Iter end)
Adds measurements from a sequence, with no uncertainty.
Definition: SimpleFits.h:135
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
Data_t lar::util::details::SimplePolyFitterDataBase< T, D >::AverageUncertainty ( ) const
inline

Definition at line 429 of file SimpleFits.h.

429 { return stats.AverageUncertainty(); }
Data_t AverageUncertainty() const
Returns an average of the uncertainties.
Definition: SimpleFits.h:277
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
void lar::util::details::SimplePolyFitterDataBase< T, D >::clear ( )
inline

Clears all the statistics.

Definition at line 421 of file SimpleFits.h.

421 { stats.clear(); }
void clear()
Clears all the statistics.
Definition: SimpleFits.h:1509
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
int lar::util::details::SimplePolyFitterDataBase< T, D >::N ( ) const
inline

Definition at line 427 of file SimpleFits.h.

427 { return stats.N(); }
int N() const
Returns the number of entries added.
Definition: SimpleFits.h:266
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
template<typename Stream >
void lar::util::details::SimplePolyFitterDataBase< T, D >::PrintStats ( Stream &  out) const
inline

Prints the collected statistics into a stream.

Definition at line 436 of file SimpleFits.h.

436 { stats.Print(out); }
void Print(Stream &out) const
Prints the statistics into a stream.
Definition: SimpleFits.h:1519
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
template<typename V >
static constexpr V lar::util::details::SimplePolyFitterDataBase< T, D >::sqr ( V const &  v)
inlinestatic

Returns the square of the specified value.

Definition at line 441 of file SimpleFits.h.

References geo::sqr().

441 { return Collector_t::sqr(v); }
static constexpr V sqr(V const &v)
Returns the square of the specified value.
Definition: SimpleFits.h:283
template<typename T , unsigned int D>
Data_t lar::util::details::SimplePolyFitterDataBase< T, D >::XN ( unsigned int  n) const
inlineprotected

Returns the weighted sum of x^n.

Definition at line 447 of file SimpleFits.h.

References lar::util::details::FitDataCollector< T, D >::XN().

447 { return stats.XN(n); }
Data_t XN(unsigned int n) const
Returns the weighted sum of x^n.
Definition: SimpleFits.h:287
Char_t n[5]
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444
template<typename T , unsigned int D>
Data_t lar::util::details::SimplePolyFitterDataBase< T, D >::XNY ( unsigned int  n) const
inlineprotected

Returns the weighted sum of x^n y.

Definition at line 450 of file SimpleFits.h.

References lar::util::details::FitDataCollector< T, D >::XNY().

450 { return stats.XNY(n); }
Data_t XNY(unsigned int n) const
Returns the weighted sum of x^n y.
Definition: SimpleFits.h:291
Char_t n[5]
Collector_t stats
statistics collected from fit data input
Definition: SimpleFits.h:444

Member Data Documentation

template<typename T , unsigned int D>
constexpr unsigned int lar::util::details::SimplePolyFitterDataBase< T, D >::Degree = Collector_t::Degree
static

Degree of the fit.

Definition at line 349 of file SimpleFits.h.

template<typename T , unsigned int D>
Collector_t lar::util::details::SimplePolyFitterDataBase< T, D >::stats
protected

statistics collected from fit data input

Definition at line 444 of file SimpleFits.h.


The documentation for this class was generated from the following file: