ATLAS Offline Software
Loading...
Searching...
No Matches
AsgOriginalObjectLinkAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8//
9// includes
10//
11
13
14//
15// method implementations
16//
17
18namespace CP
19{
20
21 StatusCode AsgOriginalObjectLinkAlg ::
22 initialize ()
23 {
24 if (m_baseContainerName.empty())
25 {
26 ANA_MSG_ERROR ("Base particle container name should not be empty.");
27 return StatusCode::FAILURE;
28 }
29
31 ANA_CHECK (m_systematicsList.initialize());
32 ANA_CHECK (m_baseContainerName.initialize());
33 return StatusCode::SUCCESS;
34 }
35
36
37
38 StatusCode AsgOriginalObjectLinkAlg ::
39 execute (const EventContext &ctx) const
40 {
41 for (const auto& sys : m_systematicsList.systematicsVector())
42 {
43 xAOD::IParticleContainer *particles = nullptr;
44 ANA_CHECK (m_particleHandle.getCopy (particles, sys));
45
47
48 if (!xAOD::setOriginalObjectLink (*baseParticles, *particles))
49 {
50 ATH_MSG_ERROR ("Cannot set original object links for container named " << m_baseContainerName);
51 return StatusCode::FAILURE;
52 }
53 }
54
55 return StatusCode::SUCCESS;
56 }
57}
#define ATH_MSG_ERROR(x)
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
SysListHandle m_systematicsList
the systematics list we run
SG::ReadHandleKey< xAOD::IParticleContainer > m_baseContainerName
base container name
SysCopyHandle< xAOD::IParticleContainer > m_particleHandle
the particle container we run on
Select isolated Photons, Electrons and Muons.
bool setOriginalObjectLink(const IParticle &original, IParticle &copy)
This function should be used by CP tools when they make a deep copy of an object in their correctedCo...
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.