ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
IsolationSelection
src
TestIsolationAthenaAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// $Id: TestIsolationAthenaAlg.cxx 672993 2015-06-06 16:55:34Z dzhang $
6
7
// Local include(s):
8
#include "
TestIsolationAthenaAlg.h
"
9
#include "
PATCore/AcceptData.h
"
10
#include "
PATCore/AcceptInfo.h
"
11
// EDM include(s):
12
#include "
xAODEgamma/ElectronContainer.h
"
13
#include "
xAODEgamma/PhotonContainer.h
"
14
#include "
xAODMuon/MuonContainer.h
"
15
16
// other include(s):
17
#include <cmath>
18
19
namespace
CP
{
20
21
TestIsolationAthenaAlg::TestIsolationAthenaAlg
(
const
std::string&
name
, ISvcLocator* svcLoc) :
22
AthAlgorithm
(
name
, svcLoc),
m_sgKeyPhotons
(
"Photons"
),
m_sgKeyElectrons
(
"Electrons"
),
m_sgKeyMuons
(
"Muons"
) {
23
declareProperty
(
"sgKeyPhotons"
,
m_sgKeyPhotons
);
24
declareProperty
(
"sgKeyElectrons"
,
m_sgKeyElectrons
);
25
declareProperty
(
"sgKeyMuons"
,
m_sgKeyMuons
);
26
declareProperty
(
"IsoTool"
,
m_isoTool
);
27
}
28
29
StatusCode
TestIsolationAthenaAlg::initialize
() {
30
ATH_CHECK
(
m_isoTool
.retrieve());
31
32
// Return gracefully:
33
return
StatusCode::SUCCESS;
34
}
35
36
StatusCode
TestIsolationAthenaAlg::execute
(
const
EventContext&
/*ctx*/
) {
37
const
xAOD::PhotonContainer
* photons(
nullptr
);
38
ATH_CHECK
(
evtStore
()->retrieve(photons,
m_sgKeyPhotons
));
39
for
(
auto
x
: *photons) {
40
if
(
x
->pt() > 7000.) {
41
if
(
x
->caloCluster() !=
nullptr
) {
42
if
(fabs(
x
->caloCluster()->eta()) < 2.47) {
43
if
(
m_isoTool
->accept(*
x
)) {
ATH_MSG_INFO
(
" Photon passes Isolation"
); }
44
}
45
}
46
}
47
}
48
49
const
xAOD::ElectronContainer
* electrons(
nullptr
);
50
ATH_CHECK
(
evtStore
()->retrieve(electrons,
m_sgKeyElectrons
));
51
for
(
auto
x
: *electrons) {
52
if
(
x
->pt() > 7000.) {
53
if
(
x
->caloCluster() !=
nullptr
) {
54
if
(fabs(
x
->caloCluster()->eta()) < 2.47) {
55
if
(
m_isoTool
->accept(*
x
)) {
ATH_MSG_INFO
(
" Electron passes Isolation"
); }
56
}
57
}
58
}
59
}
60
61
const
xAOD::MuonContainer
* muons(
nullptr
);
62
ATH_CHECK
(
evtStore
()->retrieve(muons,
m_sgKeyMuons
));
63
for
(
auto
x
: *muons) {
64
if
(
x
->pt() > 7000.) {
65
if
(fabs(
x
->eta()) < 2.5) {
66
if
(
m_isoTool
->accept(*
x
)) {
ATH_MSG_INFO
(
" Muon passes Isolation"
); }
67
}
68
}
69
}
70
71
// Return gracefully:
72
return
StatusCode::SUCCESS;
73
}
74
}
// namespace CP
AcceptData.h
AcceptInfo.h
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
ElectronContainer.h
PhotonContainer.h
MuonContainer.h
TestIsolationAthenaAlg.h
x
#define x
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
CP::TestIsolationAthenaAlg::m_isoTool
ToolHandle< CP::IIsolationSelectionTool > m_isoTool
Definition
TestIsolationAthenaAlg.h:32
CP::TestIsolationAthenaAlg::m_sgKeyMuons
std::string m_sgKeyMuons
Definition
TestIsolationAthenaAlg.h:31
CP::TestIsolationAthenaAlg::TestIsolationAthenaAlg
TestIsolationAthenaAlg(const std::string &name, ISvcLocator *svcLoc)
Definition
TestIsolationAthenaAlg.cxx:21
CP::TestIsolationAthenaAlg::m_sgKeyElectrons
std::string m_sgKeyElectrons
Definition
TestIsolationAthenaAlg.h:30
CP::TestIsolationAthenaAlg::m_sgKeyPhotons
std::string m_sgKeyPhotons
Definition
TestIsolationAthenaAlg.h:29
CP::TestIsolationAthenaAlg::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition
TestIsolationAthenaAlg.cxx:29
CP::TestIsolationAthenaAlg::execute
virtual StatusCode execute(const EventContext &ctx)
Function executing the algorithm.
Definition
TestIsolationAthenaAlg.cxx:36
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
xAOD::name
name
Definition
TriggerMenuJson_v1.cxx:29
xAOD::PhotonContainer
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/PhotonContainer.h:17
xAOD::ElectronContainer
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/ElectronContainer.h:17
xAOD::MuonContainer
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
Definition
Event/xAOD/xAODMuon/xAODMuon/MuonContainer.h:14
Generated on
for ATLAS Offline Software by
1.17.0