ATLAS Offline Software
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 
15  ATH_CHECK(m_vertexContainerKey.initialize());
16 
17  return StatusCode::SUCCESS;
18 }
19 
22  return StatusCode::SUCCESS;
23 }
24 
25 StatusCode OverlayVertexSkimmingAlg::execute(const EventContext& ctx) const {
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 }
FilterReporter
a guard class for use with ref FilterReporterParams
Definition: FilterReporter.h:35
OverlayVertexSkimmingAlg::initialize
virtual StatusCode initialize() override final
Definition: OverlayVertexSkimmingAlg.cxx:13
OverlayVertexSkimmingAlg::m_vertexContainerKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
Definition: OverlayVertexSkimmingAlg.h:25
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
OverlayVertexSkimmingAlg::OverlayVertexSkimmingAlg
OverlayVertexSkimmingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: OverlayVertexSkimmingAlg.cxx:9
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
OverlayVertexSkimmingAlg::finalize
virtual StatusCode finalize() override final
Definition: OverlayVertexSkimmingAlg.cxx:20
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
covarianceTool.filter
filter
Definition: covarianceTool.py:514
OverlayVertexSkimmingAlg.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FilterReporterParams::initialize
StatusCode initialize(bool enabled=true)
do anything we need to do in initialize
Definition: FilterReporterParams.cxx:24
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
FilterReporter.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
OverlayVertexSkimmingAlg::m_filterParams
FilterReporterParams m_filterParams
Definition: OverlayVertexSkimmingAlg.h:28
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
OverlayVertexSkimmingAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: OverlayVertexSkimmingAlg.cxx:25
FilterReporterParams::summary
std::string summary()
report the status of filtering
Definition: FilterReporterParams.cxx:60