ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
DecayBase< T > Class Template Reference

A class that allows for a fast calculation of the flavours of the descendants of a vertex, particle, or a set of particles. More...

#include <DecayProducts.h>

Collaboration diagram for DecayBase< T >:

Public Member Functions

void count (const int c)
 
int pd (int i) const
 
int pd (int i1, int i2) const
 
int apd (int i1, int i2) const
 
int apd (int i) const
 
int pd (const std::vector< int > &i) const
 
int apd (const std::vector< int > &i) const
 
size_t size () const
 
int apply (bool(*func)(const int &)) const
 

Public Attributes

std::map< int, int > m_pids
 
std::map< int, int > m_apids
 
size_t m_size
 

Detailed Description

template<class T>
class DecayBase< T >

A class that allows for a fast calculation of the flavours of the descendants of a vertex, particle, or a set of particles.

Definition at line 13 of file DecayProducts.h.

Member Function Documentation

◆ apd() [1/3]

template<class T >
int DecayBase< T >::apd ( const std::vector< int > &  i) const
inline

Definition at line 21 of file DecayProducts.h.

21 { int ret = 0; for ( auto ii: i) ret += apd(ii); return ret; }

◆ apd() [2/3]

template<class T >
int DecayBase< T >::apd ( int  i) const
inline

Definition at line 19 of file DecayProducts.h.

19 { return m_apids.count(i)?m_apids.at(i):0; }

◆ apd() [3/3]

template<class T >
int DecayBase< T >::apd ( int  i1,
int  i2 
) const
inline

Definition at line 18 of file DecayProducts.h.

18 { int ret = 0; for ( auto & a: m_apids) if (i1 <= a.first && a.first <= i2) ret += a.second; return ret; }

◆ apply()

template<class T >
int DecayBase< T >::apply ( bool(*)(const int &)  func) const
inline

Definition at line 23 of file DecayProducts.h.

23 { int ret = 0; for ( auto & a: m_pids) if (func(a.first)) ret+=a.second; return ret; }

◆ count()

template<class T >
void DecayBase< T >::count ( const int  c)
inline

Definition at line 15 of file DecayProducts.h.

15 { m_pids[c]++; m_apids[std::abs(c)]++; m_size++;}

◆ pd() [1/3]

template<class T >
int DecayBase< T >::pd ( const std::vector< int > &  i) const
inline

Definition at line 20 of file DecayProducts.h.

20 { int ret = 0; for ( auto ii: i) ret += pd(ii); return ret;}

◆ pd() [2/3]

template<class T >
int DecayBase< T >::pd ( int  i) const
inline

Definition at line 16 of file DecayProducts.h.

16 { return m_pids.count(i)?m_pids.at(i):0; }

◆ pd() [3/3]

template<class T >
int DecayBase< T >::pd ( int  i1,
int  i2 
) const
inline

Definition at line 17 of file DecayProducts.h.

17 { int ret = 0; for ( auto & a: m_pids) if (i1 <= a.first && a.first <= i2) ret += a.second; return ret; }

◆ size()

template<class T >
size_t DecayBase< T >::size ( ) const
inline

Definition at line 22 of file DecayProducts.h.

22 { return m_size; }

Member Data Documentation

◆ m_apids

template<class T >
std::map<int,int> DecayBase< T >::m_apids

Definition at line 25 of file DecayProducts.h.

◆ m_pids

template<class T >
std::map<int,int> DecayBase< T >::m_pids

Definition at line 24 of file DecayProducts.h.

◆ m_size

template<class T >
size_t DecayBase< T >::m_size

Definition at line 26 of file DecayProducts.h.


The documentation for this class was generated from the following file:
DecayBase::apd
int apd(int i1, int i2) const
Definition: DecayProducts.h:18
DecayBase::m_size
size_t m_size
Definition: DecayProducts.h:26
DecayBase::m_pids
std::map< int, int > m_pids
Definition: DecayProducts.h:24
lumiFormat.i
int i
Definition: lumiFormat.py:92
ret
T ret(T t)
Definition: rootspy.cxx:260
a
TList * a
Definition: liststreamerinfos.cxx:10
DecayBase::m_apids
std::map< int, int > m_apids
Definition: DecayProducts.h:25
python.compressB64.c
def c
Definition: compressB64.py:93
DecayBase::pd
int pd(int i) const
Definition: DecayProducts.h:16