ATLAS Offline Software
Loading...
Searching...
No Matches
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
13
16
17namespace CP
18{
19 namespace detail
20 {
21 template<>
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
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Define macros for attributes used to control the static checker.
Select isolated Photons, Electrons and Muons.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
void ClearTransientTrees ATLAS_NOT_THREAD_SAFE()
Function cleaning up the managed memory.
EgammaContainer_v1 EgammaContainer
Definition of the current "egamma container version".
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
static StatusCode getCopy(MsgStream &msgStream, const EventContext &ctx, xAOD::EgammaContainer *&object, const xAOD::EgammaContainer *inputObject, const std::string &outputName)
a helper class to create shallow copies and register them in the event store
MsgStream & msg
Definition testRead.cxx:32