ATLAS Offline Software
Loading...
Searching...
No Matches
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
19namespace CP
20{
21
22 StatusCode EgammaIsolationSelectionAlg ::
23 initialize ()
24 {
25 ANA_CHECK (m_selectionTool.retrieve());
26
30 ANA_CHECK (m_systematicsList.initialize());
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
47 StatusCode EgammaIsolationSelectionAlg ::
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 {
56 if (m_preselection.getBool (*egamma, sys))
57 {
58 m_selectionHandle.setBits
60 } else {
61 m_selectionHandle.setBits (*egamma, m_setOnFail, sys);
62 }
63 }
64 }
65 return StatusCode::SUCCESS;
66 }
67}
#define ANA_CHECK(EXP)
check whether the given expression was successful
ToolHandle< IIsolationSelectionTool > m_selectionTool
the selection tool
ServiceHandle< ISelectionNameSvc > m_nameSvc
the ISelectionNameSvc
Gaudi::Property< bool > m_isPhoton
whether this is running on photons
SysReadHandle< xAOD::EgammaContainer > m_egammasHandle
the particle continer we run on
SysListHandle m_systematicsList
the systematics list we run
SysReadSelectionHandle m_preselection
the preselection we apply to our input
SelectionType m_setOnFail
the bits to set for an object failing the preselection
SysWriteSelectionHandle m_selectionHandle
the decoration for the asg selection
elec/gamma data class.
Definition egamma.h:58
Select isolated Photons, Electrons and Muons.
SelectionType selectionFromAccept(const asg::AcceptData &accept)
the selection decoration made from the given AcceptData object
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
EgammaContainer_v1 EgammaContainer
Definition of the current "egamma container version".