ATLAS Offline Software
Loading...
Searching...
No Matches
IDTPM2::decorator< T > Class Template Reference

decorates types with the truth match information More...

#include <OfflineTruthMatcher.h>

Collaboration diagram for IDTPM2::decorator< T >:

Public Member Functions

template<typename Tp>
 decorator (const Tp *t)
 operator bool () const
const xAOD::TruthParticle * truthMatch () const
double discriminant () const

Private Attributes

const T * m_t

Static Private Attributes

static const SG::ConstAccessor< ElementLink< xAOD::TruthParticleContainer > > m_acc = {"truthParticleLink"}
static const SG::ConstAccessor< float > m_probAcc = {"truthMatchProbability"}

Detailed Description

template<typename T>
class IDTPM2::decorator< T >

decorates types with the truth match information

Definition at line 34 of file OfflineTruthMatcher.h.

Constructor & Destructor Documentation

◆ decorator()

template<typename T>
template<typename Tp>
IDTPM2::decorator< T >::decorator ( const Tp * t)
inlineexplicit

Definition at line 42 of file OfflineTruthMatcher.h.

42: m_t(t->template as<T>()) { }
decorates types with the truth match information

Member Function Documentation

◆ discriminant()

template<typename T>
double IDTPM2::decorator< T >::discriminant ( ) const
inline

Definition at line 54 of file OfflineTruthMatcher.h.

54 {
55 if ( m_t && m_probAcc.isAvailable(*m_t) ) {
56 float prob = m_probAcc(*m_t);
57 if ( prob ) return std::log10(1.0/prob);
58 }
60 }
static const SG::ConstAccessor< float > m_probAcc

◆ operator bool()

template<typename T>
IDTPM2::decorator< T >::operator bool ( ) const
inlineexplicit

Definition at line 44 of file OfflineTruthMatcher.h.

44{ return m_t!=0; }

◆ truthMatch()

template<typename T>
const xAOD::TruthParticle * IDTPM2::decorator< T >::truthMatch ( ) const
inline

Definition at line 46 of file OfflineTruthMatcher.h.

46 {
47 if ( m_t && m_acc.isAvailable(*m_t) ) {
49 if (link.isValid()) return *link;
50 }
51 return 0;
52 }
static const SG::ConstAccessor< ElementLink< xAOD::TruthParticleContainer > > m_acc

Member Data Documentation

◆ m_acc

template<typename T>
const SG::ConstAccessor<ElementLink<xAOD::TruthParticleContainer> > IDTPM2::decorator< T >::m_acc = {"truthParticleLink"}
inlinestaticprivate

Definition at line 36 of file OfflineTruthMatcher.h.

36{"truthParticleLink"};

◆ m_probAcc

template<typename T>
const SG::ConstAccessor<float> IDTPM2::decorator< T >::m_probAcc = {"truthMatchProbability"}
inlinestaticprivate

Definition at line 37 of file OfflineTruthMatcher.h.

37{"truthMatchProbability"};

◆ m_t

template<typename T>
const T* IDTPM2::decorator< T >::m_t
private

Definition at line 64 of file OfflineTruthMatcher.h.


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