ATLAS Offline Software
Loading...
Searching...
No Matches
HoughVtxFinderTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSVERTEXRECONSTRUCTION_HOUGHVTXFINDERTOOL_H
6#define ACTSVERTEXRECONSTRUCTION_HOUGHVTXFINDERTOOL_H
7
8
10#include "Gaudi/Property.h"
11#include "GaudiKernel/EventContext.h"
17
18#include "ActsInterop/Logger.h"
19#include "Acts/Definitions/Algebra.hpp"
20#include "Acts/Vertexing/HoughVertexFinder2.hpp"
21#include "Acts/EventData/SpacePointContainer2.hpp"
22
23#include <cmath>
24#include <memory> // unique_ptr
25#include <utility> // pair
26
27namespace ActsTrk {
28
29class HoughVtxFinderTool : public extends<AthAlgTool, InDet::IVertexFinder> {
30public:
31 virtual StatusCode initialize() override;
32
33 using base_class::base_class;
34
35 // no vertex finding with tracks
36 virtual std::pair<xAOD::VertexContainer *, xAOD::VertexAuxContainer *>
37 findVertex(const EventContext & /*ctx*/, const TrackCollection * /*trackTES*/) const override {
38 ATH_MSG_ERROR("Can't call HoughVtxFinderTool::findVertex(ctx, trackTES)");
39 return std::make_pair(nullptr, nullptr);
40 }
41 virtual std::pair<xAOD::VertexContainer *, xAOD::VertexAuxContainer *>
42 findVertex(const EventContext & /*ctx*/, const xAOD::TrackParticleContainer * /*trackParticles*/) const override {
43 ATH_MSG_ERROR("Can't call HoughVtxFinderTool::findVertex(ctx, trackParticles)");
44 return std::make_pair(nullptr, nullptr);
45 }
46
47 // vertex finding with spacepoints
48 std::pair<std::unique_ptr<xAOD::VertexContainer>, std::unique_ptr<xAOD::VertexAuxContainer>>
49 findVertex(const EventContext &ctx, const xAOD::SpacePointContainer &spacePointContainer) const;
50
51private:
53 std::unique_ptr<const Acts::Logger> m_logger{nullptr};
54 const Acts::Logger &logger() const { return *m_logger; }
55
56 using VertexFinder = Acts::HoughVertexFinder2;
57 VertexFinder::Config m_finderCfg;
58
59 SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
60
61 UnsignedIntegerProperty m_minSPs{this, "minSPs", 100, "Minimum amount of spacepoints to attempt vertex finding"};
62 BooleanProperty m_useBeamSpot{this, "useBeamSpot", true, "Use beam spot XY positions as the default vertex position"};
63
64 // Configuration variables
65 // For details check ACTS documentation
66 //
67 UnsignedIntegerProperty m_targetSPs{this, "targetSPs", 20000, "Ideal amount of spacepoints"};
68 DoubleProperty m_minAbsEta{this, "minAbsEta", 0.3, "Minimum range in |eta|"};
69 DoubleProperty m_maxAbsEta{this, "maxAbsEta", 4.0, "Maximum range in |eta|"};
70 UnsignedIntegerProperty m_minHits{this, "minHits", 4, "Minimum number of hits in Hough plane to consider the cell to contain a track"};
71 UnsignedIntegerProperty m_fillNeighbours{this, "fillNeighbours", 0, "Number of neighbouring bins in Hough plane to fill"};
72 // the two arrays below have to have the same size
73 DoubleArrayProperty m_absEtaRanges{this, "absEtaRanges", {2.0, 4.0}, "Upper threshold for eta ranges"};
74 DoubleArrayProperty m_absEtaFractions{this, "absEtaFractions", {0.4, 0.6}, "Amount of spacepoints in such eta ranges"};
75 // the three arrays below have to have the same size
76 DoubleArrayProperty m_rangeIterZ{this, "rangeIterZ", {200.0, 30.0, 16.0}, "Maximum vertex range to consider"};
77 UnsignedIntegerArrayProperty m_nBinsZIterZ{this, "nBinsZIterZ", {800, 180, 80}, "Number of bins in Z direction"};
78 UnsignedIntegerArrayProperty m_nBinsCotThetaIterZ{this, "nBinsCotThetaIterZ", {8000, 8000, 8000}, "Number of bins in cot(theta) direction"};
79 DoubleProperty m_binsCotThetaDecrease{this, "binsCotThetaDecrease", 1.35, "For every magnitude (in natural log) below targetSPs, the number of bins in cot(theta) will decrease by this factor"};
80 UnsignedIntegerProperty m_peakWidth{this, "peakWidth", 3, "Width of the peak when estimating vertex position"};
81 DoubleArrayProperty m_defVtxPosition{this, "defVtxPosition", {0.0, 0.0, 0.0}, "Default position of the vertex, might be overwritten by beamspot XY position"};
82};
83
84} // namespace ActsTrk
85
86#endif // ACTSVERTEXRECONSTRUCTION_HOUGHVTXFINDERTOOL_H
#define ATH_MSG_ERROR(x)
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
UnsignedIntegerProperty m_fillNeighbours
UnsignedIntegerProperty m_minSPs
std::unique_ptr< const Acts::Logger > m_logger
logging instance
virtual StatusCode initialize() override
DoubleArrayProperty m_defVtxPosition
DoubleArrayProperty m_absEtaRanges
UnsignedIntegerProperty m_targetSPs
virtual std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > findVertex(const EventContext &, const TrackCollection *) const override
Acts::HoughVertexFinder2 VertexFinder
UnsignedIntegerProperty m_minHits
VertexFinder::Config m_finderCfg
UnsignedIntegerArrayProperty m_nBinsCotThetaIterZ
DoubleArrayProperty m_absEtaFractions
const Acts::Logger & logger() const
UnsignedIntegerArrayProperty m_nBinsZIterZ
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
UnsignedIntegerProperty m_peakWidth
virtual std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > findVertex(const EventContext &, const xAOD::TrackParticleContainer *) const override
DoubleArrayProperty m_rangeIterZ
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
SpacePointContainer_v1 SpacePointContainer
Define the version of the space point container.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".