ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
SystematicsHandles
Root
SystematicsHandles/Root/CopyHelpers.cxx
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
// includes
10
//
11
12
#include <
SystematicsHandles/CopyHelpers.h
>
13
14
#include <
xAODEgamma/PhotonContainer.h
>
15
#include <
xAODEgamma/ElectronContainer.h
>
16
#include <
xAODJet/JetContainer.h
>
17
#include <
xAODMuon/MuonContainer.h
>
18
#include <
xAODTau/TauJetContainer.h
>
19
#include <
xAODTracking/TrackParticleContainer.h
>
20
#include <
xAODTruth/TruthParticleContainer.h
>
21
22
//
23
// method implementations
24
//
25
26
namespace
CP
27
{
28
namespace
detail
29
{
30
StatusCode
ShallowCopy<xAOD::IParticleContainer> ::
31
getCopy
(MsgStream& msgStream,
const
EventContext& ctx,
32
xAOD::IParticleContainer
*&
object
,
33
const
xAOD::IParticleContainer
*inputObject,
34
const
std::string& outputName)
35
{
36
// this is probably not the best way to do this, but doing this
37
// the proper way will require an xAOD expert to do it.
38
39
// Set up a lambda for providing a msg(...) function.
40
// Suppress thread-checker warning because this provides just a wrapper to MsgStream.
41
const
auto
msg
= [&]
ATLAS_NOT_THREAD_SAFE
(MSG::Level lvl) -> MsgStream& {
42
msgStream << lvl;
43
return
msgStream;
44
};
45
46
// using a macro is a bit awkward, but doing this as a template
47
// is not practical either
48
#define COPY(TYPE) \
49
do { \
50
const TYPE *in = dynamic_cast< const TYPE* >( inputObject ); \
51
if( in ) { \
52
TYPE *out = nullptr; \
53
ANA_CHECK( ShallowCopy<TYPE>::getCopy( msgStream, ctx, out, in, \
54
outputName ) ); \
55
object = out; \
56
return StatusCode::SUCCESS; \
57
} \
58
} while( false )
59
60
COPY
(
xAOD::JetContainer
);
61
COPY
(
xAOD::MuonContainer
);
62
COPY
(
xAOD::ElectronContainer
);
63
COPY
(
xAOD::PhotonContainer
);
64
COPY
(
xAOD::TauJetContainer
);
65
COPY
(
xAOD::TrackParticleContainer
);
66
COPY
(
xAOD::TruthParticleContainer
);
67
68
#undef COPY
69
70
ANA_MSG_ERROR
(
"could not determine type to create shallow copy "
<< outputName);
71
ANA_MSG_ERROR
(
"please extend CopyHelpers.cxx with the appropriate type"
);
72
return
StatusCode::FAILURE;
73
}
74
}
75
}
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ElectronContainer.h
PhotonContainer.h
MuonContainer.h
TrackParticleContainer.h
TruthParticleContainer.h
JetContainer.h
COPY
#define COPY(TYPE)
CopyHelpers.h
TauJetContainer.h
CP::detail
Definition
EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/CopyHelpers.h:20
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
xAOD::PhotonContainer
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/PhotonContainer.h:17
xAOD::ElectronContainer
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/ElectronContainer.h:17
xAOD::TrackParticleContainer
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticleContainer.h:14
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
xAOD::ATLAS_NOT_THREAD_SAFE
void ClearTransientTrees ATLAS_NOT_THREAD_SAFE()
Function cleaning up the managed memory.
Definition
MakeTransientTree.cxx:217
xAOD::TauJetContainer
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
Definition
TauJetContainer.h:17
xAOD::MuonContainer
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
Definition
Event/xAOD/xAODMuon/xAODMuon/MuonContainer.h:14
xAOD::TruthParticleContainer
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticleContainer.h:17
xAOD::IParticleContainer
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
Definition
xAOD/xAODBase/xAODBase/IParticleContainer.h:32
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