ATLAS Offline Software
EgammaIsolationSelectionAlg.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 //
10 // includes
11 //
12 
14 
15 //
16 // method implementations
17 //
18 
19 namespace CP
20 {
21 
23  initialize ()
24  {
25  ANA_CHECK (m_selectionTool.retrieve());
26 
31 
32  if (!m_nameSvc.empty())
33  {
34  ANA_CHECK (m_nameSvc.retrieve());
35  ANA_CHECK (m_nameSvc->addAcceptInfo (m_egammasHandle.getNamePattern(), m_selectionHandle.getLabel(),
36  m_isPhoton.value() ? m_selectionTool->getPhotonAcceptInfo() : m_selectionTool->getElectronAcceptInfo()));
37  }
38 
39  asg::AcceptData blankAccept {&(m_isPhoton.value() ? m_selectionTool->getPhotonAcceptInfo() : m_selectionTool->getElectronAcceptInfo())};
40  m_setOnFail = selectionFromAccept(blankAccept);
41 
42  return StatusCode::SUCCESS;
43  }
44 
45 
46 
48  execute ()
49  {
50  for (const auto& sys : m_systematicsList.systematicsVector())
51  {
52  const xAOD::EgammaContainer *egammas = nullptr;
53  ANA_CHECK (m_egammasHandle.retrieve (egammas, sys));
54  for (const xAOD::Egamma *egamma : *egammas)
55  {
57  {
60  } else {
62  }
63  }
64  }
65  return StatusCode::SUCCESS;
66  }
67 }
CP::SysWriteSelectionHandle::setBits
void setBits(const SG::AuxElement &element, SelectionType selection, const CP::SystematicSet &sys) const
set the selection decoration
CP::EgammaIsolationSelectionAlg::initialize
StatusCode initialize() override
Definition: EgammaIsolationSelectionAlg.cxx:23
CP::selectionFromAccept
SelectionType selectionFromAccept(const asg::AcceptData &accept)
the selection decoration made from the given AcceptData object
Definition: SelectionHelpers.cxx:32
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
CP::EgammaIsolationSelectionAlg::execute
StatusCode execute() override
Definition: EgammaIsolationSelectionAlg.cxx:48
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::SysWriteSelectionHandle::getLabel
std::string getLabel() const
get the name/label of the decoration
Definition: SysWriteSelectionHandle.cxx:76
egamma
Definition: egamma.h:58
CP::EgammaIsolationSelectionAlg::m_setOnFail
SelectionType m_setOnFail
the bits to set for an object failing the preselection
Definition: EgammaIsolationSelectionAlg.h:71
CP::EgammaIsolationSelectionAlg::m_nameSvc
ServiceHandle< ISelectionNameSvc > m_nameSvc
the ISelectionNameSvc
Definition: EgammaIsolationSelectionAlg.h:62
CP::EgammaIsolationSelectionAlg::m_selectionTool
ToolHandle< IIsolationSelectionTool > m_selectionTool
the selection tool
Definition: EgammaIsolationSelectionAlg.h:39
CP::EgammaIsolationSelectionAlg::m_isPhoton
Gaudi::Property< bool > m_isPhoton
whether this is running on photons
Definition: EgammaIsolationSelectionAlg.h:66
CP::SysListHandle::initialize
::StatusCode initialize()
intialize this property
Definition: SysListHandle.cxx:69
CP::SysReadSelectionHandle::getBool
bool getBool(const SG::AuxElement &element, const CP::SystematicSet &sys) const
get the selection as a bool
CP::EgammaIsolationSelectionAlg::m_selectionHandle
SysWriteSelectionHandle m_selectionHandle
the decoration for the asg selection
Definition: EgammaIsolationSelectionAlg.h:57
CP::EgammaIsolationSelectionAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition: EgammaIsolationSelectionAlg.h:47
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EgammaIsolationSelectionAlg.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
CP::EgammaIsolationSelectionAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition: EgammaIsolationSelectionAlg.h:43
CP::SysReadSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysReadSelectionHandle.cxx:34
asg::AcceptData
Definition: AcceptData.h:30
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
CP::EgammaIsolationSelectionAlg::m_egammasHandle
SysReadHandle< xAOD::EgammaContainer > m_egammasHandle
the particle continer we run on
Definition: EgammaIsolationSelectionAlg.h:52
CP::SysWriteSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysWriteSelectionHandle.cxx:34