ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
AsgAnalysisAlgorithms
Root
VGammaORAlg.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
#include "
AsgAnalysisAlgorithms/VGammaORAlg.h
"
8
#include <
AsgDataHandles/ReadHandle.h
>
9
#include <
AsgDataHandles/WriteDecorHandle.h
>
10
#include <
EventBookkeeperTools/FilterReporter.h
>
11
12
namespace
CP
{
13
14
StatusCode
VGammaORAlg::initialize
() {
15
16
ANA_CHECK
(
m_vgammaORTool
.retrieve());
17
ANA_CHECK
(
m_filterParams
.initialize());
18
ANA_CHECK
(
m_eventInfoKey
.initialize());
19
ANA_CHECK
(
m_inOverlapKey
.initialize());
20
21
return
StatusCode::SUCCESS;
22
}
23
24
StatusCode
VGammaORAlg::execute
(
const
EventContext& ctx)
const
{
25
26
FilterReporter
filter(
m_filterParams
,
m_noFilter
.value(), ctx);
27
28
SG::ReadHandle<xAOD::EventInfo>
evtInfo(
m_eventInfoKey
, ctx);
29
ANA_CHECK
(evtInfo.
isValid
());
30
31
bool
in_vgamma_overlap;
32
ANA_CHECK
(
m_vgammaORTool
->inOverlap(in_vgamma_overlap));
33
34
SG::WriteDecorHandle<xAOD::EventInfo, bool>
dec(
m_inOverlapKey
, ctx);
35
dec(*evtInfo) = in_vgamma_overlap;
36
37
if
(!
m_noFilter
.value()) {
38
if
(
m_keepOverlap
)
39
filter.setPassed( in_vgamma_overlap );
40
else
41
filter.setPassed( !in_vgamma_overlap );
42
}
43
44
return
StatusCode::SUCCESS;
45
}
46
47
StatusCode
VGammaORAlg::finalize
() {
48
49
ANA_MSG_INFO
(
m_filterParams
.summary());
50
return
StatusCode::SUCCESS;
51
}
52
}
// namespace
ReadHandle.h
Handle class for reading from StoreGate.
WriteDecorHandle.h
Handle class for adding a decoration to an object.
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg,...)
Macro printing info messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:291
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:325
FilterReporter.h
VGammaORAlg.h
CP::VGammaORAlg::m_vgammaORTool
ToolHandle< IVGammaORTool > m_vgammaORTool
the overlap removal tool
Definition
VGammaORAlg.h:32
CP::VGammaORAlg::m_noFilter
Gaudi::Property< bool > m_noFilter
whether to not apply an event filter
Definition
VGammaORAlg.h:52
CP::VGammaORAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
VGammaORAlg.cxx:24
CP::VGammaORAlg::finalize
virtual StatusCode finalize() override
Definition
VGammaORAlg.cxx:47
CP::VGammaORAlg::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
the event info key
Definition
VGammaORAlg.h:37
CP::VGammaORAlg::m_inOverlapKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_inOverlapKey
the decoration for the tool decision
Definition
VGammaORAlg.h:42
CP::VGammaORAlg::m_keepOverlap
Gaudi::Property< bool > m_keepOverlap
which way to run the event filter
Definition
VGammaORAlg.h:57
CP::VGammaORAlg::initialize
virtual StatusCode initialize() override
Definition
VGammaORAlg.cxx:14
CP::VGammaORAlg::m_filterParams
FilterReporterParams m_filterParams
the event filter for the tool decision
Definition
VGammaORAlg.h:47
FilterReporter
a guard class for use with ref FilterReporterParams
Definition
FilterReporter.h:35
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:66
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
Generated on
for ATLAS Offline Software by
1.17.0