ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
AsgAnalysisAlgorithms
Root
EventSelectionByObjectFlagAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
//
8
// includes
9
//
10
11
#include <
AsgAnalysisAlgorithms/EventSelectionByObjectFlagAlg.h
>
12
#include <
SystematicsHandles/SysFilterReporter.h
>
13
#include <
SystematicsHandles/SysFilterReporterCombiner.h
>
14
15
//
16
// method implementations
17
//
18
19
namespace
CP
{
20
21
EventSelectionByObjectFlagAlg ::EventSelectionByObjectFlagAlg(
22
const
std::string &
name
, ISvcLocator *pSvcLocator)
23
:
AnaAlgorithm
(
name
, pSvcLocator) {}
24
25
StatusCode EventSelectionByObjectFlagAlg ::initialize() {
26
27
ANA_CHECK
(
m_particleHandle
.initialize (
m_systematicsList
));
28
ANA_CHECK
(
m_preselection
.initialize (
m_systematicsList
,
m_particleHandle
,
SG::AllowEmpty
));
29
ANA_CHECK
(
m_veto
.initialize (
m_systematicsList
,
m_particleHandle
));
30
ANA_CHECK
(
m_filterParams
.initialize(
m_systematicsList
));
31
ANA_CHECK
(
m_systematicsList
.initialize());
32
33
return
StatusCode::SUCCESS;
34
}
35
36
StatusCode EventSelectionByObjectFlagAlg ::execute() {
37
38
SysFilterReporterCombiner
filterCombiner (
m_filterParams
,
true
);
39
40
// loop over systematics
41
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector())
42
{
43
SysFilterReporter
filter (filterCombiner, sys);
44
45
// particle container
46
const
xAOD::IParticleContainer
*particles =
nullptr
;
47
ANA_CHECK
(
m_particleHandle
.retrieve(particles, sys));
48
49
// reject events with any particle passing the input selection
50
for
(
const
xAOD::IParticle
*particle : *particles) {
51
if
(
m_preselection
.getBool(*particle, sys)) {
52
if
(
m_veto
.getBool (*particle, sys)) {
53
ATH_MSG_VERBOSE
(
"Event failed."
);
54
filter.setPassed (
false
);
55
break
;
56
}
57
}
58
}
59
}
60
61
return
StatusCode::SUCCESS;
62
}
63
64
StatusCode EventSelectionByObjectFlagAlg ::finalize() {
65
ANA_CHECK
(
m_filterParams
.finalize());
66
return
StatusCode::SUCCESS;
67
}
68
69
}
// namespace CP
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
EventSelectionByObjectFlagAlg.h
SysFilterReporterCombiner.h
SysFilterReporter.h
CP::EventSelectionByObjectFlagAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
EventSelectionByObjectFlagAlg.h:38
CP::EventSelectionByObjectFlagAlg::m_filterParams
SysFilterReporterParams m_filterParams
the filter reporter
Definition
EventSelectionByObjectFlagAlg.h:42
CP::EventSelectionByObjectFlagAlg::m_particleHandle
SysReadHandle< xAOD::IParticleContainer > m_particleHandle
the particle collection we run on
Definition
EventSelectionByObjectFlagAlg.h:46
CP::EventSelectionByObjectFlagAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition
EventSelectionByObjectFlagAlg.h:51
CP::EventSelectionByObjectFlagAlg::m_veto
SysReadSelectionHandle m_veto
the preselection we apply to our input
Definition
EventSelectionByObjectFlagAlg.h:55
CP::SysFilterReporterCombiner
a reporter class that combines the filter decisions for all systematics
Definition
SysFilterReporterCombiner.h:34
CP::SysFilterReporter
a systematics aware filter reporter
Definition
SysFilterReporter.h:44
EL::AnaAlgorithm::AnaAlgorithm
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Definition
AnaAlgorithm.cxx:40
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
xAOD::name
name
Definition
TriggerMenuJson_v1.cxx:29
xAOD::IParticleContainer
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
Definition
xAOD/xAODBase/xAODBase/IParticleContainer.h:32
Generated on
for ATLAS Offline Software by
1.14.0