inlib  1.2.0
Public Member Functions | Protected Member Functions | Protected Attributes
inlib::aida::stat_looper< T > Class Template Reference
Inheritance diagram for inlib::aida::stat_looper< T >:
Inheritance graph
[legend]
Collaboration diagram for inlib::aida::stat_looper< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 stat_looper (base_ntu &a_ntu, const base_col &a_col)
virtual ~stat_looper ()
 stat_looper (const stat_looper &a_from)
stat_looperoperator= (const stat_looper &a_from)
bool process ()
mn () const
mx () const
S () const
S2 () const
uint64 counter () const

Protected Member Functions

virtual bool action (const T &a_v)

Protected Attributes

bool m_first
m_mn
m_mx
m_S
m_S2
uint64 m_counter

Detailed Description

template<class T>
class inlib::aida::stat_looper< T >

Definition at line 1135 of file aida_ntuple.


Constructor & Destructor Documentation

template<class T>
inlib::aida::stat_looper< T >::stat_looper ( base_ntu a_ntu,
const base_col a_col 
) [inline]

Definition at line 1155 of file aida_ntuple.

  : base_looper<T>(a_ntu,a_col)
  ,m_first(true)
  ,m_mn(T())
  ,m_mx(T())
  ,m_S(T())
  ,m_S2(T())
  ,m_counter(0)
  {}
template<class T>
virtual inlib::aida::stat_looper< T >::~stat_looper ( ) [inline, virtual]

Definition at line 1164 of file aida_ntuple.

{}
template<class T>
inlib::aida::stat_looper< T >::stat_looper ( const stat_looper< T > &  a_from) [inline]

Definition at line 1166 of file aida_ntuple.

  : base_looper<T>(a_from)
  ,m_first(true)
  ,m_mn(T())
  ,m_mx(T())
  ,m_S(T())
  ,m_S2(T())
  ,m_counter(0)
  {}

Member Function Documentation

template<class T>
virtual bool inlib::aida::stat_looper< T >::action ( const T &  a_v) [inline, protected, virtual]

Implements inlib::aida::base_looper< T >.

Definition at line 1137 of file aida_ntuple.

                                    {
    if(m_first) {
      m_mn = a_v;
      m_mx = a_v;
      m_S = a_v;
      m_S2 = a_v*a_v;

      m_first = false;
    } else {
      m_mn = inlib::mn<T>(m_mn,a_v);
      m_mx = inlib::mx<T>(m_mx,a_v);
      m_S += a_v;
      m_S2 += a_v*a_v;
    }
    m_counter++;
    return true; //continue looping.
  }
template<class T>
uint64 inlib::aida::stat_looper< T >::counter ( ) const [inline]

Definition at line 1202 of file aida_ntuple.

{return m_counter;}
template<class T>
T inlib::aida::stat_looper< T >::mn ( ) const [inline]

Definition at line 1198 of file aida_ntuple.

{return m_mn;}
template<class T>
T inlib::aida::stat_looper< T >::mx ( ) const [inline]

Definition at line 1199 of file aida_ntuple.

{return m_mx;}
template<class T>
stat_looper& inlib::aida::stat_looper< T >::operator= ( const stat_looper< T > &  a_from) [inline]

Definition at line 1175 of file aida_ntuple.

                                                   {
    base_looper<T>::operator=(a_from);
    m_first = true;
    m_mn = T();
    m_mx = T();
    m_S = T();
    m_S2 = T();
    m_counter = 0;
    return *this;
  }  
template<class T>
bool inlib::aida::stat_looper< T >::process ( ) [inline]

Reimplemented from inlib::aida::base_looper< T >.

Definition at line 1186 of file aida_ntuple.

                 {
    m_counter = 0;
    if(!base_looper<T>::process()) {
      m_mn = T();
      m_mx = T();
      m_S = T();
      m_S2 = T();
      m_counter = 0;
      return false;
    }
    return true;
  }
template<class T>
T inlib::aida::stat_looper< T >::S ( ) const [inline]

Definition at line 1200 of file aida_ntuple.

{return m_S;}
template<class T>
T inlib::aida::stat_looper< T >::S2 ( ) const [inline]

Definition at line 1201 of file aida_ntuple.

{return m_S2;}

Member Data Documentation

template<class T>
uint64 inlib::aida::stat_looper< T >::m_counter [protected]

Definition at line 1209 of file aida_ntuple.

template<class T>
bool inlib::aida::stat_looper< T >::m_first [protected]

Definition at line 1204 of file aida_ntuple.

template<class T>
T inlib::aida::stat_looper< T >::m_mn [protected]

Definition at line 1205 of file aida_ntuple.

template<class T>
T inlib::aida::stat_looper< T >::m_mx [protected]

Definition at line 1206 of file aida_ntuple.

template<class T>
T inlib::aida::stat_looper< T >::m_S [protected]

Definition at line 1207 of file aida_ntuple.

template<class T>
T inlib::aida::stat_looper< T >::m_S2 [protected]

Definition at line 1208 of file aida_ntuple.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines