ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaDependencyHelpers.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8#ifndef SYSTEMATICS_HANDLES__ATHENA_DEPENDENCY_HELPERS_H
9#define SYSTEMATICS_HANDLES__ATHENA_DEPENDENCY_HELPERS_H
10
11//
12// includes
13//
14
16#include <functional>
17#include <type_traits>
18
19#ifndef XAOD_STANDALONE
22#include <GaudiKernel/DataObjID.h>
23#include <GaudiKernel/DataHandle.h>
24#endif
25
26//
27// method implementations
28//
29
30namespace CP
31{
32 class ISystematicsSvc;
33
34 namespace detail
35 {
36#ifndef XAOD_STANDALONE
37 template<typename ContainerType>
38 requires (!std::is_const_v<ContainerType>)
39 CLID getClidForDependency (const std::string& typeName, const std::string& decoName, bool decoWrite)
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 }
63
64
65 StatusCode addSysDependency (MsgStream& msg, const ISystematicsSvc& svc,
66 const std::function<void(const DataObjID&, Gaudi::DataHandle::Mode)>& addAlgDependency,
67 const CLID clid, const std::string& name, Gaudi::DataHandle::Mode mode,
68 const std::string& decoName, bool decoWrite);
69#endif
70 } // namespace detail
71}
72
73#endif
macros to associate a CLID to a type
uint32_t CLID
The Class ID type.
Calculate topmost accessible base accessible via SG_BASES.
the interface for the central systematics service
CLID getClidForDependency(const std::string &typeName, const std::string &decoName, bool decoWrite)
Select isolated Photons, Electrons and Muons.
typename std::conditional< has_base &&base_has_clid, typename TopBase< Base1 >::type, T >::type type
Definition TopBase.h:50
MsgStream & msg
Definition testRead.cxx:32