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 {
25 public:
26 typedef std::decay<decltype(
27 *(std::declval<EL::AnaAlgorithm>().evtStore()))>::type StoreType;
28
29 static StatusCode
30 getCopy (MsgStream& msgStream, StoreType& store,
31 xAOD::EgammaContainer*& object,
32 const xAOD::EgammaContainer *inputObject,
33 const std::string& outputName, const std::string& auxName)
34 {
35 // Set up a lambda for providing a msg(...) function.
36 // Suppress thread-checker warning because this provides just a wrapper to MsgStream.
37 const auto msg = [&] ATLAS_NOT_THREAD_SAFE (MSG::Level lvl) -> MsgStream& {
38 msgStream << lvl;
39 return msgStream;
40 };
41
42 xAOD::IParticleContainer *subobject = nullptr;
43 if (!ShallowCopy<xAOD::IParticleContainer>::getCopy (msgStream, store, subobject, inputObject, outputName, auxName).isSuccess())
44 return StatusCode::FAILURE;
45 if (!(object = dynamic_cast<xAOD::EgammaContainer*>(subobject)))
46 {
47 ANA_MSG_ERROR ("copy of EgammaContainer is not an EgammaContainer");
48 ANA_MSG_ERROR ("check logic in CopyHelpers");
49 return StatusCode::FAILURE;
50 }
51 return StatusCode::SUCCESS;
52 }
53 };
54 }
55}
56
57#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.
std::decay< decltype(*(std::declval< EL::AnaAlgorithm >().evtStore()))>::type StoreType
the type of the event store we use
static StatusCode getCopy(MsgStream &msgStream, StoreType &store, xAOD::EgammaContainer *&object, const xAOD::EgammaContainer *inputObject, const std::string &outputName, const std::string &auxName)
a helper class to create shallow copies and register them in the event store
MsgStream & msg
Definition testRead.cxx:32