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

#include <WriteDecorHandleTriplet.h>

Collaboration diagram for WriteDecorHandleKeyTriplet< T >:

Public Member Functions

 WriteDecorHandleKeyTriplet (asg::AsgTool *owner, const std::string &propertyName, const std::string &decorName, const std::string &description)
StatusCode assign (const std::string &standardCont, const std::string &chargedCont, const std::string &neutralCont)
StatusCode initialize ()
WriteDecorHandleTriplet< T > makeHandles (const unsigned short &inputType, const EventContext &ctx) const

Static Private Member Functions

static bool startsWith (const std::string &value, const std::string &prefix)

Private Attributes

SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_standard
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_charged
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_neutral

Detailed Description

template<typename T>
class WriteDecorHandleKeyTriplet< T >

Definition at line 117 of file WriteDecorHandleTriplet.h.

Constructor & Destructor Documentation

◆ WriteDecorHandleKeyTriplet()

template<typename T>
WriteDecorHandleKeyTriplet< T >::WriteDecorHandleKeyTriplet ( asg::AsgTool * owner,
const std::string & propertyName,
const std::string & decorName,
const std::string & description )
inline

Definition at line 132 of file WriteDecorHandleTriplet.h.

137 : m_standard(
138 owner,
139 propertyName.c_str(),
140 decorName.c_str(),
141 description.c_str())
142 , m_charged(
143 owner,
144 ("Charged" + propertyName).c_str(),
145 decorName.c_str(),
146 ("Charged " + description).c_str())
147 , m_neutral(
148 owner,
149 ("Neutral" + propertyName).c_str(),
150 decorName.c_str(),
151 ("Neutral " + description).c_str())
152 {}
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_charged
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_neutral
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_standard

Member Function Documentation

◆ assign()

template<typename T>
StatusCode WriteDecorHandleKeyTriplet< T >::assign ( const std::string & standardCont,
const std::string & chargedCont,
const std::string & neutralCont )
inline

Definition at line 154 of file WriteDecorHandleTriplet.h.

158 {
159 if (!standardCont.empty() && !startsWith(m_standard.key(), standardCont + ".")) {
160 ATH_CHECK(m_standard.assign(
161 standardCont + "." + m_standard.key()));
162 }
163
164 if (!chargedCont.empty() && !startsWith(m_charged.key(), chargedCont + ".")) {
165 ATH_CHECK(m_charged.assign(
166 chargedCont + "." + m_charged.key()));
167 }
168
169 if (!neutralCont.empty() && !startsWith(m_neutral.key(), neutralCont + ".")) {
170 ATH_CHECK(m_neutral.assign(
171 neutralCont + "." + m_neutral.key()));
172 }
173
174 return StatusCode::SUCCESS;
175 }
#define ATH_CHECK
Evaluate an expression and check for errors.
static bool startsWith(const std::string &value, const std::string &prefix)

◆ initialize()

template<typename T>
StatusCode WriteDecorHandleKeyTriplet< T >::initialize ( )
inline

Definition at line 177 of file WriteDecorHandleTriplet.h.

178 {
179 ATH_CHECK(m_standard.initialize());
180 ATH_CHECK(m_charged.initialize());
181 ATH_CHECK(m_neutral.initialize());
182
183 return StatusCode::SUCCESS;
184 }

◆ makeHandles()

template<typename T>
WriteDecorHandleTriplet< T > WriteDecorHandleKeyTriplet< T >::makeHandles ( const unsigned short & inputType,
const EventContext & ctx ) const
inline

Definition at line 186 of file WriteDecorHandleTriplet.h.

187 {
189 handles.setObjectType(inputType);
190
191
193 handles.setStandard(m_standard, ctx);
194 }
196 handles.setCharged(m_charged, ctx);
197 handles.setNeutral(m_neutral, ctx);
198 }
199
200 return handles;
201 }

◆ startsWith()

template<typename T>
bool WriteDecorHandleKeyTriplet< T >::startsWith ( const std::string & value,
const std::string & prefix )
inlinestaticprivate

Definition at line 123 of file WriteDecorHandleTriplet.h.

126 {
127 return value.compare(0, prefix.size(), prefix) == 0;
128 }

Member Data Documentation

◆ m_charged

template<typename T>
SG::WriteDecorHandleKey<xAOD::IParticleContainer> WriteDecorHandleKeyTriplet< T >::m_charged
private

Definition at line 120 of file WriteDecorHandleTriplet.h.

◆ m_neutral

template<typename T>
SG::WriteDecorHandleKey<xAOD::IParticleContainer> WriteDecorHandleKeyTriplet< T >::m_neutral
private

Definition at line 121 of file WriteDecorHandleTriplet.h.

◆ m_standard

template<typename T>
SG::WriteDecorHandleKey<xAOD::IParticleContainer> WriteDecorHandleKeyTriplet< T >::m_standard
private

Definition at line 119 of file WriteDecorHandleTriplet.h.


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