ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::IterativePriVtxFinderTool Class Reference

#include <IterativePriVtxFinderTool.h>

Inheritance diagram for ActsTrk::IterativePriVtxFinderTool:
Collaboration diagram for ActsTrk::IterativePriVtxFinderTool:

Classes

class  TrackWrapper

Public Member Functions

virtual StatusCode initialize () override
 IterativePriVtxFinderTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor.
virtual std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > findVertex (const EventContext &ctx, const TrackCollection *trackTES) const override
virtual std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > findVertex (const EventContext &ctx, const xAOD::TrackParticleContainer *trackParticles) const override

Private Types

using Propagator = Acts::Propagator<Acts::EigenStepper<>, Acts::Navigator>
using TrackLinearizer = Acts::HelicalTrackLinearizer
using VertexFitter = Acts::FullBilloirVertexFitter
using VertexSeedFinder = Acts::TrackDensityVertexFinder
using VertexFinder = Acts::IterativeVertexFinder

Private Member Functions

const Acts::Logger & logger () const
std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > findVertex (const EventContext &ctx, const std::vector< std::unique_ptr< Trk::ITrackLink > > &trackVector) const
Trk::PerigeeactsBoundToTrkPerigee (const Acts::BoundTrackParameters &bound, const Acts::Vector3 &surfCenter) const
virtual const ActsTrk::ITrackingGeometryTooltrackingGeometryTool () const

Private Attributes

std::unique_ptr< const Acts::Logger > m_logger {nullptr}
 logging instance
std::shared_ptr< VertexFinderm_vertexFinder = nullptr
std::shared_ptr< ATLASMagneticFieldWrapperm_bField = nullptr
std::shared_ptr< Propagatorm_propagator = nullptr
std::optional< TrackLinearizerm_linearizer = std::nullopt
PublicToolHandle< ITrackingGeometryToolm_trackingGeometryTool {this, "TrackingGeometryTool", "", "ActsTrackingGeometryTool"}
ToolHandle< IExtrapolationToolm_extrapolationTool {this, "ExtrapolationTool", "", "ActsExtrapolationTool"}
ToolHandle< InDet::IInDetTrackSelectionToolm_trkFilter {this, "TrackSelector", "", "InDetTrackSelectionTool"}
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"}
UnsignedIntegerProperty m_fitterMaxIterations {this, "fitterMaxIterations", 5, "Vertex fitter max. iterations"}
BooleanProperty m_useBeamConstraint {this, "useBeamConstraint", true, "Use beam constraint"}
DoubleProperty m_significanceCutSeeding {this, "significanceCutSeeding", 10, "Seeding Cut Significance"}
DoubleProperty m_maximumChi2cutForSeeding {this, "maximumChi2cutForSeeding", 36., "Max. Chi2 cut for seeding"}
UnsignedIntegerProperty m_maxVertices {this, "maxVertices", 50, "Max number of vertices"}
BooleanProperty m_createSplitVertices {this, "createSplitVertices", false, "Create split vertices or not"}
UnsignedIntegerProperty m_splitVerticesTrkInvFraction {this, "splitVerticesTrkInvFraction", 2, "Track Inv. fraction for split vertices"}
BooleanProperty m_reassignTracksAfterFirstFit {this, "reassignTracksAfterFirstFit", false, "Whether re-assign tracks after first vertex fit or not"}
BooleanProperty m_doMaxTracksCut {this, "doMaxTracksCut", false, "Whether use max. tracks cut or not"}
UnsignedIntegerProperty m_maxTracks {this, "maxTracks", 5000, "Max. number of tracks to use for vertex finding"}
DoubleProperty m_cutOffTrackWeight {this, "cutOffTrackWeight", 0.01, "Min. track weight allowed"}
DoubleProperty m_gaussianMaxD0Significance {this, "gaussianMaxD0Significance", 3.5, "Gaussian seeder max d0 track significance"}
DoubleProperty m_gaussianMaxZ0Significance {this, "gaussianMaxDZSignificance", 12.0, "Gaussian seeder max z0 track significance"}
UnsignedIntegerProperty m_ipEstMaxIterations {this, "ipEstMaxIterations", 20, "IpEstimator max. iterations"}
DoubleProperty m_ipEstPrecision {this, "ipEstPrecision", 1e-10, "IpEstimator precision"}

Detailed Description

Definition at line 58 of file IterativePriVtxFinderTool.h.

Member Typedef Documentation

◆ Propagator

using ActsTrk::IterativePriVtxFinderTool::Propagator = Acts::Propagator<Acts::EigenStepper<>, Acts::Navigator>
private

Definition at line 117 of file IterativePriVtxFinderTool.h.

◆ TrackLinearizer

using ActsTrk::IterativePriVtxFinderTool::TrackLinearizer = Acts::HelicalTrackLinearizer
private

Definition at line 118 of file IterativePriVtxFinderTool.h.

◆ VertexFinder

using ActsTrk::IterativePriVtxFinderTool::VertexFinder = Acts::IterativeVertexFinder
private

Definition at line 121 of file IterativePriVtxFinderTool.h.

◆ VertexFitter

using ActsTrk::IterativePriVtxFinderTool::VertexFitter = Acts::FullBilloirVertexFitter
private

Definition at line 119 of file IterativePriVtxFinderTool.h.

◆ VertexSeedFinder

using ActsTrk::IterativePriVtxFinderTool::VertexSeedFinder = Acts::TrackDensityVertexFinder
private

Definition at line 120 of file IterativePriVtxFinderTool.h.

Constructor & Destructor Documentation

◆ IterativePriVtxFinderTool()

ActsTrk::IterativePriVtxFinderTool::IterativePriVtxFinderTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Constructor.

Definition at line 39 of file IterativePriVtxFinderTool.cxx.

42 : base_class(type, name, parent)
43{}

Member Function Documentation

◆ actsBoundToTrkPerigee()

Trk::Perigee * ActsTrk::IterativePriVtxFinderTool::actsBoundToTrkPerigee ( const Acts::BoundTrackParameters & bound,
const Acts::Vector3 & surfCenter ) const
private

Definition at line 399 of file IterativePriVtxFinderTool.cxx.

400 {
401 using namespace Acts::UnitLiterals;
402 AmgSymMatrix(5) cov = AmgSymMatrix(5)(bound.covariance()->block<5,5>(0,0));
403 cov.col(Trk::qOverP) *= 1_MeV;
404 cov.row(Trk::qOverP) *= 1_MeV;
405 Acts::Vector<5> params = bound.parameters().head<5>();
406 params[Trk::qOverP] *= 1_MeV;
407
408 return new Trk::Perigee(params, Trk::PerigeeSurface(surfCenter), std::move(cov));
409}
#define AmgSymMatrix(dim)
std::string head(std::string s, const std::string &pattern)
head of a string

◆ findVertex() [1/3]

std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > ActsTrk::IterativePriVtxFinderTool::findVertex ( const EventContext & ctx,
const std::vector< std::unique_ptr< Trk::ITrackLink > > & trackVector ) const
private

Definition at line 201 of file IterativePriVtxFinderTool.cxx.

203{
204
205 using namespace Acts::UnitLiterals;
206
207 // Vertex finding algorithm begins
208 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx};
209
210 // The output vertex containers
211 xAOD::VertexContainer* theVertexContainer = new xAOD::VertexContainer;
212 xAOD::VertexAuxContainer* theVertexAuxContainer = new xAOD::VertexAuxContainer;
213 theVertexContainer->setStore(theVertexAuxContainer);
214
215 // bail out early with only Dummy vertex if multiplicity cut is applied and exceeded
216 if((m_doMaxTracksCut && (trackVector.size() > m_maxTracks)) || trackVector.empty()) {
217 ATH_MSG_WARNING(trackVector.size()
218 << " tracks - exceeds maximum (" << m_maxTracks
219 << "), skipping vertexing and returning only dummy...");
220 xAOD::Vertex* dummyxAODVertex = new xAOD::Vertex;
221 theVertexContainer->push_back(
222 dummyxAODVertex); // have to add vertex to container here first so it can use its aux store
223 dummyxAODVertex->setPosition(beamSpotHandle->beamVtx().position());
224 dummyxAODVertex->setCovariancePosition(
225 beamSpotHandle->beamVtx().covariancePosition());
226 dummyxAODVertex->vxTrackAtVertex() = std::vector<Trk::VxTrackAtVertex>();
227 dummyxAODVertex->setVertexType(xAOD::VxType::NoVtx);
228 return std::make_pair(theVertexContainer, theVertexAuxContainer);
229 }
230
231 const Acts::Vector3& beamSpotPos = beamSpotHandle->beamVtx().position();
232 Acts::Vertex beamSpotConstraintVtx(beamSpotPos);
233 beamSpotConstraintVtx.setCovariance(beamSpotHandle->beamVtx().covariancePosition());
234
235 std::shared_ptr<Acts::PerigeeSurface> perigeeSurface =
236 Acts::Surface::makeShared<Acts::PerigeeSurface>((trackVector[0])->parameters()->associatedSurface().transform());
237
238 // Get the magnetic field context
239 Acts::MagneticFieldContext magFieldContext = m_extrapolationTool->getMagneticFieldContext(ctx);
240
241 const auto& geoContext
242 = m_trackingGeometryTool->getGeometryContext(ctx).context();
243
244 // Convert tracks to Acts::BoundParameters
245 std::vector<TrackWrapper> allTracks;
246
247 for (const auto& trk : trackVector) {
248
249 const auto& trkParams = trk->parameters();
250 const auto& params = trkParams->parameters();
251
252 Acts::BoundVector actsParams;
253 actsParams << params(0), params(1), params(2), params(3), params(4)*1./(1_MeV), 0.;
254
255 if(trkParams->covariance() == nullptr){
256 continue;
257 }
258 auto cov = *(trkParams->covariance());
259
260 // TODO: check if the following works as well:
261 // cov->col(4) *= 1./1_MeV;
262 // cov->row(4) *= 1./1_MeV;
263 Acts::BoundMatrix covMat;
264 covMat << cov(0,0) , cov(0,1) , cov(0,2) , cov(0,3) , cov(0,4) *1./(1_MeV), 0
265 , cov(1,0) , cov(1,1) , cov(1,2) , cov(1,3) , cov(1,4) *1./(1_MeV) , 0
266 , cov(2,0) , cov(2,1) , cov(2,2) , cov(2,3) , cov(2,4) *1./(1_MeV) , 0
267 , cov(3,0) , cov(3,1) , cov(3,2) , cov(3,3) , cov(3,4) *1./(1_MeV) , 0
268 , cov(4,0) *1./(1_MeV) , cov(4,1) *1./(1_MeV) , cov(4,2) *1./(1_MeV) , cov(4,3) *1./(1_MeV) , cov(4,4) *1./(1_MeV*1_MeV), 0
269 , 0. , 0. , 0. , 0., 0., 1.;
270
271 allTracks.emplace_back(trk.get(),Acts::BoundTrackParameters(perigeeSurface, actsParams, covMat, Acts::ParticleHypothesis::pion()));
272 }
273
274 std::vector<Acts::InputTrack> allTrackPtrs;
275 allTrackPtrs.reserve(allTracks.size());
276
277for(const auto& trk : allTracks){
278 allTrackPtrs.emplace_back(&trk);
279 }
280
281 Acts::VertexingOptions vertexingOptions(geoContext,
282 magFieldContext);
283
285 beamSpotConstraintVtx.setPosition(Acts::Vector3::Zero());
286 beamSpotConstraintVtx.setCovariance(Acts::SquareMatrix<3>::Zero());
287 }
288 vertexingOptions.useConstraintInFit = m_useBeamConstraint;
289
290 //Adding 4th dimensional timing info to vertex constraint as needed by ACTS
291 Acts::Vector4 vtxConstraintPos;
292 Acts::SquareMatrix4 vtxConstraintCov;
293
294 auto beamSpotCov = beamSpotHandle->beamVtx().covariancePosition();
295
296 vtxConstraintPos << beamSpotPos(0), beamSpotPos(1), beamSpotPos(2), 0.;
297 vtxConstraintCov << beamSpotCov(0,0), beamSpotCov(0,1), beamSpotCov(0,2), 0.
298 , beamSpotCov(1,0), beamSpotCov(1,1), beamSpotCov(1,2), 0.
299 , beamSpotCov(2,0), beamSpotCov(2,1), beamSpotCov(2,2), 0.
300 , 0., 0., 0., 1.;
301
302 vertexingOptions.constraint.setFullPosition(vtxConstraintPos);
303 vertexingOptions.constraint.setFullCovariance(vtxConstraintCov);
304
305 auto finderState = m_vertexFinder->makeState(magFieldContext);
306
307 auto findResult = m_vertexFinder->find(allTrackPtrs, vertexingOptions, finderState);
308
309 if(!findResult.ok()){
310 xAOD::Vertex* dummyxAODVertex = new xAOD::Vertex;
311 theVertexContainer->push_back(dummyxAODVertex);
312 dummyxAODVertex->setPosition(beamSpotHandle->beamVtx().position());
313 dummyxAODVertex->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
314 dummyxAODVertex->vxTrackAtVertex() = std::vector<Trk::VxTrackAtVertex>();
315 dummyxAODVertex->setVertexType(xAOD::VxType::NoVtx);
316
317 return std::make_pair(theVertexContainer, theVertexAuxContainer);
318 }
319
320 std::vector<Acts::Vertex> allVertices = *findResult;
321
322 for(const auto& vtx : allVertices){
323 xAOD::Vertex* xAODVtx = new xAOD::Vertex;
324 xAODVtx->makePrivateStore();
325 xAODVtx->setPosition(vtx.position());
326 xAODVtx->setCovariancePosition(vtx.covariance());
327 xAODVtx->setFitQuality(vtx.fitQuality().first, vtx.fitQuality().second);
328
329 const auto& tracks = vtx.tracks();
330 std::vector<Trk::VxTrackAtVertex>* trkAtVtxVec = &(xAODVtx->vxTrackAtVertex());
331 for(const auto& trk : tracks){
332
333 Trk::Perigee* fittedPerigee = actsBoundToTrkPerigee(trk.fittedParams, beamSpotPos);
334 //Trk::Perigee* originalPerigee = actsBoundToTrkPerigee((trk.originalParams)->parameters(), beamSpotPos);
335 const TrackWrapper* originalParams = trk.originalParams.template as<TrackWrapper>();
336
337 //Trk::VxTrackAtVertex trkAtVtx(trk.chi2Track, fittedPerigee, originalPerigee);
338 Trk::VxTrackAtVertex trkAtVtx(originalParams->trackLink()->clone());
339 trkAtVtx.setPerigeeAtVertex(fittedPerigee);
340 trkAtVtx.setTrackQuality(Trk::FitQuality(trk.chi2Track, trk.ndf));
341 trkAtVtx.setVtxCompatibility(trk.vertexCompatibility);
342 trkAtVtx.setWeight(trk.trackWeight);
343 trkAtVtxVec->push_back(trkAtVtx);
344
345 const Trk::LinkToXAODTrackParticle* linkToXAODTP =
346 dynamic_cast<const Trk::LinkToXAODTrackParticle*>(originalParams->trackLink());
347 if (linkToXAODTP) {
348 xAODVtx->addTrackAtVertex(*linkToXAODTP, trk.trackWeight);
349 }
350 }
351
352 theVertexContainer->push_back(xAODVtx);
353 }
354
356 if (!theVertexContainer->empty()) {
357 xAOD::Vertex* primaryVtx = theVertexContainer->front();
358 if (!primaryVtx->vxTrackAtVertex().empty()) {
360 xAOD::Vertex* dummyxAODVertex = new xAOD::Vertex;
361 theVertexContainer->push_back(dummyxAODVertex);
362 dummyxAODVertex->setPosition(primaryVtx->position());
363 dummyxAODVertex->setCovariancePosition(primaryVtx->covariancePosition());
364 dummyxAODVertex->vxTrackAtVertex() = std::vector<Trk::VxTrackAtVertex>();
365 dummyxAODVertex->setVertexType(xAOD::VxType::NoVtx);
366 } else {
368 }
369 } else {
370 xAOD::Vertex* dummyxAODVertex = new xAOD::Vertex;
371 theVertexContainer->push_back(dummyxAODVertex);
372 dummyxAODVertex->setPosition(beamSpotHandle->beamVtx().position());
373 dummyxAODVertex->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
374 dummyxAODVertex->vxTrackAtVertex() = std::vector<Trk::VxTrackAtVertex>();
375 dummyxAODVertex->setVertexType(xAOD::VxType::NoVtx);
376 }
377
378 // loop over the pile up to set it as pile up (EXCLUDE first and last
379 // vertex, do not do that in split mode)
380 for (unsigned int i = 0; i < theVertexContainer->size() - 1; i++) {
381
383 " Vtx: " << i << " x= " << (*theVertexContainer)[i]->position().x()
384 << " y= " << (*theVertexContainer)[i]->position().y() << " z= "
385 << (*theVertexContainer)[i]->position().z() << " ntracks= "
386 << (*theVertexContainer)[i]->vxTrackAtVertex().size()
387 << " chi2= " << (*theVertexContainer)[i]->chiSquared()
388 << " ndf = " << (*theVertexContainer)[i]->numberDoF());
389 if (i > 0) {
390 (*theVertexContainer)[i]->setVertexType(xAOD::VxType::PileUp);
391 }
392 }
393 }
394
395 return std::make_pair(theVertexContainer, theVertexAuxContainer);
396}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
size_t size() const
Number of registered mappings.
#define y
#define x
#define z
PublicToolHandle< ITrackingGeometryTool > m_trackingGeometryTool
Trk::Perigee * actsBoundToTrkPerigee(const Acts::BoundTrackParameters &bound, const Acts::Vector3 &surfCenter) const
std::shared_ptr< VertexFinder > m_vertexFinder
ToolHandle< IExtrapolationTool > m_extrapolationTool
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const T * front() const
Access the first element in the collection as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
void setCovariancePosition(const AmgSymMatrix(3)&covariancePosition)
Sets the vertex covariance matrix.
void addTrackAtVertex(const ElementLink< TrackParticleContainer > &tr, float weight=1.0)
Add a new track to the vertex.
void setVertexType(VxType::VertexType vType)
Set the type of the vertex.
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
const Amg::Vector3D & position() const
Returns the 3-pos.
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
float chiSquared(const U &p)
@ PriVtx
Primary Vertex.
Definition VertexType.h:27
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
VertexType
Vertex types.
@ PileUp
Pile-up vertex.
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ findVertex() [2/3]

std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > ActsTrk::IterativePriVtxFinderTool::findVertex ( const EventContext & ctx,
const TrackCollection * trackTES ) const
overridevirtual

Definition at line 125 of file IterativePriVtxFinderTool.cxx.

127{
128
129 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx};
130 const Trk::RecVertex& beamposition(beamSpotHandle->beamVtx());
131
132 std::vector<std::unique_ptr<Trk::ITrackLink>> selectedTracks;
133
134 typedef DataVector<Trk::Track>::const_iterator TrackDataVecIter;
135
136 bool selectionPassed;
137 for (TrackDataVecIter itr = (*trackTES).begin(); itr != (*trackTES).end(); ++itr) {
139 selectionPassed = static_cast<bool>(m_trkFilter->accept(**itr, &beamposition));
140 } else {
141 Trk::Vertex null(Amg::Vector3D(0, 0, 0));
142 selectionPassed = static_cast<bool>(m_trkFilter->accept(**itr, &null));
143 }
144 if (selectionPassed) {
145 ElementLink<TrackCollection> link;
146 link.setElement(*itr);
147 auto trkPtr = std::make_unique<Trk::LinkToTrack>(link);
148 trkPtr->setStorableObject(*trackTES);
149 selectedTracks.push_back(std::move(trkPtr));
150 }
151 }
152
153 std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> returnContainers = findVertex(ctx, std::move(selectedTracks));
154
155 return returnContainers;
156}
virtual std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > findVertex(const EventContext &ctx, const TrackCollection *trackTES) const override
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkFilter
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838
Eigen::Matrix< double, 3, 1 > Vector3D
pointer & link(pointer p) const
Return a reference to the link for an element.

◆ findVertex() [3/3]

std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > ActsTrk::IterativePriVtxFinderTool::findVertex ( const EventContext & ctx,
const xAOD::TrackParticleContainer * trackParticles ) const
overridevirtual

Definition at line 159 of file IterativePriVtxFinderTool.cxx.

161{
162
163 std::vector<std::unique_ptr<Trk::ITrackLink>> selectedTracks;
164 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx};
165 xAOD::Vertex beamposition;
166 beamposition.makePrivateStore();
167 beamposition.setPosition(beamSpotHandle->beamVtx().position());
168 beamposition.setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
169
170 typedef DataVector<xAOD::TrackParticle>::const_iterator TrackParticleDataVecIter;
171
172 bool selectionPassed;
173 for (TrackParticleDataVecIter itr = (*trackParticles).begin(); itr != (*trackParticles).end(); ++itr) {
175 selectionPassed = static_cast<bool>(m_trkFilter->accept(**itr, &beamposition));
176 } else {
177 xAOD::Vertex null;
178 null.makePrivateStore();
179 null.setPosition(Amg::Vector3D(0, 0, 0));
180 AmgSymMatrix(3) vertexError;
181 vertexError.setZero();
182 null.setCovariancePosition(vertexError);
183 selectionPassed = static_cast<bool>(m_trkFilter->accept(**itr, &null));
184 }
185
186 if (selectionPassed) {
187 ElementLink<xAOD::TrackParticleContainer> link;
188 link.setElement(*itr);
189 auto trkPtr = std::make_unique<Trk::LinkToXAODTrackParticle>(link);
190 trkPtr->setStorableObject(*trackParticles);
191 selectedTracks.push_back(std::move(trkPtr));
192 }
193 }
194
195 std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> returnContainers = findVertex(ctx, std::move(selectedTracks));
196
197 return returnContainers;
198}
if(pathvar)

◆ initialize()

StatusCode ActsTrk::IterativePriVtxFinderTool::initialize ( )
overridevirtual

Definition at line 46 of file IterativePriVtxFinderTool.cxx.

47{
48 using namespace std::literals::string_literals;
49
50 ATH_CHECK(m_beamSpotKey.initialize());
51 ATH_CHECK(m_trkFilter.retrieve());
52
53 m_logger = makeActsAthenaLogger(this, "Acts");
54
55 ATH_MSG_INFO("Initializing ACTS Iterative Vertex Finder tool");
57 std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry
58 = m_trackingGeometryTool->trackingGeometry();
59
60 ATH_CHECK( m_extrapolationTool.retrieve() );
61
62 Acts::Navigator navigator( Acts::Navigator::Config{ trackingGeometry },
63 logger().cloneWithSuffix("Navigator"));
64
65 m_bField = std::make_shared<ATLASMagneticFieldWrapper>();
66 auto stepper = Acts::EigenStepper<>(m_bField);
67 m_propagator = std::make_shared<Propagator>(std::move(stepper),
68 std::move(navigator),
69 logger().cloneWithSuffix("Prop"));
70 // IP Estimator
71 Acts::ImpactPointEstimator::Config ipEstCfg(m_bField, m_propagator);
72 ipEstCfg.maxIterations = m_ipEstMaxIterations;
73 ipEstCfg.precision = m_ipEstPrecision;
74 Acts::ImpactPointEstimator ipEst(ipEstCfg,
75 logger().cloneWithSuffix("ImpactPointEstimator"));
76
77 // Linearizer for Acts::BoundParameters type test
78 TrackLinearizer::Config ltConfig;
79 ltConfig.bField = m_bField;
80 ltConfig.propagator = m_propagator;
81 m_linearizer.emplace(ltConfig, logger().cloneWithSuffix("Linearizer"));
82
83 // Full Billoir Vertex fitter setup
84 VertexFitter::Config fitterCfg;
85 fitterCfg.maxIterations = m_fitterMaxIterations;
86 fitterCfg.extractParameters.connect<&TrackWrapper::extractParameters>();
87 fitterCfg.trackLinearizer.connect<&TrackLinearizer::linearizeTrack>(&*m_linearizer);
88 VertexFitter fitter(fitterCfg, logger().cloneWithSuffix("Fitter"));
89
90
91 // Seed finder setup
92 // Set up Gaussian track density
93 Acts::GaussianTrackDensity::Config trackDensityConfig;
94 trackDensityConfig.d0MaxSignificance = m_gaussianMaxD0Significance;
95 trackDensityConfig.z0MaxSignificance = m_gaussianMaxZ0Significance;
96 trackDensityConfig.extractParameters.connect<&TrackWrapper::extractParameters>();
97 Acts::GaussianTrackDensity trackDensity(trackDensityConfig);
98
99 // Vertex seed finder
100 VertexSeedFinder::Config seedFinderConfig{trackDensity};
101 auto seedFinder = std::make_shared<VertexSeedFinder>(seedFinderConfig);
102
103 // Iterative Vertex Finder setup
104 VertexFinder::Config finderConfig(std::move(fitter),
105 std::move(seedFinder),
106 ipEst);
107 finderConfig.significanceCutSeeding = m_significanceCutSeeding;
108 finderConfig.maximumChi2cutForSeeding = m_maximumChi2cutForSeeding;
109 finderConfig.maxVertices = m_maxVertices;
110 finderConfig.createSplitVertices = m_createSplitVertices;
111 finderConfig.splitVerticesTrkInvFraction = m_splitVerticesTrkInvFraction;
112 finderConfig.reassignTracksAfterFirstFit = m_reassignTracksAfterFirstFit;
113 finderConfig.doMaxTracksCut = m_doMaxTracksCut;
114 finderConfig.maxTracks = m_maxTracks;
115 finderConfig.cutOffTrackWeight = m_cutOffTrackWeight;
116 finderConfig.extractParameters.connect<&TrackWrapper::extractParameters>();
117 finderConfig.trackLinearizer.connect<&TrackLinearizer::linearizeTrack>(&*m_linearizer);
118 m_vertexFinder = std::make_shared<VertexFinder>(std::move(finderConfig), logger().cloneWithSuffix("Finder"));
119
120 ATH_MSG_INFO("ACTS Iterative Vertex Finder tool successfully initialized");
121 return StatusCode::SUCCESS;
122}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
static Acts::BoundTrackParameters extractParameters(const Acts::InputTrack &input)
std::shared_ptr< Propagator > m_propagator
std::optional< TrackLinearizer > m_linearizer
std::unique_ptr< const Acts::Logger > m_logger
logging instance
std::shared_ptr< ATLASMagneticFieldWrapper > m_bField
UnsignedIntegerProperty m_splitVerticesTrkInvFraction
Acts::FullBilloirVertexFitter VertexFitter
const ShapeFitter * fitter

◆ logger()

const Acts::Logger & ActsTrk::IterativePriVtxFinderTool::logger ( ) const
inlineprivate

Definition at line 102 of file IterativePriVtxFinderTool.h.

102{ return *m_logger; }

◆ trackingGeometryTool()

virtual const ActsTrk::ITrackingGeometryTool * ActsTrk::IterativePriVtxFinderTool::trackingGeometryTool ( ) const
inlineprivatevirtual

Definition at line 112 of file IterativePriVtxFinderTool.h.

113 {
114 return m_trackingGeometryTool.get();
115 }

Member Data Documentation

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> ActsTrk::IterativePriVtxFinderTool::m_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"}
private

Definition at line 134 of file IterativePriVtxFinderTool.h.

134{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};

◆ m_bField

std::shared_ptr<ATLASMagneticFieldWrapper> ActsTrk::IterativePriVtxFinderTool::m_bField = nullptr
private

Definition at line 124 of file IterativePriVtxFinderTool.h.

◆ m_createSplitVertices

BooleanProperty ActsTrk::IterativePriVtxFinderTool::m_createSplitVertices {this, "createSplitVertices", false, "Create split vertices or not"}
private

Definition at line 147 of file IterativePriVtxFinderTool.h.

147{this, "createSplitVertices", false, "Create split vertices or not"};

◆ m_cutOffTrackWeight

DoubleProperty ActsTrk::IterativePriVtxFinderTool::m_cutOffTrackWeight {this, "cutOffTrackWeight", 0.01, "Min. track weight allowed"}
private

Definition at line 152 of file IterativePriVtxFinderTool.h.

152{this, "cutOffTrackWeight", 0.01, "Min. track weight allowed"};

◆ m_doMaxTracksCut

BooleanProperty ActsTrk::IterativePriVtxFinderTool::m_doMaxTracksCut {this, "doMaxTracksCut", false, "Whether use max. tracks cut or not"}
private

Definition at line 150 of file IterativePriVtxFinderTool.h.

150{this, "doMaxTracksCut", false, "Whether use max. tracks cut or not"};

◆ m_extrapolationTool

ToolHandle<IExtrapolationTool> ActsTrk::IterativePriVtxFinderTool::m_extrapolationTool {this, "ExtrapolationTool", "", "ActsExtrapolationTool"}
private

Definition at line 132 of file IterativePriVtxFinderTool.h.

132{this, "ExtrapolationTool", "", "ActsExtrapolationTool"};

◆ m_fitterMaxIterations

UnsignedIntegerProperty ActsTrk::IterativePriVtxFinderTool::m_fitterMaxIterations {this, "fitterMaxIterations", 5, "Vertex fitter max. iterations"}
private

Definition at line 140 of file IterativePriVtxFinderTool.h.

140{this, "fitterMaxIterations", 5, "Vertex fitter max. iterations"};

◆ m_gaussianMaxD0Significance

DoubleProperty ActsTrk::IterativePriVtxFinderTool::m_gaussianMaxD0Significance {this, "gaussianMaxD0Significance", 3.5, "Gaussian seeder max d0 track significance"}
private

Definition at line 155 of file IterativePriVtxFinderTool.h.

155{this, "gaussianMaxD0Significance", 3.5, "Gaussian seeder max d0 track significance"};

◆ m_gaussianMaxZ0Significance

DoubleProperty ActsTrk::IterativePriVtxFinderTool::m_gaussianMaxZ0Significance {this, "gaussianMaxDZSignificance", 12.0, "Gaussian seeder max z0 track significance"}
private

Definition at line 156 of file IterativePriVtxFinderTool.h.

156{this, "gaussianMaxDZSignificance", 12.0, "Gaussian seeder max z0 track significance"};

◆ m_ipEstMaxIterations

UnsignedIntegerProperty ActsTrk::IterativePriVtxFinderTool::m_ipEstMaxIterations {this, "ipEstMaxIterations", 20, "IpEstimator max. iterations"}
private

Definition at line 159 of file IterativePriVtxFinderTool.h.

159{this, "ipEstMaxIterations", 20, "IpEstimator max. iterations"};

◆ m_ipEstPrecision

DoubleProperty ActsTrk::IterativePriVtxFinderTool::m_ipEstPrecision {this, "ipEstPrecision", 1e-10, "IpEstimator precision"}
private

Definition at line 160 of file IterativePriVtxFinderTool.h.

160{this, "ipEstPrecision", 1e-10, "IpEstimator precision"};

◆ m_linearizer

std::optional<TrackLinearizer> ActsTrk::IterativePriVtxFinderTool::m_linearizer = std::nullopt
private

Definition at line 129 of file IterativePriVtxFinderTool.h.

◆ m_logger

std::unique_ptr<const Acts::Logger> ActsTrk::IterativePriVtxFinderTool::m_logger {nullptr}
private

logging instance

Definition at line 101 of file IterativePriVtxFinderTool.h.

101{nullptr};

◆ m_maximumChi2cutForSeeding

DoubleProperty ActsTrk::IterativePriVtxFinderTool::m_maximumChi2cutForSeeding {this, "maximumChi2cutForSeeding", 36., "Max. Chi2 cut for seeding"}
private

Definition at line 145 of file IterativePriVtxFinderTool.h.

145{this, "maximumChi2cutForSeeding", 36., "Max. Chi2 cut for seeding"};

◆ m_maxTracks

UnsignedIntegerProperty ActsTrk::IterativePriVtxFinderTool::m_maxTracks {this, "maxTracks", 5000, "Max. number of tracks to use for vertex finding"}
private

Definition at line 151 of file IterativePriVtxFinderTool.h.

151{this, "maxTracks", 5000, "Max. number of tracks to use for vertex finding"};

◆ m_maxVertices

UnsignedIntegerProperty ActsTrk::IterativePriVtxFinderTool::m_maxVertices {this, "maxVertices", 50, "Max number of vertices"}
private

Definition at line 146 of file IterativePriVtxFinderTool.h.

146{this, "maxVertices", 50, "Max number of vertices"};

◆ m_propagator

std::shared_ptr<Propagator> ActsTrk::IterativePriVtxFinderTool::m_propagator = nullptr
private

Definition at line 126 of file IterativePriVtxFinderTool.h.

◆ m_reassignTracksAfterFirstFit

BooleanProperty ActsTrk::IterativePriVtxFinderTool::m_reassignTracksAfterFirstFit {this, "reassignTracksAfterFirstFit", false, "Whether re-assign tracks after first vertex fit or not"}
private

Definition at line 149 of file IterativePriVtxFinderTool.h.

149{this, "reassignTracksAfterFirstFit", false, "Whether re-assign tracks after first vertex fit or not"};

◆ m_significanceCutSeeding

DoubleProperty ActsTrk::IterativePriVtxFinderTool::m_significanceCutSeeding {this, "significanceCutSeeding", 10, "Seeding Cut Significance"}
private

Definition at line 144 of file IterativePriVtxFinderTool.h.

144{this, "significanceCutSeeding", 10, "Seeding Cut Significance"};

◆ m_splitVerticesTrkInvFraction

UnsignedIntegerProperty ActsTrk::IterativePriVtxFinderTool::m_splitVerticesTrkInvFraction {this, "splitVerticesTrkInvFraction", 2, "Track Inv. fraction for split vertices"}
private

Definition at line 148 of file IterativePriVtxFinderTool.h.

148{this, "splitVerticesTrkInvFraction", 2, "Track Inv. fraction for split vertices"};

◆ m_trackingGeometryTool

PublicToolHandle<ITrackingGeometryTool> ActsTrk::IterativePriVtxFinderTool::m_trackingGeometryTool {this, "TrackingGeometryTool", "", "ActsTrackingGeometryTool"}
private

Definition at line 131 of file IterativePriVtxFinderTool.h.

131{this, "TrackingGeometryTool", "", "ActsTrackingGeometryTool"};

◆ m_trkFilter

ToolHandle<InDet::IInDetTrackSelectionTool> ActsTrk::IterativePriVtxFinderTool::m_trkFilter {this, "TrackSelector", "", "InDetTrackSelectionTool"}
private

Definition at line 133 of file IterativePriVtxFinderTool.h.

133{this, "TrackSelector", "", "InDetTrackSelectionTool"};

◆ m_useBeamConstraint

BooleanProperty ActsTrk::IterativePriVtxFinderTool::m_useBeamConstraint {this, "useBeamConstraint", true, "Use beam constraint"}
private

Definition at line 143 of file IterativePriVtxFinderTool.h.

143{this, "useBeamConstraint", true, "Use beam constraint"};

◆ m_vertexFinder

std::shared_ptr<VertexFinder> ActsTrk::IterativePriVtxFinderTool::m_vertexFinder = nullptr
private

Definition at line 123 of file IterativePriVtxFinderTool.h.


The documentation for this class was generated from the following files: