ATLAS Offline Software
Loading...
Searching...
No Matches
EgammaIsolationSelectionAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8
9//
10// includes
11//
12
14#include "PATCore/AcceptData.h"
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 const asg::AcceptInfo& acceptInfo = m_isPhoton.value() ? m_selectionTool->getPhotonAcceptInfo() : m_selectionTool->getElectronAcceptInfo();
33
34 if (!m_nameSvc.empty())
35 {
36 ANA_CHECK (m_nameSvc.retrieve());
37 ANA_CHECK (m_nameSvc->addAcceptInfo (m_egammasHandle.getNamePattern(), m_selectionHandle.getLabel(), acceptInfo));
38 }
39
40 asg::AcceptData blankAccept {&acceptInfo};
41 m_setOnFail = selectionFromAccept(blankAccept);
42
43 return StatusCode::SUCCESS;
44 }
45
46
47
48 StatusCode EgammaIsolationSelectionAlg ::
49 execute (const EventContext& ctx)
50 {
51 for (const auto& sys : m_systematicsList.systematicsVector())
52 {
53 const xAOD::EgammaContainer *egammas = nullptr;
54 ANA_CHECK (m_egammasHandle.retrieve (egammas, sys, ctx));
55 for (const xAOD::Egamma *egamma : *egammas)
56 {
57 if (m_preselection.getBool (*egamma, sys))
58 {
59 m_selectionHandle.setBits
61 } else {
62 m_selectionHandle.setBits (*egamma, m_setOnFail, sys);
63 }
64 }
65 }
66 return StatusCode::SUCCESS;
67 }
68}
#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:59
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".