g4tools  5.4.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::aida::stat_looper< T > Class Template Reference
Inheritance diagram for tools::aida::stat_looper< T >:
Inheritance graph
[legend]
Collaboration diagram for tools::aida::stat_looper< T >:
Collaboration graph
[legend]

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
 
- Public Member Functions inherited from tools::aida::base_looper< T >
 base_looper (base_ntu &a_ntu, const base_col &a_col)
 
virtual ~base_looper ()
 
 base_looper (const base_looper &a_from)
 
base_looperoperator= (const base_looper &)
 
bool process ()
 

Protected Member Functions

virtual bool action (const T &a_v)
 
- Protected Member Functions inherited from tools::aida::base_looper< T >
bool _looper (base_ntu &a_sub, const std::vector< unsigned int > &a_is, unsigned int a_depth, bool &a_stop)
 

Protected Attributes

bool m_first
 
m_mn
 
m_mx
 
m_S
 
m_S2
 
uint64 m_counter
 
- Protected Attributes inherited from tools::aida::base_looper< T >
base_ntum_ntu
 
const base_colm_col
 

Additional Inherited Members

- Static Public Member Functions inherited from tools::aida::base_looper< T >
static const std::string & s_class ()
 
- Static Protected Member Functions inherited from tools::aida::base_looper< T >
static bool find_is (const base_ntu &a_ntu, const base_col *a_col, std::vector< unsigned int > &a_is, bool &a_found)
 

Detailed Description

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

Definition at line 1275 of file aida_ntuple.

Constructor & Destructor Documentation

◆ stat_looper() [1/2]

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

Definition at line 1295 of file aida_ntuple.

1296  :base_looper<T>(a_ntu,a_col)
1297  ,m_first(true)
1298  ,m_mn(T())
1299  ,m_mx(T())
1300  ,m_S(T())
1301  ,m_S2(T())
1302  ,m_counter(0)
1303  {}

◆ ~stat_looper()

template<class T >
virtual tools::aida::stat_looper< T >::~stat_looper ( )
inlinevirtual

Definition at line 1304 of file aida_ntuple.

1304 {}

◆ stat_looper() [2/2]

template<class T >
tools::aida::stat_looper< T >::stat_looper ( const stat_looper< T > &  a_from)
inline

Definition at line 1306 of file aida_ntuple.

1307  :base_looper<T>(a_from)
1308  ,m_first(true)
1309  ,m_mn(T())
1310  ,m_mx(T())
1311  ,m_S(T())
1312  ,m_S2(T())
1313  ,m_counter(0)
1314  {}

Member Function Documentation

◆ action()

template<class T >
virtual bool tools::aida::stat_looper< T >::action ( const T &  a_v)
inlineprotectedvirtual

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

Definition at line 1277 of file aida_ntuple.

1277  {
1278  if(m_first) {
1279  m_mn = a_v;
1280  m_mx = a_v;
1281  m_S = a_v;
1282  m_S2 = a_v*a_v;
1283 
1284  m_first = false;
1285  } else {
1286  m_mn = min_of<T>(m_mn,a_v);
1287  m_mx = max_of<T>(m_mx,a_v);
1288  m_S += a_v;
1289  m_S2 += a_v*a_v;
1290  }
1291  m_counter++;
1292  return true; //continue looping.
1293  }

◆ counter()

template<class T >
uint64 tools::aida::stat_looper< T >::counter ( ) const
inline

Definition at line 1343 of file aida_ntuple.

1343 {return m_counter;}

◆ mn()

template<class T >
T tools::aida::stat_looper< T >::mn ( ) const
inline

Definition at line 1339 of file aida_ntuple.

1339 {return m_mn;}

◆ mx()

template<class T >
T tools::aida::stat_looper< T >::mx ( ) const
inline

Definition at line 1340 of file aida_ntuple.

1340 {return m_mx;}

◆ operator=()

template<class T >
stat_looper& tools::aida::stat_looper< T >::operator= ( const stat_looper< T > &  a_from)
inline

Definition at line 1315 of file aida_ntuple.

1315  {
1316  base_looper<T>::operator=(a_from);
1317  if(&a_from==this) return *this;
1318  m_first = true;
1319  m_mn = T();
1320  m_mx = T();
1321  m_S = T();
1322  m_S2 = T();
1323  m_counter = 0;
1324  return *this;
1325  }

◆ process()

template<class T >
bool tools::aida::stat_looper< T >::process ( )
inline

Definition at line 1327 of file aida_ntuple.

1327  {
1328  m_counter = 0;
1329  if(!base_looper<T>::process()) {
1330  m_mn = T();
1331  m_mx = T();
1332  m_S = T();
1333  m_S2 = T();
1334  m_counter = 0;
1335  return false;
1336  }
1337  return true;
1338  }

◆ S()

template<class T >
T tools::aida::stat_looper< T >::S ( ) const
inline

Definition at line 1341 of file aida_ntuple.

1341 {return m_S;}

◆ S2()

template<class T >
T tools::aida::stat_looper< T >::S2 ( ) const
inline

Definition at line 1342 of file aida_ntuple.

1342 {return m_S2;}

Member Data Documentation

◆ m_counter

template<class T >
uint64 tools::aida::stat_looper< T >::m_counter
protected

Definition at line 1350 of file aida_ntuple.

◆ m_first

template<class T >
bool tools::aida::stat_looper< T >::m_first
protected

Definition at line 1345 of file aida_ntuple.

◆ m_mn

template<class T >
T tools::aida::stat_looper< T >::m_mn
protected

Definition at line 1346 of file aida_ntuple.

◆ m_mx

template<class T >
T tools::aida::stat_looper< T >::m_mx
protected

Definition at line 1347 of file aida_ntuple.

◆ m_S

template<class T >
T tools::aida::stat_looper< T >::m_S
protected

Definition at line 1348 of file aida_ntuple.

◆ m_S2

template<class T >
T tools::aida::stat_looper< T >::m_S2
protected

Definition at line 1349 of file aida_ntuple.


The documentation for this class was generated from the following file:
tools::aida::stat_looper::m_first
bool m_first
Definition: aida_ntuple:1345
tools::aida::stat_looper::m_counter
uint64 m_counter
Definition: aida_ntuple:1350
tools::aida::base_looper::operator=
base_looper & operator=(const base_looper &)
Definition: aida_ntuple:1156
tools::aida::stat_looper::m_mx
T m_mx
Definition: aida_ntuple:1347
tools::aida::base_looper::process
bool process()
Definition: aida_ntuple:1158
tools::aida::stat_looper::m_S
T m_S
Definition: aida_ntuple:1348
tools::aida::stat_looper::m_S2
T m_S2
Definition: aida_ntuple:1349
tools::aida::stat_looper::m_mn
T m_mn
Definition: aida_ntuple:1346