ATLAS Offline Software
Loading...
Searching...
No Matches
CP::detail Namespace Reference

Classes

struct  ContainerType
 check what kind of object/container the argument is More...
struct  ShallowCopy
 a helper class to create shallow copies and register them in the event store More...
struct  ShallowCopy< T, 1 >
struct  ShallowCopy< T, 2 >
struct  ShallowCopy< T, 3 >
struct  ShallowCopy< xAOD::EgammaContainer >
struct  ShallowCopy< xAOD::IParticleContainer >

Functions

StatusCode addSysDependency (MsgStream &msg, const ISystematicsSvc &svc, const std::function< void(const DataObjID &, Gaudi::DataHandle::Mode)> &addAlgDependency, const CLID clid, const std::string &name, Gaudi::DataHandle::Mode mode, const std::string &decoName, bool decoWrite)
template<typename ContainerType>
requires (!std::is_const_v<ContainerType>)
CLID getClidForDependency (const std::string &typeName, const std::string &decoName, bool decoWrite)

Function Documentation

◆ addSysDependency()

StatusCode CP::detail::addSysDependency ( MsgStream & msg,
const ISystematicsSvc & svc,
const std::function< void(const DataObjID &, Gaudi::DataHandle::Mode)> & addAlgDependency,
const CLID clid,
const std::string & name,
Gaudi::DataHandle::Mode mode,
const std::string & decoName,
bool decoWrite )

I'm only adding a dependency for nominal here, as there are currently no use cases in which a downstream user would only read a systematic, but not the nominal. The concern is that we might add dozens (or in extreme cases hundreds) of dependencies, without those adding providing any value.

Definition at line 26 of file AthenaDependencyHelpers.cxx.

30 {
31 // Build full key string: "StoreGateSvc+name"
32 std::string fullKeyStr = "StoreGateSvc+";
33
34 {
40 std::string temp;
41 if (svc.makeSystematicsName (temp, name, CP::SystematicSet{}).isFailure())
42 {
43 msg << MSG::ERROR << "could not build nominal systematic name for " + name << endmsg;
44 return StatusCode::FAILURE;
45 }
46 fullKeyStr += temp;
47 }
48
49 if (!decoName.empty())
50 {
51 std::string temp;
52 if (svc.makeSystematicsName (temp, decoName, CP::SystematicSet{}).isFailure())
53 {
54 msg << MSG::ERROR << "could not build nominal systematic name for " + decoName << endmsg;
55 return StatusCode::FAILURE;
56 }
57
58 // Build decoration key string
59 fullKeyStr += "." + temp;
60
61 // Decoration mode
62 mode = decoWrite ? Gaudi::DataHandle::Writer : Gaudi::DataHandle::Reader;
63 }
64
65 addAlgDependency(DataObjID{clid, fullKeyStr}, mode);
66 return StatusCode::SUCCESS;
67 }
#define endmsg
Class to wrap a set of SystematicVariations.
MsgStream & msg
Definition testRead.cxx:32

◆ getClidForDependency()

template<typename ContainerType>
requires (!std::is_const_v<ContainerType>)
CLID CP::detail::getClidForDependency ( const std::string & typeName,
const std::string & decoName,
bool decoWrite )

Definition at line 39 of file AthenaDependencyHelpers.h.

40 {
41 // MissingETContainer special case: `TopBase` is not defined for
42 // it, so we don't use it. Instead we will just use the regular
43 // CLID. Should the `TopBase` ever be defined for
44 // `xAOD::MissingETContainer`, this special case can be removed,
45 // and with it the dependency in `CMakeLists.txt`.
46 if constexpr (!std::same_as<ContainerType, xAOD::MissingETContainer>)
47 {
48 // For reading decorations we have a special case that matches
49 // what the @ref SG::ReadDecorHandle does: Essentially it
50 // registers with the top-most base, instead of the actual type.
51 if (!decoName.empty() && !decoWrite)
52 {
53 // For decorations being read, use TopBase<ContainerType>
54 using topbase_t = typename SG::TopBase<ContainerType>::type;
56 }
57 }
58 if (!typeName.empty())
59 return DataObjID(typeName, "").clid();
60 else
62 }
std::conditional< has_base, typenameTopBase< Base1 >::type, T >::type type
Definition TopBase.h:43