ATLAS Offline Software
AsgOriginalObjectLinkAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 //
9 // includes
10 //
11 
13 
14 //
15 // method implementations
16 //
17 
18 namespace CP
19 {
20 
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 
32  ANA_CHECK (m_baseContainerName.initialize());
33  return StatusCode::SUCCESS;
34  }
35 
36 
37 
39  execute ()
40  {
41  for (const auto& sys : m_systematicsList.systematicsVector())
42  {
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 }
CP::AsgOriginalObjectLinkAlg::initialize
StatusCode initialize() override
Definition: AsgOriginalObjectLinkAlg.cxx:22
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
CP::AsgOriginalObjectLinkAlg::m_particleHandle
SysCopyHandle< xAOD::IParticleContainer > m_particleHandle
the particle container we run on
Definition: AsgOriginalObjectLinkAlg.h:46
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
CP::AsgOriginalObjectLinkAlg::execute
StatusCode execute() override
Definition: AsgOriginalObjectLinkAlg.cxx:39
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::AsgOriginalObjectLinkAlg::m_baseContainerName
SG::ReadHandleKey< xAOD::IParticleContainer > m_baseContainerName
base container name
Definition: AsgOriginalObjectLinkAlg.h:38
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CP::SysListHandle::initialize
::StatusCode initialize()
intialize this property
Definition: SysListHandle.cxx:69
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
xAOD::setOriginalObjectLink
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...
Definition: IParticleHelpers.cxx:30
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
AsgOriginalObjectLinkAlg.h
CP::AsgOriginalObjectLinkAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition: AsgOriginalObjectLinkAlg.h:42