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
16
17// Need to include this early; otherwise, we run into errors with
18// ReferenceWrapperAnyCompat in clang builds due the is_constructable
19// specialization defined there getting implicitly instantiated earlier.
20#include "Acts/Propagator/Propagator.hpp"
21#include "ActsInterop/Logger.h"
22
23// PACKAGE
28
29// ACTS
30#include "Acts/Propagator/EigenStepper.hpp"
31#include "Acts/Propagator/Propagator.hpp"
32#include "Acts/Propagator/Navigator.hpp"
33#include "Acts/Surfaces/PerigeeSurface.hpp"
34#include "Acts/Definitions/Units.hpp"
35#include "Acts/Utilities/Helpers.hpp"
36#include "Acts/Vertexing/IterativeVertexFinder.hpp"
37#include "Acts/Vertexing/FullBilloirVertexFitter.hpp"
38#include "Acts/Vertexing/HelicalTrackLinearizer.hpp"
39#include "Acts/Vertexing/TrackDensityVertexFinder.hpp"
40#include "Acts/Vertexing/TrackAtVertex.hpp"
41#include "Acts/Vertexing/Vertex.hpp"
42#include "Acts/Vertexing/ImpactPointEstimator.hpp"
43#include "Acts/Utilities/Logger.hpp"
44
46
47#include <cmath>
48#include <optional>
49
50namespace Acts {
51class Surface;
52class BoundaryCheck;
53}
54
55namespace ActsTrk {
56 class IterativePriVtxFinderTool : public extends<AthAlgTool, InDet::IVertexFinder>
57 {
58
59 // Track wrapper input for the Acts vertexing
61 public:
62 TrackWrapper(const Trk::ITrackLink* trkLink, const Acts::BoundTrackParameters& boundParams)
63 : m_trkLink(trkLink)
64 , m_boundParams(boundParams)
65 {}
66
67 const Acts::BoundTrackParameters& parameters() const {return m_boundParams;}
68
69 const Trk::ITrackLink* trackLink() const {return m_trkLink;}
70
71 static Acts::BoundTrackParameters extractParameters(const Acts::InputTrack& input) {
72 return input.template as<TrackWrapper>()->parameters();
73 }
74
75 private:
77 Acts::BoundTrackParameters m_boundParams;
78 };
79
80 public:
81 virtual StatusCode initialize() override;
82
86 using base_class::base_class;
87
88 virtual std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
89 findVertex(const EventContext& ctx, const TrackCollection* trackTES) const override;
90
91 virtual std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
92 findVertex(const EventContext& ctx, const xAOD::TrackParticleContainer* trackParticles) const override;
93
94 private:
98 std::unique_ptr<const Acts::Logger> m_logger {nullptr};
99 const Acts::Logger &logger() const { return *m_logger; }
100
101 std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
102 findVertex(const EventContext& ctx, const std::vector<std::unique_ptr<Trk::ITrackLink>>& trackVector) const;
103
105 const Acts::BoundTrackParameters& bound, const Acts::Vector3& surfCenter) const;
106
107 using Propagator = Acts::Propagator<Acts::EigenStepper<>, Acts::Navigator>;
108 using TrackLinearizer = Acts::HelicalTrackLinearizer;
109 using VertexFitter = Acts::FullBilloirVertexFitter;
110 using VertexSeedFinder = Acts::TrackDensityVertexFinder;
111 using VertexFinder = Acts::IterativeVertexFinder;
112
113 std::shared_ptr<VertexFinder> m_vertexFinder = nullptr;
114 std::shared_ptr<ATLASMagneticFieldWrapper> m_bField = nullptr;
115
116 std::shared_ptr<Propagator> m_propagator = nullptr;
117
118 // optional because of late initializatio
119 std::optional<TrackLinearizer> m_linearizer = std::nullopt;
120
121
122 ServiceHandle<ActsTrk::ITrackingGeometrySvc> m_trackingGeometrySvc{this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"};
123 ToolHandle<InDet::IInDetTrackSelectionTool> m_trkFilter{this, "TrackSelector", "", "InDetTrackSelectionTool"};
124 SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
125
126 // Configuration variables
127 // For details check ACTS documentation
128
129 // Full-Billoir Fitter config variables
130 UnsignedIntegerProperty m_fitterMaxIterations{this, "fitterMaxIterations", 5, "Vertex fitter max. iterations"};
131
132 // Iterative vertex Finder config variables
133 BooleanProperty m_useBeamConstraint{this, "useBeamConstraint", true, "Use beam constraint"};
134 DoubleProperty m_significanceCutSeeding{this, "significanceCutSeeding", 10, "Seeding Cut Significance"};
135 DoubleProperty m_maximumChi2cutForSeeding{this, "maximumChi2cutForSeeding", 36., "Max. Chi2 cut for seeding"};
136 UnsignedIntegerProperty m_maxVertices{this, "maxVertices", 50, "Max number of vertices"};
137 BooleanProperty m_createSplitVertices{this, "createSplitVertices", false, "Create split vertices or not"};
138 UnsignedIntegerProperty m_splitVerticesTrkInvFraction{this, "splitVerticesTrkInvFraction", 2, "Track Inv. fraction for split vertices"};
139 BooleanProperty m_reassignTracksAfterFirstFit{this, "reassignTracksAfterFirstFit", false, "Whether re-assign tracks after first vertex fit or not"};
140 BooleanProperty m_doMaxTracksCut{this, "doMaxTracksCut", false, "Whether use max. tracks cut or not"};
141 UnsignedIntegerProperty m_maxTracks{this, "maxTracks", 5000, "Max. number of tracks to use for vertex finding"};
142 DoubleProperty m_cutOffTrackWeight{this, "cutOffTrackWeight", 0.01, "Min. track weight allowed"};
143
144 // Gaussian seed finder variables
145 DoubleProperty m_gaussianMaxD0Significance{this, "gaussianMaxD0Significance", 3.5, "Gaussian seeder max d0 track significance"};
146 DoubleProperty m_gaussianMaxZ0Significance{this, "gaussianMaxDZSignificance", 12.0, "Gaussian seeder max z0 track significance"};
147
148 // IP Estimator config
149 UnsignedIntegerProperty m_ipEstMaxIterations{this, "ipEstMaxIterations", 20, "IpEstimator max. iterations"};
150 DoubleProperty m_ipEstPrecision{this, "ipEstPrecision", 1e-10, "IpEstimator precision"};
151
152 };
153}
154
155#endif // ACTSTRKPRIVTXFINDERTOOL_ITERATIVEPRIVTXFINDERTOOL_H
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Utility class to handle the three contexts neeeded in an ACTS reconstruction job 1) GeometryContext -...
const Acts::BoundTrackParameters & parameters() const
static Acts::BoundTrackParameters extractParameters(const Acts::InputTrack &input)
TrackWrapper(const Trk::ITrackLink *trkLink, const Acts::BoundTrackParameters &boundParams)
ContextUtility m_ctxProvider
Auxiliary class to access the magnetic field, geometry and calibration context.
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
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
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
Acts::FullBilloirVertexFitter VertexFitter
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".