ATLAS Offline Software
Loading...
Searching...
No Matches
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
14
15//
16// method implementations
17//
18
19namespace CP {
20
21EventSelectionByObjectFlagAlg ::EventSelectionByObjectFlagAlg(
22 const std::string &name, ISvcLocator *pSvcLocator)
23 : AnaAlgorithm(name, pSvcLocator) {}
24
25StatusCode EventSelectionByObjectFlagAlg ::initialize() {
26
31 ANA_CHECK(m_systematicsList.initialize());
32
33 return StatusCode::SUCCESS;
34}
35
36StatusCode 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
64StatusCode EventSelectionByObjectFlagAlg ::finalize() {
65 ANA_CHECK (m_filterParams.finalize());
66 return StatusCode::SUCCESS;
67}
68
69} // namespace CP
#define ATH_MSG_VERBOSE(x)
#define ANA_CHECK(EXP)
check whether the given expression was successful
SysListHandle m_systematicsList
the systematics list we run
SysFilterReporterParams m_filterParams
the filter reporter
SysReadHandle< xAOD::IParticleContainer > m_particleHandle
the particle collection we run on
SysReadSelectionHandle m_preselection
the preselection we apply to our input
SysReadSelectionHandle m_veto
the preselection we apply to our input
a reporter class that combines the filter decisions for all systematics
a systematics aware filter reporter
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Class providing the definition of the 4-vector interface.
Select isolated Photons, Electrons and Muons.
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.