ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
SystematicsHandles
SystematicsHandles
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
15
#include <
xAODMissingET/MissingETContainer.h
>
16
#include <functional>
17
#include <type_traits>
18
19
#ifndef XAOD_STANDALONE
20
#include <
AthenaKernel/CLASS_DEF.h
>
21
#include <
AthenaKernel/TopBase.h
>
22
#include <GaudiKernel/DataObjID.h>
23
#include <GaudiKernel/DataHandle.h>
24
#endif
25
26
//
27
// method implementations
28
//
29
30
namespace
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
;
55
return
ClassID_traits<topbase_t>::ID
();
56
}
57
}
58
if
(!typeName.empty())
59
return
DataObjID(typeName,
""
).clid();
60
else
61
return
ClassID_traits<ContainerType>::ID
();
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
CLASS_DEF.h
macros to associate a CLID to a type
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
MissingETContainer.h
TopBase.h
Calculate topmost accessible base accessible via SG_BASES.
CP::ISystematicsSvc
the interface for the central systematics service
Definition
ISystematicsSvc.h:26
CP::detail
Definition
EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/CopyHelpers.h:20
CP::detail::getClidForDependency
CLID getClidForDependency(const std::string &typeName, const std::string &decoName, bool decoWrite)
Definition
AthenaDependencyHelpers.h:39
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
xAOD::name
name
Definition
TriggerMenuJson_v1.cxx:29
ClassID_traits::ID
static constexpr CLID ID()
Definition
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
SG::TopBase::type
typename std::conditional< has_base &&base_has_clid, typename TopBase< Base1 >::type, T >::type type
Definition
TopBase.h:50
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0