ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
EgammaAnalysisAlgorithms
Root
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
13
#include <
EgammaAnalysisAlgorithms/EgammaIsolationSelectionAlg.h
>
14
15
//
16
// method implementations
17
//
18
19
namespace
CP
20
{
21
22
StatusCode EgammaIsolationSelectionAlg ::
23
initialize ()
24
{
25
ANA_CHECK
(
m_selectionTool
.retrieve());
26
27
ANA_CHECK
(
m_egammasHandle
.initialize (
m_systematicsList
));
28
ANA_CHECK
(
m_preselection
.initialize (
m_systematicsList
,
m_egammasHandle
,
SG::AllowEmpty
));
29
ANA_CHECK
(
m_selectionHandle
.initialize (
m_systematicsList
,
m_egammasHandle
));
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 (
const
EventContext& ctx)
49
{
50
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector())
51
{
52
const
xAOD::EgammaContainer
*egammas =
nullptr
;
53
ANA_CHECK
(
m_egammasHandle
.retrieve (egammas, sys, ctx));
54
for
(
const
xAOD::Egamma
*
egamma
: *egammas)
55
{
56
if
(
m_preselection
.getBool (*
egamma
, sys))
57
{
58
m_selectionHandle
.setBits
59
(*
egamma
,
selectionFromAccept
(
m_selectionTool
->accept (*
egamma
)), sys);
60
}
else
{
61
m_selectionHandle
.setBits (*
egamma
,
m_setOnFail
, sys);
62
}
63
}
64
}
65
return
StatusCode::SUCCESS;
66
}
67
}
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
EgammaIsolationSelectionAlg.h
CP::EgammaIsolationSelectionAlg::m_selectionTool
ToolHandle< IIsolationSelectionTool > m_selectionTool
the selection tool
Definition
EgammaIsolationSelectionAlg.h:39
CP::EgammaIsolationSelectionAlg::m_nameSvc
ServiceHandle< ISelectionNameSvc > m_nameSvc
the ISelectionNameSvc
Definition
EgammaIsolationSelectionAlg.h:62
CP::EgammaIsolationSelectionAlg::m_isPhoton
Gaudi::Property< bool > m_isPhoton
whether this is running on photons
Definition
EgammaIsolationSelectionAlg.h:66
CP::EgammaIsolationSelectionAlg::m_egammasHandle
SysReadHandle< xAOD::EgammaContainer > m_egammasHandle
the particle continer we run on
Definition
EgammaIsolationSelectionAlg.h:52
CP::EgammaIsolationSelectionAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
EgammaIsolationSelectionAlg.h:43
CP::EgammaIsolationSelectionAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition
EgammaIsolationSelectionAlg.h:47
CP::EgammaIsolationSelectionAlg::m_setOnFail
SelectionType m_setOnFail
the bits to set for an object failing the preselection
Definition
EgammaIsolationSelectionAlg.h:71
CP::EgammaIsolationSelectionAlg::m_selectionHandle
SysWriteSelectionHandle m_selectionHandle
the decoration for the asg selection
Definition
EgammaIsolationSelectionAlg.h:57
asg::AcceptData
Definition
AcceptData.h:31
egamma
elec/gamma data class.
Definition
egamma.h:59
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
CP::selectionFromAccept
SelectionType selectionFromAccept(const asg::AcceptData &accept)
the selection decoration made from the given AcceptData object
Definition
SelectionHelpers.cxx:32
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
xAOD::Egamma
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition
Egamma.h:17
xAOD::EgammaContainer
EgammaContainer_v1 EgammaContainer
Definition of the current "egamma container version".
Definition
EgammaContainer.h:17
Generated on
for ATLAS Offline Software by
1.17.0