ATLAS Offline Software
Loading...
Searching...
No Matches
WriteDecorHandleTriplet< T > Class Template Reference

#include <WriteDecorHandleTriplet.h>

Collaboration diagram for WriteDecorHandleTriplet< T >:

Public Member Functions

void setObjectType (unsigned short type)
void setStandard (const SG::WriteDecorHandleKey< xAOD::IParticleContainer > &key, const EventContext &ctx)
void setCharged (const SG::WriteDecorHandleKey< xAOD::IParticleContainer > &key, const EventContext &ctx)
void setNeutral (const SG::WriteDecorHandleKey< xAOD::IParticleContainer > &key, const EventContext &ctx)
T & operator() (const xAOD::IParticle &part)

Private Member Functions

void checkType ()

Private Attributes

std::unique_ptr< SG::WriteDecorHandle< xAOD::IParticleContainer, T > > m_standard
std::unique_ptr< SG::WriteDecorHandle< xAOD::IParticleContainer, T > > m_charged
std::unique_ptr< SG::WriteDecorHandle< xAOD::IParticleContainer, T > > m_neutral
unsigned short m_objectType {}

Detailed Description

template<typename T>
class WriteDecorHandleTriplet< T >

Definition at line 24 of file WriteDecorHandleTriplet.h.

Member Function Documentation

◆ checkType()

template<typename T>
void WriteDecorHandleTriplet< T >::checkType ( )
inlineprivate

Definition at line 31 of file WriteDecorHandleTriplet.h.

31 {
32 switch (m_objectType) {
37 return;
38 break;
39
40 default:
42 "WriteDecorHandleTriplet: Unsupported input type " +
43 std::to_string(static_cast<int>(m_objectType)));
44 }
45
46 }

◆ operator()()

template<typename T>
T & WriteDecorHandleTriplet< T >::operator() ( const xAOD::IParticle & part)
inline

Definition at line 86 of file WriteDecorHandleTriplet.h.

87 {
88 switch (m_objectType) {
89
92 return (*m_standard)(part);
93
95 {
96 auto& pfo = static_cast<const xAOD::PFO&>(part);
97 return pfo.isCharged()
98 ? (*m_charged)(pfo)
99 : (*m_neutral)(pfo);
100 }
101
103 {
104 auto& fe = static_cast<const xAOD::FlowElement&>(part);
105 return fe.isCharged()
106 ? (*m_charged)(fe)
107 : (*m_neutral)(fe);
108 }
109
110 default:
111 throw std::runtime_error("WriteDecorHandleTriplet: Unsupported input type");
112 }
113 }
std::unique_ptr< SG::WriteDecorHandle< xAOD::IParticleContainer, T > > m_neutral
std::unique_ptr< SG::WriteDecorHandle< xAOD::IParticleContainer, T > > m_standard

◆ setCharged()

template<typename T>
void WriteDecorHandleTriplet< T >::setCharged ( const SG::WriteDecorHandleKey< xAOD::IParticleContainer > & key,
const EventContext & ctx )
inline

Definition at line 66 of file WriteDecorHandleTriplet.h.

69 {
70 m_charged =
73 >(key, ctx);
74 }
std::unique_ptr< SG::WriteDecorHandle< xAOD::IParticleContainer, T > > m_charged

◆ setNeutral()

template<typename T>
void WriteDecorHandleTriplet< T >::setNeutral ( const SG::WriteDecorHandleKey< xAOD::IParticleContainer > & key,
const EventContext & ctx )
inline

◆ setObjectType()

template<typename T>
void WriteDecorHandleTriplet< T >::setObjectType ( unsigned short type)
inline

Definition at line 50 of file WriteDecorHandleTriplet.h.

◆ setStandard()

template<typename T>
void WriteDecorHandleTriplet< T >::setStandard ( const SG::WriteDecorHandleKey< xAOD::IParticleContainer > & key,
const EventContext & ctx )
inline

Member Data Documentation

◆ m_charged

template<typename T>
std::unique_ptr<SG::WriteDecorHandle<xAOD::IParticleContainer, T> > WriteDecorHandleTriplet< T >::m_charged
private

Definition at line 27 of file WriteDecorHandleTriplet.h.

◆ m_neutral

template<typename T>
std::unique_ptr<SG::WriteDecorHandle<xAOD::IParticleContainer, T> > WriteDecorHandleTriplet< T >::m_neutral
private

Definition at line 28 of file WriteDecorHandleTriplet.h.

◆ m_objectType

template<typename T>
unsigned short WriteDecorHandleTriplet< T >::m_objectType {}
private

Definition at line 29 of file WriteDecorHandleTriplet.h.

29{};

◆ m_standard

template<typename T>
std::unique_ptr<SG::WriteDecorHandle<xAOD::IParticleContainer, T> > WriteDecorHandleTriplet< T >::m_standard
private

Definition at line 26 of file WriteDecorHandleTriplet.h.


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