ATLAS Offline Software
Loading...
Searching...
No Matches
AsgObjectScaleFactorAlg.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
7namespace CP
8{
9
10 StatusCode AsgObjectScaleFactorAlg ::
11 initialize ()
12 {
13
15
16 for(const auto& sf : m_inScaleFactors)
17 m_inSFHandles.emplace_back(sf, this);
18 for(auto& handle : m_inSFHandles)
20
22
23 ANA_CHECK (m_systematicsList.initialize());
24
25 return StatusCode::SUCCESS;
26 }
27
28 StatusCode AsgObjectScaleFactorAlg ::
29 execute ()
30 {
31
32 for (const auto& sys : m_systematicsList.systematicsVector())
33 {
34 const xAOD::IParticleContainer *particles = nullptr;
35 ANA_CHECK (m_particlesHandle.retrieve (particles, sys));
36 for (const xAOD::IParticle *particle : *particles)
37 {
38 float scaleFactor = 1.;
39 for(const auto& sf : m_inSFHandles)
40 scaleFactor *= sf.get(*particle, sys);
41
42 m_outSFHandle.set(*particle, scaleFactor, sys);
43 }
44 }
45
46 return StatusCode::SUCCESS;
47 }
48
49} // namespace
#define ANA_CHECK(EXP)
check whether the given expression was successful
std::vector< SysReadDecorHandle< float > > m_inSFHandles
SysWriteDecorHandle< float > m_outSFHandle
SysReadHandle< xAOD::IParticleContainer > m_particlesHandle
the particle container we run on
SysListHandle m_systematicsList
the systematics list we run
Gaudi::Property< std::vector< std::string > > m_inScaleFactors
void handle(const Incident &inc)
receive the given incident
Class providing the definition of the 4-vector interface.
Select isolated Photons, Electrons and Muons.
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.