THistogram< Feeder > Class Template Reference

a simple histogram that uses an instance of THistogramFeeder as input converter More...

#include <mia/core/histogram.hh>

Public Types

typedef std::vector< size_t >::const_iterator const_iterator
 STL iterator. More...
 
typedef std::pair< typename Feeder::value_type, typename Feeder::value_type > range_type
 
typedef std::pair< typename Feeder::value_type, size_t > value_type
 A type for the value-index pair. More...
 

Public Member Functions

const value_type at (size_t idx) const
 
double average () const
 
const_iterator begin () const
 
double deviation () const
 
const_iterator end () const
 
double excess_kurtosis () const
 
range_type get_reduced_range (double remove) const
 
Feeder::value_type MAD () const
 
Feeder::value_type median () const
 
size_t operator[] (size_t idx) const
 
void push (typename Feeder::value_type x)
 
void push (typename Feeder::value_type x, size_t count)
 
template<typename Iterator >
void push_range (Iterator begin, Iterator end)
 
size_t size () const
 
double skewness () const
 
 THistogram (const Feeder &f)
 
 THistogram (const THistogram< Feeder > &org, double perc)
 

Detailed Description

template<typename Feeder>
class THistogram< Feeder >

a simple histogram that uses an instance of THistogramFeeder as input converter

This class implements a simple histogram that uses the nearest neighbor approach implemeneted in THistogramFeeder to fill the histogram and provides some funcionallity to work with the histogram.

Template Parameters
theinput feeder

Definition at line 132 of file histogram.hh.

Member Typedef Documentation

◆ const_iterator

template<typename Feeder>
typedef std::vector<size_t>::const_iterator THistogram< Feeder >::const_iterator

STL iterator.

Definition at line 136 of file histogram.hh.

◆ range_type

template<typename Feeder>
typedef std::pair<typename Feeder::value_type, typename Feeder::value_type> THistogram< Feeder >::range_type

Definition at line 141 of file histogram.hh.

◆ value_type

template<typename Feeder>
typedef std::pair<typename Feeder::value_type, size_t> THistogram< Feeder >::value_type

A type for the value-index pair.

Todo:
change to meaningful name

Definition at line 139 of file histogram.hh.

Constructor & Destructor Documentation

◆ THistogram() [1/2]

template<typename Feeder>
THistogram< Feeder >::THistogram ( const Feeder &  f)

Constructor to create the histogram with the given input feeder.

Definition at line 288 of file histogram.hh.

◆ THistogram() [2/2]

template<typename Feeder>
THistogram< Feeder >::THistogram ( const THistogram< Feeder > &  org,
double  perc 
)

Constructor to create a histogram by copying another histogram and cutting of part ot the upper tail.

Parameters
orgoriginal histogram to copy from
percpercentage of the bins to cut off
Todo:
this should actually cut of a percentage of the data and not of the bins

Definition at line 296 of file histogram.hh.

Member Function Documentation

◆ at()

template<typename Feeder >
const THistogram< Feeder >::value_type THistogram< Feeder >::at ( size_t  idx) const

Return the count and input range value corresponding to the bin at idx

Parameters
idx
Returns
<value,count> pair

Definition at line 391 of file histogram.hh.

Referenced by THistogram< Feeder >::average(), THistogram< Feeder >::deviation(), THistogram< Feeder >::excess_kurtosis(), and THistogram< Feeder >::skewness().

◆ average()

template<typename Feeder >
double THistogram< Feeder >::average ( ) const
Returns
mean of the histogram

Definition at line 400 of file histogram.hh.

References THistogram< Feeder >::at(), and THistogram< Feeder >::size().

Referenced by THistogram< Feeder >::excess_kurtosis(), and THistogram< Feeder >::skewness().

◆ begin()

template<typename Feeder >
THistogram< Feeder >::const_iterator THistogram< Feeder >::begin ( ) const
Returns
start of histogram

Definition at line 343 of file histogram.hh.

◆ deviation()

template<typename Feeder >
double THistogram< Feeder >::deviation ( ) const
Returns
deviation of the histogram

Definition at line 457 of file histogram.hh.

References THistogram< Feeder >::at(), and THistogram< Feeder >::size().

◆ end()

template<typename Feeder >
THistogram< Feeder >::const_iterator THistogram< Feeder >::end ( ) const
Returns
end of histogram

Definition at line 349 of file histogram.hh.

◆ excess_kurtosis()

template<typename Feeder >
double THistogram< Feeder >::excess_kurtosis ( ) const
Returns
the excess kurtosis value of the histogram

Definition at line 413 of file histogram.hh.

References THistogram< Feeder >::at(), THistogram< Feeder >::average(), and THistogram< Feeder >::size().

◆ get_reduced_range()

template<typename Feeder >
THistogram< Feeder >::range_type THistogram< Feeder >::get_reduced_range ( double  remove) const

return the histogram range that cuts off the remove percent of pixels from the lower ane upper end of the histogram

Parameters
removethe amout of pixels to remove from the upper and lower end of the historam [0,40]
Returns
the pair <low,high> of the resulting histogram range

Definition at line 473 of file histogram.hh.

References cvdebug(), and NS_MIA_END.

Referenced by CSplineParzenMI::fill().

◆ MAD()

template<typename Feeder >
Feeder::value_type THistogram< Feeder >::MAD ( ) const
Returns
Median Average Distance of the histogram

Definition at line 374 of file histogram.hh.

References THistogram< Feeder >::median(), THistogram< Feeder >::push(), and THistogram< Feeder >::size().

◆ median()

template<typename Feeder >
Feeder::value_type THistogram< Feeder >::median ( ) const
Returns
median of the histogram

Definition at line 362 of file histogram.hh.

Referenced by THistogram< Feeder >::MAD().

◆ operator[]()

template<typename Feeder >
size_t THistogram< Feeder >::operator[] ( size_t  idx) const
Returns
value of histogram bin at idx

Definition at line 355 of file histogram.hh.

◆ push() [1/2]

template<typename Feeder>
void THistogram< Feeder >::push ( typename Feeder::value_type  x)

Add a value x to the histogram

Parameters
x

Definition at line 319 of file histogram.hh.

Referenced by CSplineParzenMI::fill(), THistogram< Feeder >::MAD(), and THistogram< Feeder >::push_range().

◆ push() [2/2]

template<typename Feeder>
void THistogram< Feeder >::push ( typename Feeder::value_type  x,
size_t  count 
)

Add a value x to the histogram count times

Parameters
x
count

Definition at line 336 of file histogram.hh.

◆ push_range()

template<typename Feeder >
template<typename Iterator >
void THistogram< Feeder >::push_range ( Iterator  begin,
Iterator  end 
)

Add a range of data to the histogram

Template Parameters
Iteratorforward iterator
Parameters
beginstart of input range
endend of input range (STL convention)

Definition at line 327 of file histogram.hh.

References THistogram< Feeder >::push().

Referenced by CSplineParzenMI::fill().

◆ size()

template<typename Feeder >
size_t THistogram< Feeder >::size ( ) const

◆ skewness()

template<typename Feeder >
double THistogram< Feeder >::skewness ( ) const
Returns
the skewness value of the histogram

Definition at line 436 of file histogram.hh.

References THistogram< Feeder >::at(), THistogram< Feeder >::average(), and THistogram< Feeder >::size().


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