39 {
40
41
42
43
44 std::conditional_t<mode == 0,SG::ReadHandleKey<ContainerType>,
45 std::conditional_t<mode == 1,SG::WriteHandleKey<ContainerType>,
47 if (!key.initialize().isSuccess())
48 return StatusCode::FAILURE;
49
50 if (decoName.empty())
51 {
52 owner.addDependency (key.fullKey(), key.mode());
53 return StatusCode::SUCCESS;
54 }
55
56
57
58
59
60 if constexpr (std::same_as<ContainerType, xAOD::MissingETContainer>)
61 {
62 owner.msg() << MSG::WARNING <<
"Can not add decoration dependency " <<
name <<
"." << decoName <<
" as MissingET doesn't support decoration dependencies. This is only problematic if you are running in AthenaMT and rely on this dependency to exist." <<
endmsg;
63 return StatusCode::SUCCESS;
64 } else
65 {
66 if (decoWrite)
67 {
68 SG::WriteDecorHandleKey<ContainerType> decoKey {
key, decoName};
70 return StatusCode::FAILURE;
71 owner.addDependency (decoKey.fullKey(), decoKey.mode());
72 } else
73 {
74 SG::ReadDecorHandleKey<ContainerType> decoKey {
key, decoName};
76 return StatusCode::FAILURE;
77 owner.addDependency (decoKey.fullKey(), decoKey.mode());
78 }
79 return StatusCode::SUCCESS;
80 }
81 }
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Property holding a SG store/key/clid from which an UpdateHandle is made.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.