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.
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.

## 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

  the | input feeder

Definition at line 134 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 139 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 144 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 142 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 294 of file histogram.hh.

References size().

Referenced by MAD(), and THistogram().

## 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

  org | original histogram to copy from
  perc | percentage 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 302 of file histogram.hh.

References size(), and THistogram().

## 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 398 of file histogram.hh.

Referenced by average(), deviation(), excess_kurtosis(), and skewness().

## average()

template<typename Feeder>

double THistogram< Feeder >::average | ( |  | ) | const

Returns
  mean of the histogram

Definition at line 407 of file histogram.hh.

References at(), and size().

Referenced by excess_kurtosis(), and skewness().

## begin()

template<typename Feeder>

THistogram< Feeder >::const_iterator THistogram< Feeder >::begin | ( |  | ) | const

Returns
  start of histogram

Definition at line 349 of file histogram.hh.

Referenced by push_range().

## deviation()

template<typename Feeder>

double THistogram< Feeder >::deviation | ( |  | ) | const

Returns
  deviation of the histogram

Definition at line 467 of file histogram.hh.

References at(), and size().

## end()

template<typename Feeder>

THistogram< Feeder >::const_iterator THistogram< Feeder >::end | ( |  | ) | const

Returns
  end of histogram

Definition at line 355 of file histogram.hh.

Referenced by push_range().

## excess_kurtosis()

template<typename Feeder>

double THistogram< Feeder >::excess_kurtosis | ( |  | ) | const

Returns
  the excess kurtosis value of the histogram

Definition at line 423 of file histogram.hh.

References at(), average(), and 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

  remove | the 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 486 of file histogram.hh.

References cvdebug().

## MAD()

template<typename Feeder>

Feeder::value_type THistogram< Feeder >::MAD | ( |  | ) | const

Returns
  Median Average Distance of the histogram

Definition at line 381 of file histogram.hh.

References median(), push(), size(), and THistogram().

## median()

template<typename Feeder>

Feeder::value_type THistogram< Feeder >::median | ( |  | ) | const

Returns
  median of the histogram

Definition at line 368 of file histogram.hh.

Referenced by MAD().

## operator[]()

template<typename Feeder>

size_t THistogram< Feeder >::operator[] | ( | size_t | idx | ) | const

Returns
  value of histogram bin at idx

Definition at line 361 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 325 of file histogram.hh.

Referenced by MAD(), and 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 342 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

  Iterator | forward iterator

Parameters

  begin | start of input range
  end | end of input range (STL convention)

Definition at line 333 of file histogram.hh.

References begin(), end(), and push().

## size()

template<typename Feeder>

size_t THistogram< Feeder >::size | ( |  | ) | const

Returns
  size of histogram

Definition at line 319 of file histogram.hh.

Referenced by average(), deviation(), excess_kurtosis(), MAD(), skewness(), THistogram(), and THistogram().

## skewness()

template<typename Feeder>

double THistogram< Feeder >::skewness | ( |  | ) | const

Returns
  the skewness value of the histogram

Definition at line 446 of file histogram.hh.

References at(), average(), and size().

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

- histogram.hh