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-2017 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
10
// EDM include(s):
11
#include "
xAODEgamma/ElectronContainer.h
"
12
#include "
xAODEgamma/PhotonContainer.h
"
13
#include "
xAODMuon/MuonContainer.h
"
14
15
// other include(s):
16
#include <cmath>
17
18
namespace
CP
{
19
20
TestIsolationAthenaAlg::TestIsolationAthenaAlg
(
const
std::string&
name
, ISvcLocator* svcLoc) :
21
AthAlgorithm
(
name
, svcLoc),
m_sgKeyPhotons
(
"Photons"
),
m_sgKeyElectrons
(
"Electrons"
),
m_sgKeyMuons
(
"Muons"
) {
22
declareProperty
(
"sgKeyPhotons"
,
m_sgKeyPhotons
);
23
declareProperty
(
"sgKeyElectrons"
,
m_sgKeyElectrons
);
24
declareProperty
(
"sgKeyMuons"
,
m_sgKeyMuons
);
25
declareProperty
(
"IsoTool"
,
m_isoTool
);
26
}
27
28
StatusCode
TestIsolationAthenaAlg::initialize
() {
29
ATH_CHECK
(
m_isoTool
.retrieve());
30
31
// Return gracefully:
32
return
StatusCode::SUCCESS;
33
}
34
35
StatusCode
TestIsolationAthenaAlg::execute
(
const
EventContext&
/*ctx*/
) {
36
const
xAOD::PhotonContainer
* photons(
nullptr
);
37
ATH_CHECK
(
evtStore
()->retrieve(photons,
m_sgKeyPhotons
));
38
for
(
auto
x
: *photons) {
39
if
(
x
->pt() > 7000.) {
40
if
(
x
->caloCluster() !=
nullptr
) {
41
if
(fabs(
x
->caloCluster()->eta()) < 2.47) {
42
if
(
m_isoTool
->accept(*
x
)) {
ATH_MSG_INFO
(
" Photon passes Isolation"
); }
43
}
44
}
45
}
46
}
47
48
const
xAOD::ElectronContainer
* electrons(
nullptr
);
49
ATH_CHECK
(
evtStore
()->retrieve(electrons,
m_sgKeyElectrons
));
50
for
(
auto
x
: *electrons) {
51
if
(
x
->pt() > 7000.) {
52
if
(
x
->caloCluster() !=
nullptr
) {
53
if
(fabs(
x
->caloCluster()->eta()) < 2.47) {
54
if
(
m_isoTool
->accept(*
x
)) {
ATH_MSG_INFO
(
" Electron passes Isolation"
); }
55
}
56
}
57
}
58
}
59
60
const
xAOD::MuonContainer
* muons(
nullptr
);
61
ATH_CHECK
(
evtStore
()->retrieve(muons,
m_sgKeyMuons
));
62
for
(
auto
x
: *muons) {
63
if
(
x
->pt() > 7000.) {
64
if
(fabs(
x
->eta()) < 2.5) {
65
if
(
m_isoTool
->accept(*
x
)) {
ATH_MSG_INFO
(
" Muon passes Isolation"
); }
66
}
67
}
68
}
69
70
// Return gracefully:
71
return
StatusCode::SUCCESS;
72
}
73
}
// namespace CP
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:31
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:20
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:28
CP::TestIsolationAthenaAlg::execute
virtual StatusCode execute(const EventContext &ctx)
Function executing the algorithm.
Definition
TestIsolationAthenaAlg.cxx:35
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