ATLAS Offline Software
Loading...
Searching...
No Matches
OverlayVertexSkimmingAlg.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
8
10 ISvcLocator* pSvcLocator)
11 : ::AthReentrantAlgorithm(name, pSvcLocator) {}
12
14 ATH_CHECK(m_filterParams.initialize());
15 ATH_CHECK(m_vertexContainerKey.initialize());
16
17 return StatusCode::SUCCESS;
18}
19
22 return StatusCode::SUCCESS;
23}
24
25StatusCode OverlayVertexSkimmingAlg::execute(const EventContext& ctx) const {
26 FilterReporter filter(m_filterParams, false, ctx);
27
29 if (!vertices.isValid()) {
30 ATH_MSG_ERROR("Couldn't retrieve xAOD::VertexContainer with key: "
32 return StatusCode::FAILURE;
33 }
34
35 for (const xAOD::Vertex* vx : *(vertices.cptr())) {
36 if (vx->vertexType() == xAOD::VxType::PriVtx) {
37 filter.setPassed(true);
38 ATH_MSG_VERBOSE("Found primary vertex, passing event");
39 break;
40 }
41 }
42
43 return StatusCode::SUCCESS;
44}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
An algorithm that can be simultaneously executed in multiple threads.
a guard class for use with ref FilterReporterParams
OverlayVertexSkimmingAlg(const std::string &name, ISvcLocator *pSvcLocator)
FilterReporterParams m_filterParams
virtual StatusCode execute(const EventContext &ctx) const override final
virtual StatusCode finalize() override final
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
virtual StatusCode initialize() override final
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
@ PriVtx
Primary vertex.
Vertex_v1 Vertex
Define the latest version of the vertex class.