ATLAS Offline Software
Loading...
Searching...
No Matches
IterativePriVtxFinderTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSTRKPRIVTXFINDERTOOL_ITERATIVEPRIVTXFINDERTOOL_H
6#define ACTSTRKPRIVTXFINDERTOOL_ITERATIVEPRIVTXFINDERTOOL_H
7
8// ATHENA
10#include "GaudiKernel/IInterface.h"
11#include "GaudiKernel/ServiceHandle.h"
12#include "Gaudi/Property.h"
13#include "GaudiKernel/EventContext.h"
19
20// Need to include this early; otherwise, we run into errors with
21// ReferenceWrapperAnyCompat in clang builds due the is_constructable
22// specialization defined there getting implicitly instantiated earlier.
23#include "Acts/Propagator/Propagator.hpp"
24#include "ActsInterop/Logger.h"
25
26// PACKAGE
31
32// ACTS
33#include "Acts/Propagator/EigenStepper.hpp"
34#include "Acts/Propagator/Propagator.hpp"
35#include "Acts/Propagator/Navigator.hpp"
36#include "Acts/Surfaces/PerigeeSurface.hpp"
37#include "Acts/Definitions/Units.hpp"
38#include "Acts/Utilities/Helpers.hpp"
39#include "Acts/Vertexing/IterativeVertexFinder.hpp"
40#include "Acts/Vertexing/FullBilloirVertexFitter.hpp"
41#include "Acts/Vertexing/HelicalTrackLinearizer.hpp"
42#include "Acts/Vertexing/TrackDensityVertexFinder.hpp"
43#include "Acts/Vertexing/TrackAtVertex.hpp"
44#include "Acts/Vertexing/Vertex.hpp"
45#include "Acts/Vertexing/ImpactPointEstimator.hpp"
46#include "Acts/Utilities/Logger.hpp"
47
48
49#include <cmath>
50#include <optional>
51
52namespace Acts {
53class Surface;
54class BoundaryCheck;
55}
56
57namespace ActsTrk {
58 class IterativePriVtxFinderTool : public extends<AthAlgTool, InDet::IVertexFinder>
59 {
60
61 // Track wrapper input for the Acts vertexing
63 public:
64 TrackWrapper(const Trk::ITrackLink* trkLink, const Acts::BoundTrackParameters& boundParams)
65 : m_trkLink(trkLink)
66 , m_boundParams(boundParams)
67 {}
68
69 const Acts::BoundTrackParameters& parameters() const {return m_boundParams;}
70
71 const Trk::ITrackLink* trackLink() const {return m_trkLink;}
72
73 static Acts::BoundTrackParameters extractParameters(const Acts::InputTrack& input) {
74 return input.template as<TrackWrapper>()->parameters();
75 }
76
77 private:
79 Acts::BoundTrackParameters m_boundParams;
80 };
81
82 public:
83 virtual StatusCode initialize() override;
84
88 IterativePriVtxFinderTool(const std::string& type,
89 const std::string& name,
90 const IInterface* parent);
91
92 virtual std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
93 findVertex(const EventContext& ctx, const TrackCollection* trackTES) const override;
94
95 virtual std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
96 findVertex(const EventContext& ctx, const xAOD::TrackParticleContainer* trackParticles) const override;
97
98 private:
99
101 std::unique_ptr<const Acts::Logger> m_logger {nullptr};
102 const Acts::Logger &logger() const { return *m_logger; }
103
104 std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
105 findVertex(const EventContext& ctx, const std::vector<std::unique_ptr<Trk::ITrackLink>>& trackVector) const;
106
108 const Acts::BoundTrackParameters& bound, const Acts::Vector3& surfCenter) const;
109
110 virtual
113 {
114 return m_trackingGeometryTool.get();
115 }
116
117 using Propagator = Acts::Propagator<Acts::EigenStepper<>, Acts::Navigator>;
118 using TrackLinearizer = Acts::HelicalTrackLinearizer;
119 using VertexFitter = Acts::FullBilloirVertexFitter;
120 using VertexSeedFinder = Acts::TrackDensityVertexFinder;
121 using VertexFinder = Acts::IterativeVertexFinder;
122
123 std::shared_ptr<VertexFinder> m_vertexFinder = nullptr;
124 std::shared_ptr<ATLASMagneticFieldWrapper> m_bField = nullptr;
125
126 std::shared_ptr<Propagator> m_propagator = nullptr;
127
128 // optional because of late initializatio
129 std::optional<TrackLinearizer> m_linearizer = std::nullopt;
130
131 PublicToolHandle<ITrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", "", "ActsTrackingGeometryTool"};
132 ToolHandle<IExtrapolationTool> m_extrapolationTool{this, "ExtrapolationTool", "", "ActsExtrapolationTool"};
133 ToolHandle<InDet::IInDetTrackSelectionTool> m_trkFilter{this, "TrackSelector", "", "InDetTrackSelectionTool"};
134 SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
135
136 // Configuration variables
137 // For details check ACTS documentation
138
139 // Full-Billoir Fitter config variables
140 UnsignedIntegerProperty m_fitterMaxIterations{this, "fitterMaxIterations", 5, "Vertex fitter max. iterations"};
141
142 // Iterative vertex Finder config variables
143 BooleanProperty m_useBeamConstraint{this, "useBeamConstraint", true, "Use beam constraint"};
144 DoubleProperty m_significanceCutSeeding{this, "significanceCutSeeding", 10, "Seeding Cut Significance"};
145 DoubleProperty m_maximumChi2cutForSeeding{this, "maximumChi2cutForSeeding", 36., "Max. Chi2 cut for seeding"};
146 UnsignedIntegerProperty m_maxVertices{this, "maxVertices", 50, "Max number of vertices"};
147 BooleanProperty m_createSplitVertices{this, "createSplitVertices", false, "Create split vertices or not"};
148 UnsignedIntegerProperty m_splitVerticesTrkInvFraction{this, "splitVerticesTrkInvFraction", 2, "Track Inv. fraction for split vertices"};
149 BooleanProperty m_reassignTracksAfterFirstFit{this, "reassignTracksAfterFirstFit", false, "Whether re-assign tracks after first vertex fit or not"};
150 BooleanProperty m_doMaxTracksCut{this, "doMaxTracksCut", false, "Whether use max. tracks cut or not"};
151 UnsignedIntegerProperty m_maxTracks{this, "maxTracks", 5000, "Max. number of tracks to use for vertex finding"};
152 DoubleProperty m_cutOffTrackWeight{this, "cutOffTrackWeight", 0.01, "Min. track weight allowed"};
153
154 // Gaussian seed finder variables
155 DoubleProperty m_gaussianMaxD0Significance{this, "gaussianMaxD0Significance", 3.5, "Gaussian seeder max d0 track significance"};
156 DoubleProperty m_gaussianMaxZ0Significance{this, "gaussianMaxDZSignificance", 12.0, "Gaussian seeder max z0 track significance"};
157
158 // IP Estimator config
159 UnsignedIntegerProperty m_ipEstMaxIterations{this, "ipEstMaxIterations", 20, "IpEstimator max. iterations"};
160 DoubleProperty m_ipEstPrecision{this, "ipEstPrecision", 1e-10, "IpEstimator precision"};
161
162 };
163}
164
165#endif // ACTSTRKPRIVTXFINDERTOOL_ITERATIVEPRIVTXFINDERTOOL_H
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Geometry helper tool extending the Tracking geometry service by the data dependency to fetch the geom...
const Acts::BoundTrackParameters & parameters() const
static Acts::BoundTrackParameters extractParameters(const Acts::InputTrack &input)
TrackWrapper(const Trk::ITrackLink *trkLink, const Acts::BoundTrackParameters &boundParams)
IterativePriVtxFinderTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
std::shared_ptr< Propagator > m_propagator
Acts::Propagator< Acts::EigenStepper<>, Acts::Navigator > Propagator
virtual std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > findVertex(const EventContext &ctx, const TrackCollection *trackTES) const override
PublicToolHandle< ITrackingGeometryTool > m_trackingGeometryTool
Acts::TrackDensityVertexFinder VertexSeedFinder
std::optional< TrackLinearizer > m_linearizer
std::unique_ptr< const Acts::Logger > m_logger
logging instance
Trk::Perigee * actsBoundToTrkPerigee(const Acts::BoundTrackParameters &bound, const Acts::Vector3 &surfCenter) const
std::shared_ptr< ATLASMagneticFieldWrapper > m_bField
std::shared_ptr< VertexFinder > m_vertexFinder
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkFilter
UnsignedIntegerProperty m_splitVerticesTrkInvFraction
Acts::HelicalTrackLinearizer TrackLinearizer
virtual const ActsTrk::ITrackingGeometryTool * trackingGeometryTool() const
Acts::FullBilloirVertexFitter VertexFitter
ToolHandle< IExtrapolationTool > m_extrapolationTool
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".