ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
EgammaAnalysisAlgorithms
EgammaAnalysisAlgorithms
EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/CopyHelpers.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
9
#ifndef EGAMMA_ANALYSIS_ALGORITHMS__COPY_HELPERS_H
10
#define EGAMMA_ANALYSIS_ALGORITHMS__COPY_HELPERS_H
11
12
#include <
SystematicsHandles/CopyHelpers.h
>
13
14
#include <
CxxUtils/checker_macros.h
>
15
#include <
xAODEgamma/EgammaContainer.h
>
16
17
namespace
CP
18
{
19
namespace
detail
20
{
21
template
<>
22
struct
ShallowCopy
<
xAOD
::
EgammaContainer
>
23
{
24
static
StatusCode
25
getCopy
(MsgStream& msgStream,
const
EventContext& ctx,
26
xAOD::EgammaContainer
*&
object
,
27
const
xAOD::EgammaContainer
*inputObject,
28
const
std::string& outputName)
29
{
30
// Set up a lambda for providing a msg(...) function.
31
// Suppress thread-checker warning because this provides just a wrapper to MsgStream.
32
const
auto
msg
= [&]
ATLAS_NOT_THREAD_SAFE
(MSG::Level lvl) -> MsgStream& {
33
msgStream << lvl;
34
return
msgStream;
35
};
36
37
xAOD::IParticleContainer
*subobject =
nullptr
;
38
if
(!
ShallowCopy<xAOD::IParticleContainer>::getCopy
(msgStream, ctx, subobject, inputObject, outputName).isSuccess())
39
return
StatusCode::FAILURE;
40
if
(!(
object
=
dynamic_cast<
xAOD::EgammaContainer
*
>
(subobject)))
41
{
42
ANA_MSG_ERROR
(
"copy of EgammaContainer is not an EgammaContainer"
);
43
ANA_MSG_ERROR
(
"check logic in CopyHelpers"
);
44
return
StatusCode::FAILURE;
45
}
46
return
StatusCode::SUCCESS;
47
}
48
};
49
}
50
}
51
52
#endif
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
EgammaContainer.h
CopyHelpers.h
checker_macros.h
Define macros for attributes used to control the static checker.
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
detail
Definition
extract_histogram_tag.cxx:14
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition
ICaloAffectedTool.h:24
xAOD::ATLAS_NOT_THREAD_SAFE
void ClearTransientTrees ATLAS_NOT_THREAD_SAFE()
Function cleaning up the managed memory.
Definition
MakeTransientTree.cxx:217
xAOD::EgammaContainer
EgammaContainer_v1 EgammaContainer
Definition of the current "egamma container version".
Definition
EgammaContainer.h:17
xAOD::IParticleContainer
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
Definition
xAOD/xAODBase/xAODBase/IParticleContainer.h:32
CP::detail::ShallowCopy< xAOD::EgammaContainer >::getCopy
static StatusCode getCopy(MsgStream &msgStream, const EventContext &ctx, xAOD::EgammaContainer *&object, const xAOD::EgammaContainer *inputObject, const std::string &outputName)
Definition
EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/CopyHelpers.h:25
CP::detail::ShallowCopy
a helper class to create shallow copies and register them in the event store
Definition
SystematicsHandles/SystematicsHandles/CopyHelpers.h:66
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0