ATLAS Offline Software
InDetIterativePriVxFinderTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 /***************************************************************************
6  InDetIterativePriVxFinderTool.cxx - Description
7  -------------------
8  begin : 23-02-2010
9  authors : Giacinto Piacquadio (CERN PH-ADE-ID)
10  changes :
11  2016-04-26 David Shope <david.richard.shope@cern.ch>
12  EDM Migration to xAOD - from Trk::VxCandidate to xAOD::Vertex
13  findVertex will now always return an xAOD::VertexContainer,
14  even when using a TrackCollection.
15  as input.
16 ***************************************************************************/
25 #include "TrkTrack/Track.h"
27 
29 #include "VxVertex/RecVertex.h"
31 
33 #include "TrkTrack/LinkToTrack.h"
35 
39 #include "xAODTracking/Vertex.h"
42 
43 #include <utility>
44 #include <vector>
45 
46 namespace InDet {
48  const std::string& t,
49  const std::string& n,
50  const IInterface* p)
51  : AthAlgTool(t, n, p)
52 {
53  declareInterface<IVertexFinder>(this);
54 }
55 
57 
60 {
62  ATH_MSG_FATAL(" Split vertices cannot be obtained if beam spot constraint "
63  "is true! Change settings...");
64  return StatusCode::FAILURE;
65  }
66 
67  /* Get the right vertex fitting tool from ToolSvc */
68  if (m_iVertexFitter.retrieve().isFailure()) {
69  ATH_MSG_FATAL("Failed to retrieve tool " << m_iVertexFitter);
70  return StatusCode::FAILURE;
71  }
72 
73  if (m_SeedFinder.retrieve().isFailure()) {
74  ATH_MSG_FATAL("Failed to retrieve tool " << m_SeedFinder);
75  return StatusCode::FAILURE;
76  }
77 
78  if (m_LinearizedTrackFactory.retrieve().isFailure()) {
79  ATH_MSG_FATAL("Failed to retrieve tool " << m_LinearizedTrackFactory);
80  return StatusCode::FAILURE;
81  }
82 
83  if (m_ImpactPoint3dEstimator.retrieve().isFailure()) {
84  ATH_MSG_FATAL("Failed to retrieve tool " << m_ImpactPoint3dEstimator);
85  return StatusCode::FAILURE;
86  }
87 
89 
90  if (m_trkFilter.retrieve().isFailure()) {
91  ATH_MSG_ERROR(" Unable to retrieve " << m_trkFilter);
92  return StatusCode::FAILURE;
93  }
94 
95  // since some parameters special to an inherited class this method
96  // will be overloaded by the inherited class
98 
99  return StatusCode::SUCCESS;
100 }
101 
102 namespace {
103 struct xAODVertex_pair
104 {
105  double first;
107  xAODVertex_pair(double p1, xAOD::Vertex* p2)
108  : first(p1)
109  , second(p2)
110  {}
111  bool operator<(const xAODVertex_pair& other) const
112  {
113  return first > other.first;
114  }
115 };
116 } // anonymous namespace
117 
118 std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
119 InDetIterativePriVxFinderTool::findVertex(const EventContext& ctx,
120  const TrackCollection* trackTES) const
121 {
122 
124  " Number of input tracks before track selection: " << trackTES->size());
125 
127  const InDet::BeamSpotData* beamSpot = *beamSpotHandle;
128 
129  std::vector<Trk::ITrackLink*> selectedTracks;
130 
131  using TrackDataVecIter = DataVector<Trk::Track>::const_iterator;
132 
133  bool selectionPassed;
134  for (TrackDataVecIter itr = (*trackTES).begin(); itr != (*trackTES).end();
135  ++itr) {
136 
137  if (m_useBeamConstraint && beamSpot != nullptr) {
138  Trk::RecVertex beamPosition{ beamSpot->beamVtx() };
139  selectionPassed =
140  static_cast<bool>(m_trkFilter->accept(**itr, &beamPosition));
141  } else {
142  Trk::Vertex null(Amg::Vector3D(0, 0, 0));
143  selectionPassed = static_cast<bool>(m_trkFilter->accept(**itr, &null));
144  }
145  if (selectionPassed) {
147  link.setElement(*itr);
148  Trk::LinkToTrack* linkTT = new Trk::LinkToTrack(link);
149  linkTT->setStorableObject(*trackTES);
150  selectedTracks.push_back(linkTT);
151  }
152  }
153 
154  ATH_MSG_DEBUG("Of " << trackTES->size() << " tracks " << selectedTracks.size()
155  << " survived the preselection.");
156 
157  std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
158  returnContainers = findVertex(ctx, selectedTracks);
159 
160  return returnContainers;
161 }
162 
163 std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
165  const EventContext& ctx,
166  const xAOD::TrackParticleContainer* trackParticles) const
167 {
168  ATH_MSG_DEBUG(" Number of input tracks before track selection: "
169  << trackParticles->size());
170 
172  const InDet::BeamSpotData* beamSpot = *beamSpotHandle;
173 
174  std::vector<Trk::ITrackLink*> selectedTracks;
175 
176  using TrackParticleDataVecIter =
178 
179  bool selectionPassed;
180  for (TrackParticleDataVecIter itr = trackParticles->begin();
181  itr != trackParticles->end();
182  ++itr) {
183 
184  if (m_useBeamConstraint && beamSpot != nullptr) {
185  xAOD::Vertex beamPosition;
186  beamPosition.makePrivateStore();
187  beamPosition.setPosition(beamSpot->beamVtx().position());
188  beamPosition.setCovariancePosition(
189  beamSpot->beamVtx().covariancePosition());
190  selectionPassed =
191  static_cast<bool>(m_trkFilter->accept(**itr, &beamPosition));
192  } else {
193 
194  xAOD::Vertex null;
195  null.makePrivateStore();
196  null.setPosition(Amg::Vector3D(0, 0, 0));
197  AmgSymMatrix(3) vertexError;
198  vertexError.setZero();
199  null.setCovariancePosition(vertexError);
200  selectionPassed = static_cast<bool>(m_trkFilter->accept(**itr, &null));
201  }
202 
203  if (selectionPassed) {
205  link.setElement(*itr);
208  linkTT->setStorableObject(*trackParticles);
209  selectedTracks.push_back(linkTT);
210  }
211  }
212 
213  ATH_MSG_DEBUG("Of " << trackParticles->size() << " tracks "
214  << selectedTracks.size()
215  << " survived the preselection.");
216 
217  std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
218  returnContainers = findVertex(ctx, selectedTracks);
219 
220  return returnContainers;
221 }
222 
223 std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*>
225  const EventContext& ctx,
226  const std::vector<Trk::ITrackLink*>& trackVector) const
227 {
229  const InDet::BeamSpotData* beamSpot = *beamSpotHandle;
230  // two things need to be added
231  // 1) the seeding mechanism
232  // 2) the iterative removal of tracks
233 
234  std::vector<Trk::ITrackLink*> origTracks = trackVector;
235  std::vector<Trk::ITrackLink*> seedTracks = trackVector;
236 
237  // TODO: xAODVertex_pair never seems to be used?
238  std::vector<xAODVertex_pair> myxAODVertices;
239 
240  xAOD::VertexContainer* theVertexContainer = new xAOD::VertexContainer;
241  xAOD::VertexAuxContainer* theVertexAuxContainer =
243  theVertexContainer->setStore(theVertexAuxContainer);
244 
245  // bail out early with only Dummy vertex if multiplicity cut is applied and
246  // exceeded
247 
248  if (m_doMaxTracksCut && (trackVector.size() > m_maxTracks)) {
249  ATH_MSG_WARNING(trackVector.size()
250  << " tracks - exceeds maximum (" << m_maxTracks
251  << "), skipping vertexing and returning only dummy...");
252  xAOD::Vertex* dummyxAODVertex = new xAOD::Vertex;
253  theVertexContainer->push_back(
254  dummyxAODVertex); // have to add vertex to container here first so it can
255  // use its aux store
256  dummyxAODVertex->setPosition(beamSpot->beamVtx().position());
257  dummyxAODVertex->setCovariancePosition(
258  beamSpot->beamVtx().covariancePosition());
259  dummyxAODVertex->vxTrackAtVertex() = std::vector<Trk::VxTrackAtVertex>();
260  dummyxAODVertex->setVertexType(xAOD::VxType::NoVtx);
261  return std::make_pair(theVertexContainer, theVertexAuxContainer);
262  }
263 
264  int iterations = 0;
265  unsigned int seedtracknumber = seedTracks.size();
266 
267  // used to store seed info
268  Amg::Vector3D actualVertex;
269 
270  // prepare iterators for tracks only necessary for seeding
273 
274  do {
275 
276  seedBegin = seedTracks.begin();
277  seedEnd = seedTracks.end();
278 
279  if (seedtracknumber == 0) {
280  ATH_MSG_DEBUG(" New iteration. No tracks available after track selection "
281  "for seeding. No finding done.");
282  break;
283  }
284 
285  ATH_MSG_DEBUG("ITERATION NUMBER " << iterations);
286 
287  // now find a new SEED
288 
289  std::vector<const Trk::TrackParameters*> perigeeList;
290  for (std::vector<Trk::ITrackLink*>::iterator seedtrkAtVtxIter = seedBegin;
291  seedtrkAtVtxIter != seedEnd;
292  ++seedtrkAtVtxIter) {
293  perigeeList.push_back((*seedtrkAtVtxIter)->parameters());
294  }
295 
296  xAOD::Vertex theconstraint;
297  if (m_useBeamConstraint && beamSpot != nullptr) {
298  theconstraint =
299  xAOD::Vertex(); // Default constructor creates a private store
300  theconstraint.setPosition(beamSpot->beamVtx().position());
301  theconstraint.setCovariancePosition(
302  beamSpot->beamVtx().covariancePosition());
303  theconstraint.setFitQuality(
304  beamSpot->beamVtx().fitQuality().chiSquared(),
305  beamSpot->beamVtx().fitQuality().doubleNumberDoF());
306  actualVertex = m_SeedFinder->findSeed(perigeeList, &theconstraint);
307  } else {
308  actualVertex = m_SeedFinder->findSeed(perigeeList);
309  Amg::MatrixX looseConstraintCovariance(3, 3);
310  looseConstraintCovariance.setIdentity();
311  looseConstraintCovariance = looseConstraintCovariance * 1e+8;
312  theconstraint = xAOD::Vertex();
313  theconstraint.setPosition(actualVertex);
314  theconstraint.setCovariancePosition(looseConstraintCovariance);
315  theconstraint.setFitQuality(0., -3.);
316  }
317 
318  if (msgLvl(MSG::DEBUG)) {
319  msg(MSG::DEBUG) << " seed at x: " << actualVertex.x()
320  << " at y: " << actualVertex.y()
321  << " at z: " << actualVertex.z() << endmsg;
322  }
323 
324  if (actualVertex.z() == 0.) {
325  break;
326  }
327 
328  // now question (remove tracks which are too far away??? I think so...)
329  std::vector<const Trk::TrackParameters*> perigeesToFit;
330  std::vector<const Trk::TrackParameters*> perigeesToFitSplitVertex;
331 
332  int numberOfTracks(perigeeList.size());
333 
334  std::vector<const Trk::TrackParameters*>::const_iterator perigeeListBegin =
335  perigeeList.begin();
336  std::vector<const Trk::TrackParameters*>::const_iterator perigeeListEnd =
337  perigeeList.end();
338 
339  int counter = 0;
340 
341  for (std::vector<const Trk::TrackParameters*>::const_iterator
342  perigeeListIter = perigeeListBegin;
343  perigeeListIter != perigeeListEnd;
344  ++perigeeListIter) {
345  if (numberOfTracks <= 2) {
346  perigeesToFit.push_back(*perigeeListIter);
347  counter += 1;
348  } else if (numberOfTracks <= 4 && !m_createSplitVertices) {
349  perigeesToFit.push_back(*perigeeListIter);
350  counter += 1;
351  } else if (numberOfTracks <= 4 * m_splitVerticesTrkInvFraction &&
353  // few tracks are left, put them into the fit regardless their position!
355  perigeesToFit.push_back(*perigeeListIter);
356  counter += 1;
357  } else {
358  perigeesToFitSplitVertex.push_back(*perigeeListIter);
359  counter += 1;
360  }
361  } else { // check first whether it is not too far away!
362  double distance = 0.;
363  try {
364  std::unique_ptr<Trk::PlaneSurface> mySurface =
365  m_ImpactPoint3dEstimator->Estimate3dIP(
366  *perigeeListIter, &actualVertex, distance);
368  msg(MSG::WARNING) << " ImpactPoint3dEstimator failed to find minimum "
369  "distance between track and vertex seed: "
370  << err.p << endmsg;
371  }
372 
373  if (distance < 0) {
374  msg(MSG::WARNING)
375  << " Distance between track and seed vtx is negative: " << distance
376  << endmsg;
377  }
378 
379  const Trk::TrackParameters* myPerigee = (*perigeeListIter);
380 
381  // very approximate error
382  double error = 0.;
383 
384  if (myPerigee && myPerigee->covariance()) {
385  error = std::sqrt((*myPerigee->covariance())(Trk::d0, Trk::d0) +
386  (*myPerigee->covariance())(Trk::z0, Trk::z0));
387  } // end of the security check
388 
389  if (error == 0.) {
390  msg(MSG::ERROR) << " Error is zero! " << distance << endmsg;
391  error = 1.;
392  }
393 
397  perigeesToFit.push_back(*perigeeListIter);
398  counter += 1;
399  } else {
400  perigeesToFitSplitVertex.push_back(*perigeeListIter);
401  counter += 1;
402  }
403  }
404  }
405  }
406 
407  if (perigeesToFit.empty()) {
408  ATH_MSG_DEBUG(" No good seed found. Exiting search for vertices...");
409  break;
410  }
411 
412  // now you have perigeeToFit and perigeeToFitSplitVertices
413  // AND HERE YOU DO THE FIT
414  // to reassign vertices you look ino what is already in myVxCandidate
415  // you do it only ONCE!
416 
417  xAOD::Vertex* myxAODVertex = nullptr;
418  xAOD::Vertex* myxAODSplitVertex = nullptr;
419 
420  if (m_useBeamConstraint && !perigeesToFit.empty()) {
421  myxAODVertex = m_iVertexFitter->fit(perigeesToFit, theconstraint);
422  } else if (!m_useBeamConstraint && perigeesToFit.size() > 1) {
423  myxAODVertex = m_iVertexFitter->fit(perigeesToFit);
424  }
425  if (m_createSplitVertices && perigeesToFitSplitVertex.size() > 1) {
426  myxAODSplitVertex = m_iVertexFitter->fit(perigeesToFitSplitVertex);
427  }
428 
429  double ndf = 0.;
430  int ntracks = 0;
431  countTracksAndNdf(myxAODVertex, ndf, ntracks);
432 
433  double ndfSplitVertex = 0.;
434  int ntracksSplitVertex = 0;
435  countTracksAndNdf(myxAODSplitVertex, ndfSplitVertex, ntracksSplitVertex);
436 
437  bool goodVertex = myxAODVertex != nullptr &&
438  ((!m_useBeamConstraint && ndf > 0 && ntracks >= 2) ||
439  (m_useBeamConstraint && ndf > 3 && ntracks >= 2));
440 
441  if (msgLvl(MSG::DEBUG)) {
442  msg(MSG::DEBUG) << " xAOD::Vertex is pointer: " << myxAODVertex
443  << " ndf = " << ndf << " ntracks (with weight>0.01) "
444  << ntracks << " beam constraint "
445  << (m_useBeamConstraint ? "yes" : "no") << endmsg;
446  }
447 
448  if (!goodVertex) {
449  removeAllFrom(perigeesToFit, seedTracks);
450  } else {
452  // now you HAVE a good vertex
453  // but you want to add the tracks which you missed...
454 
455  int numberOfAddedTracks = 0;
456 
457  // iterate on remaining vertices and cross-check if tracks need to be
458  // attached to new vertex
459  xAOD::VertexContainer::iterator vxBegin = theVertexContainer->begin();
460  xAOD::VertexContainer::iterator vxEnd = theVertexContainer->end();
461 
462  for (xAOD::VertexContainer::iterator vxIter = vxBegin; vxIter != vxEnd;
463  ++vxIter) {
464  // now iterate on tracks at vertex
465 
466  std::vector<Trk::VxTrackAtVertex>* myVxTracksAtVtx =
467  (&(*vxIter)->vxTrackAtVertex());
468 
469  if (!myVxTracksAtVtx)
470  continue;
471 
473  myVxTracksAtVtx->begin();
475  myVxTracksAtVtx->end();
476 
478  tracksBegin;
479  tracksIter != tracksEnd;) {
480  // only try with tracks which are not too tightly assigned to
481  // another vertex
482  if ((*tracksIter).weight() > 0.01) {
483  ++tracksIter;
484  continue;
485  }
486 
487  const Trk::TrackParameters* trackPerigee =
488  (*tracksIter).initialPerigee();
489 
490  if (trackPerigee == nullptr) {
491  msg(MSG::ERROR) << " Cast to perigee gives 0 pointer " << endmsg;
492  }
493 
494  double chi2_newvtx = compatibility(*trackPerigee, *myxAODVertex);
495  double chi2_oldvtx = compatibility(*trackPerigee, *(*vxIter));
496 
497  bool remove = false;
498 
499  if (chi2_newvtx < chi2_oldvtx) {
500  ATH_MSG_DEBUG(" Found track of old vertex (chi2= "
501  << chi2_oldvtx
502  << ") more compatible to new one (chi2= "
503  << chi2_newvtx << ")");
504 
505  perigeesToFit.push_back(trackPerigee);
506  // but you need to re-add it to the seedTracks too...
507 
508  bool isFound = false;
509 
511  origTracks.begin();
513  origTracks.end();
514 
515  for (std::vector<Trk::ITrackLink*>::iterator origIter = origBegin;
516  origIter != origEnd;
517  ++origIter) {
518  if ((*origIter)->parameters() == trackPerigee) {
519  isFound = true;
520  seedTracks.push_back(*origIter);
521  break;
522  }
523  }
524  if (!isFound) {
525  ATH_MSG_WARNING(" Cannot find old perigee to re-add back to "
526  "seed tracks... ");
527  }
528 
529  numberOfAddedTracks += 1;
530 
531  remove = true;
532  }
533 
534  if (remove) {
535  // now you have to delete the track from the old vertex...
536  // easy???
537  tracksIter = myVxTracksAtVtx->erase(tracksIter);
538  tracksBegin = myVxTracksAtVtx->begin();
539  tracksEnd = myVxTracksAtVtx->end();
540  } else {
541  ++tracksIter;
542  }
543  } // end of iterating on tracks
544  } // end of iterating on already found vertices in event
545 
546  // now you have to delete the previous xAOD::Vertex, do a new fit, then
547  // check if you still have a good vertex
548 
549  if (numberOfAddedTracks > 0) {
550  delete myxAODVertex;
551  myxAODVertex = nullptr;
552 
553  if (m_useBeamConstraint && !perigeesToFit.empty()) {
554  myxAODVertex = m_iVertexFitter->fit(perigeesToFit, theconstraint);
555  } else if (!m_useBeamConstraint && perigeesToFit.size() > 1) {
556  myxAODVertex = m_iVertexFitter->fit(perigeesToFit);
557  }
558 
559  ndf = 0.;
560  ntracks = 0;
561  countTracksAndNdf(myxAODVertex, ndf, ntracks);
562 
563  goodVertex = myxAODVertex != nullptr &&
564  ((!m_useBeamConstraint && ndf > 0 && ntracks >= 2) ||
565  (m_useBeamConstraint && ndf > 3 && ntracks >= 2));
566 
567  ATH_MSG_DEBUG(" Refitted xAODVertex is pointer: "
568  << myxAODVertex << " ndf = " << ndf
569  << " ntracks (with weight>0.01) " << ntracks
570  << " beam constraint "
571  << (m_useBeamConstraint ? "yes" : "no"));
572 
573  if (!goodVertex) {
574  removeAllFrom(perigeesToFit, seedTracks);
575  ATH_MSG_DEBUG(" Adding tracks resulted in an invalid vertex. "
576  "Should be rare. ");
577  }
578  } // end if tracks were added...
579  } // end reassign tracks from previous vertices and refitting if needed
580 
581  // need to re-ask goodVertex since it can be changed in the mean time
582  if (goodVertex) {
583  removeCompatibleTracks(myxAODVertex, perigeesToFit, seedTracks);
584  }
585  } // end else case on if not good Vertex
586 
587  bool goodSplitVertex = false;
588 
589  if (m_createSplitVertices) {
590  goodSplitVertex = myxAODSplitVertex != nullptr && ndfSplitVertex > 0 &&
591  ntracksSplitVertex >= 2;
592 
593  ATH_MSG_DEBUG(" xAODSplitVertex is pointer: "
594  << myxAODSplitVertex << " ndf = " << ndfSplitVertex
595  << " ntracks (with weight>0.01) " << ntracksSplitVertex);
596 
597  if (!goodSplitVertex) {
598  removeAllFrom(perigeesToFitSplitVertex, seedTracks);
599  } else {
601  myxAODSplitVertex, perigeesToFitSplitVertex, seedTracks);
602 
603  } // end else if not good Vertex
604  } // end if create split vertices
605 
606  if (!m_createSplitVertices) {
607  if (goodVertex) {
608  theVertexContainer->push_back(myxAODVertex);
609  } else {
610  if (myxAODVertex) {
611  delete myxAODVertex;
612  myxAODVertex = nullptr;
613  }
614  }
615  } else {
616  if (goodVertex) {
617  // type does not seem to be set earlier
618  myxAODVertex->setVertexType(xAOD::VxType::PriVtx);
619  theVertexContainer->push_back(myxAODVertex);
620  } else {
621  if (myxAODVertex) {
622  delete myxAODVertex;
623  myxAODVertex = nullptr;
624  }
625 
626  xAOD::Vertex* dummyxAODVertex = new xAOD::Vertex;
627  theVertexContainer->push_back(
628  dummyxAODVertex); // have to add vertex to container here first so it
629  // can use its aux store
630  dummyxAODVertex->setPosition(beamSpot->beamVtx().position());
631  dummyxAODVertex->setCovariancePosition(
632  beamSpot->beamVtx().covariancePosition());
633  dummyxAODVertex->vxTrackAtVertex() =
634  std::vector<Trk::VxTrackAtVertex>();
635  dummyxAODVertex->setVertexType(xAOD::VxType::NoVtx);
636  }
637  if (goodSplitVertex) {
638  // type does not seem to be set earlier
639  myxAODSplitVertex->setVertexType(xAOD::VxType::PriVtx);
640  theVertexContainer->push_back(myxAODSplitVertex);
641  } else {
642  if (myxAODSplitVertex) {
643  delete myxAODSplitVertex;
644  myxAODSplitVertex = nullptr;
645  }
646 
647  xAOD::Vertex* dummyxAODVertex = new xAOD::Vertex;
648  theVertexContainer->push_back(
649  dummyxAODVertex); // have to add vertex to container here first so it
650  // can use its aux store
651  dummyxAODVertex->setPosition(beamSpot->beamVtx().position());
652  dummyxAODVertex->setCovariancePosition(
653  beamSpot->beamVtx().covariancePosition());
654  dummyxAODVertex->vxTrackAtVertex() =
655  std::vector<Trk::VxTrackAtVertex>();
656  dummyxAODVertex->setVertexType(xAOD::VxType::NoVtx);
657  }
658  }
659 
660  ++iterations;
661  } while (seedTracks.size() > 1 && iterations < m_maxVertices);
662 
663  if (iterations == m_maxVertices) {
664  ATH_MSG_DEBUG("Reached maximum iterations, have "<<iterations<<" vertices");
665  }
666  else if (iterations > m_maxVertices) {
667  ATH_MSG_WARNING("Exceeded maximum iterations, have "<<iterations<<" vertices, m_maxVertices = "<<m_maxVertices);
668  }
669 
670  // unfortunately you have still a problem with the track to links!!!
671 
672  //---- add dummy vertex at the end
673  //------------------------------------------------------//
674  //---- if one or more vertices are already there: let dummy have same position
675  // as primary vertex
676  if (!m_createSplitVertices) {
677  if (!theVertexContainer->empty()) {
678  xAOD::Vertex* primaryVtx = theVertexContainer->front();
679  if (!primaryVtx->vxTrackAtVertex().empty()) {
681  xAOD::Vertex* dummyxAODVertex = new xAOD::Vertex;
682  theVertexContainer->push_back(
683  dummyxAODVertex); // have to add vertex to container here first so it
684  // can use its aux store
685  dummyxAODVertex->setPosition(primaryVtx->position());
686  dummyxAODVertex->setCovariancePosition(
687  primaryVtx->covariancePosition());
688  dummyxAODVertex->vxTrackAtVertex() =
689  std::vector<Trk::VxTrackAtVertex>();
690  dummyxAODVertex->setVertexType(xAOD::VxType::NoVtx);
691  } else {
692  primaryVtx->setVertexType(xAOD::VxType::NoVtx);
693  }
694  }
695  //---- if no vertex is there let dummy be at beam spot
696 
697  else if (theVertexContainer->empty()) {
698  xAOD::Vertex* dummyxAODVertex = new xAOD::Vertex;
699  theVertexContainer->push_back(
700  dummyxAODVertex); // have to add vertex to container here first so it
701  // can use its aux store
702  dummyxAODVertex->setPosition(beamSpot->beamVtx().position());
703  dummyxAODVertex->setCovariancePosition(
704  beamSpot->beamVtx().covariancePosition());
705  dummyxAODVertex->vxTrackAtVertex() = std::vector<Trk::VxTrackAtVertex>();
706  dummyxAODVertex->setVertexType(xAOD::VxType::NoVtx);
707  }
708  // loop over the pile up to set it as pile up (EXCLUDE first and last
709  // vertex, do not do that in split mode)
710  for (unsigned int i = 0; i < theVertexContainer->size() - 1; i++) {
711 
713  " Vtx: " << i << " x= " << (*theVertexContainer)[i]->position().x()
714  << " y= " << (*theVertexContainer)[i]->position().y() << " z= "
715  << (*theVertexContainer)[i]->position().z() << " ntracks= "
716  << (*theVertexContainer)[i]->vxTrackAtVertex().size()
717  << " chi2= " << (*theVertexContainer)[i]->chiSquared()
718  << " ndf = " << (*theVertexContainer)[i]->numberDoF());
719  if (i > 0) {
720  (*theVertexContainer)[i]->setVertexType(xAOD::VxType::PileUp);
721  }
722  }
723  }
724 
725  xAOD::VertexContainer::iterator vxBegin = theVertexContainer->begin();
726  xAOD::VertexContainer::iterator vxEnd = theVertexContainer->end();
727 
728  // prepare iterators for tracks only necessary for seeding
729  std::vector<Trk::ITrackLink*>::iterator origtrkbegin = origTracks.begin();
730  std::vector<Trk::ITrackLink*>::iterator origtrkend = origTracks.end();
731 
732  for (xAOD::VertexContainer::iterator vxIter = vxBegin; vxIter != vxEnd;
733  ++vxIter) {
734  std::vector<Trk::VxTrackAtVertex>* myVxTracksAtVtx =
735  &((*vxIter)->vxTrackAtVertex());
736 
737  if (!myVxTracksAtVtx)
738  continue;
739 
741  myVxTracksAtVtx->begin();
743  myVxTracksAtVtx->end();
744 
745  bool found = false;
746 
747  for (std::vector<Trk::VxTrackAtVertex>::iterator tracksIter = tracksBegin;
748  tracksIter != tracksEnd;
749  ++tracksIter) {
750 
751  // now look for corresponding ITrackLink
752  for (std::vector<Trk::ITrackLink*>::iterator origtrkiter = origtrkbegin;
753  origtrkiter != origtrkend;
754  ++origtrkiter) {
755  if ((*origtrkiter)->parameters() == (*tracksIter).initialPerigee()) {
756  found = true;
757 
758  // assigning the input track to the fitted vertex through
759  // VxTrackAtVertices vector
760  (*tracksIter).setOrigTrack(*origtrkiter);
761 
762  // See if the trklink is to an xAOD::TrackParticle
763  Trk::LinkToXAODTrackParticle* linkToXAODTP = nullptr;
764  Trk::ITrackLink* tmpLink = (*tracksIter).trackOrParticleLink();
765  if (tmpLink->type() == Trk::ITrackLink::ToxAODTrackParticle) {
766  linkToXAODTP = static_cast<Trk::LinkToXAODTrackParticle*>(tmpLink);
767  }
768 
769  // If track is an xAOD::TrackParticle, set directly in xAOD::Vertex
770  if (linkToXAODTP) {
771  (*vxIter)->addTrackAtVertex(*linkToXAODTP, (*tracksIter).weight());
772  }
773 
774  origTracks.erase(origtrkiter);
775  origtrkbegin = origTracks.begin();
776  origtrkend = origTracks.end();
777  break;
778  }
779  }
780  if (!found) {
781  ATH_MSG_ERROR(" Cannot find vector element to fix links (step 4)! ");
782  }
783  } // end iterate on tracks at vtx
784  } // end iterate on vertices
785 
786  for (std::vector<Trk::ITrackLink*>::iterator origtrkiter = origtrkbegin;
787  origtrkiter != origtrkend;
788  ++origtrkiter) {
789  if ((*origtrkiter) != 0) {
790  delete *origtrkiter;
791  *origtrkiter = 0;
792  }
793  }
794 
795  return std::make_pair(theVertexContainer, theVertexAuxContainer);
796 }
797 
800 {
801  return StatusCode::SUCCESS;
802 }
803 
804 void
806 {
807  ATH_MSG_DEBUG("VxPrimary initialize(): Parametersettings "
808  << '\n'
809  << "VertexFitter " << m_iVertexFitter << '\n');
810 }
811 
812 void
813 InDetIterativePriVxFinderTool::SGError(const std::string& errService)
814 {
815  msg(MSG::FATAL) << errService << " not found. Exiting !" << endmsg;
816 }
817 
818 double
820  const Trk::TrackParameters& measPerigee,
821  const xAOD::Vertex& vertex) const
822 {
823  Trk::LinearizedTrack* myLinearizedTrack =
824  m_LinearizedTrackFactory->linearizedTrack(&measPerigee, vertex.position());
825 
826  AmgMatrix(2, 2) weightReduced =
827  myLinearizedTrack->expectedCovarianceAtPCA().block<2, 2>(0, 0);
828 
829  AmgMatrix(2, 2) errorVertexReduced =
830  (myLinearizedTrack->positionJacobian() *
831  (vertex.covariancePosition() *
832  myLinearizedTrack->positionJacobian().transpose()))
833  .block<2, 2>(0, 0);
834 
835  weightReduced += errorVertexReduced;
836 
837  weightReduced = weightReduced.inverse().eval();
838  Amg::Vector2D trackParameters2D =
839  myLinearizedTrack->expectedParametersAtPCA().block<2, 1>(0, 0);
840  double returnValue = trackParameters2D.dot(weightReduced * trackParameters2D);
841 
842  delete myLinearizedTrack;
843  myLinearizedTrack = nullptr;
844 
845  return returnValue;
846 }
847 
848 void
850  std::vector<const Trk::TrackParameters*>& perigeesToFit,
851  std::vector<Trk::ITrackLink*>& seedTracks) const
852 {
853  // remove all perigeesToFit and go on...
854 
855  std::vector<Trk::ITrackLink*>::iterator seedBegin = seedTracks.begin();
856  std::vector<Trk::ITrackLink*>::iterator seedEnd = seedTracks.end();
857 
859  perigeesToFit.begin();
861  perigeesToFit.end();
862 
864  perigeesToFitBegin;
865  perigeesToFitIter != perigeesToFitEnd;
866  ++perigeesToFitIter) {
867 
868  bool found = false;
869 
870  for (std::vector<Trk::ITrackLink*>::iterator seedIter = seedTracks.begin();
871  seedIter != seedEnd;
872  ++seedIter) {
873  if ((*seedIter)->parameters() == *perigeesToFitIter) {
874  found = true;
875  seedTracks.erase(seedIter);
876  seedBegin = seedTracks.begin();
877  seedEnd = seedTracks.end();
878  break;
879  }
880  }
881  if (!found) {
883  " Cannot find vector element to delete when removing BAD vertex! ");
884  }
885  } // for cycle
886 }
887 
888 void
890  double& ndf,
891  int& ntracks)
892 {
893  if (myxAODVertex) {
894  ndf = myxAODVertex->numberDoF();
895 
896  std::vector<Trk::VxTrackAtVertex> myVxTracksAtVtx =
897  myxAODVertex->vxTrackAtVertex();
898 
900  myVxTracksAtVtx.begin();
902  myVxTracksAtVtx.end();
903 
904  for (std::vector<Trk::VxTrackAtVertex>::iterator tracksIter = tracksBegin;
905  tracksIter != tracksEnd;
906  ++tracksIter) {
907  if ((*tracksIter).weight() > 0.01) {
908  ntracks += 1;
909  }
910  }
911  }
912 }
913 
914 void
916  xAOD::Vertex* myxAODVertex,
917  std::vector<const Trk::TrackParameters*>& perigeesToFit,
918  std::vector<Trk::ITrackLink*>& seedTracks) const
919 {
920  // now you have your new vertex with its new tracks
921  // now you have to get the compatibility also of all tracks which DIDN'T
922  // BELONG to the vertex!
923  std::vector<Trk::VxTrackAtVertex>* tracksAtVertex =
924  &(myxAODVertex->vxTrackAtVertex());
925 
926  std::vector<Trk::VxTrackAtVertex>::const_iterator tracksAtVertexBegin =
927  tracksAtVertex->begin();
928  std::vector<Trk::VxTrackAtVertex>::const_iterator tracksAtVertexEnd =
929  tracksAtVertex->end();
930 
931  std::vector<Trk::ITrackLink*>::iterator seedBegin = seedTracks.begin();
932  std::vector<Trk::ITrackLink*>::iterator seedEnd = seedTracks.end();
933 
935  perigeesToFit.begin();
937  perigeesToFit.end();
938 
939  for (std::vector<Trk::VxTrackAtVertex>::const_iterator tracksAtVertexIter =
940  tracksAtVertexBegin;
941  tracksAtVertexIter != tracksAtVertexEnd;
942  ++tracksAtVertexIter) {
943 
944  bool found = false;
945 
946  for (std::vector<Trk::ITrackLink*>::iterator seedIter = seedBegin;
947  seedIter != seedEnd;
948  ++seedIter) {
949  if ((*seedIter)->parameters() == (*tracksAtVertexIter).initialPerigee()) {
950  found = true;
951  if ((*tracksAtVertexIter).weight() > 0.01) {
952  seedTracks.erase(seedIter);
953  seedBegin = seedTracks.begin();
954  seedEnd = seedTracks.end();
955  }
956  break;
957  }
958  }
959 
960  if (!found) {
961  ATH_MSG_ERROR(" Cannot find vector element to delete (step 1)! ");
962  }
963 
964  found = false;
966  perigeesToFitBegin;
967  perigeesToFitIter != perigeesToFitEnd;
968  ++perigeesToFitIter) {
969  if (*perigeesToFitIter == (*tracksAtVertexIter).initialPerigee()) {
970  found = true;
971  if ((*tracksAtVertexIter).weight() > 0.01) {
972  perigeesToFit.erase(perigeesToFitIter);
973  perigeesToFitBegin = perigeesToFit.begin();
974  perigeesToFitEnd = perigeesToFit.end();
975  }
976  break;
977  }
978  }
979 
980  if (!found) {
981  ATH_MSG_ERROR(" Cannot find vector element to delete (step 2)! ");
982  }
983  } // finishing iterating on tracks at vertex
984 
985  std::vector<Trk::VxTrackAtVertex>* myVxTracksAtVertex =
986  &(myxAODVertex->vxTrackAtVertex());
987 
989  myVxTracksAtVertex->begin();
991  myVxTracksAtVertex->end();
992 
994  perigeesToFitBegin;
995  perigeesToFitIter != perigeesToFitEnd;
996  ++perigeesToFitIter) {
997  bool found = false;
998 
999  // compute the chi2 with respect to the last fitted vertex!
1000  //(easy since track was NOT used in the last vertex fit...)
1001 
1002  const Trk::TrackParameters* myPerigee = (*perigeesToFitIter);
1003 
1004  if (myPerigee == nullptr) {
1005  ATH_MSG_ERROR(" Cast to perigee gives null pointer ");
1006  return;
1007  }
1008 
1009  double chi2 = compatibility(*myPerigee, *myxAODVertex);
1010 
1011  // check if still sufficiently compatible to previous vertex
1012  //(CAN BE VERY LOOSE TO BE CONSERVATIVE AGAINST FAR OUTLIERS)
1015  seedTracks.begin();
1016  seedIter != seedEnd;
1017  ++seedIter) {
1018  if ((*seedIter)->parameters() == *perigeesToFitIter) {
1019  found = true;
1020  seedTracks.erase(seedIter);
1021  seedBegin = seedTracks.begin();
1022  seedEnd = seedTracks.end();
1023  break;
1024  }
1025  }
1026 
1027  if (!found) {
1028  ATH_MSG_ERROR(" Cannot find vector element to delete (step 3)! ");
1029  }
1030  } else {
1031  // look if the track is attached to the vertex. If this is the case you
1032  // should delete the track from the vertex!
1033  for (std::vector<Trk::VxTrackAtVertex>::iterator tracksIter = tracksBegin;
1034  tracksIter != tracksEnd;
1035  ++tracksIter) {
1036  if ((*tracksIter).initialPerigee() == *perigeesToFitIter) {
1037  // delete *tracksIter;
1038  // delete has to happen BEFORE the erase (because the iterator will
1039  // point to the next object in the vector AFTER the erase!)
1040  myVxTracksAtVertex->erase(tracksIter);
1041  tracksBegin = myVxTracksAtVertex->begin();
1042  tracksEnd = myVxTracksAtVertex->end();
1043  found = true;
1044  break;
1045  }
1046  }
1047  }
1048  } // iterate on all perigeesToFit
1049 }
1050 
1051 } // end namespace InDet
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
operator<
bool operator<(const DataVector< T > &a, const DataVector< T > &b)
Vector ordering relation.
RecVertex.h
LinkToTrack.h
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
InDet::InDetIterativePriVxFinderTool::m_maxVertices
IntegerProperty m_maxVertices
Definition: InDetIterativePriVxFinderTool.h:162
Trk::Vertex
Definition: Tracking/TrkEvent/VxVertex/VxVertex/Vertex.h:26
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
xAOD::Vertex_v1::setPosition
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
xAOD::Vertex_v1::setFitQuality
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
Definition: Vertex_v1.cxx:150
xAOD::VertexAuxContainer_v1
Temporary container used until we have I/O for AuxStoreInternal.
Definition: VertexAuxContainer_v1.h:32
TrackParameters.h
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDet::InDetIterativePriVxFinderTool::countTracksAndNdf
static void countTracksAndNdf(xAOD::Vertex *myxAODVertex, double &ndf, int &ntracks)
Definition: InDetIterativePriVxFinderTool.cxx:900
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
EventPrimitivesHelpers.h
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
Trk::z0
@ z0
Definition: ParamDefs.h:64
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
InDet::InDetIterativePriVxFinderTool::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: InDetIterativePriVxFinderTool.h:150
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
InDet::InDetIterativePriVxFinderTool::SGError
void SGError(const std::string &errService)
Definition: InDetIterativePriVxFinderTool.cxx:824
InDet::InDetIterativePriVxFinderTool::m_significanceCutSeeding
DoubleProperty m_significanceCutSeeding
Definition: InDetIterativePriVxFinderTool.h:159
InDet::InDetIterativePriVxFinderTool
Definition: InDetIterativePriVxFinderTool.h:71
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
InDet::InDetIterativePriVxFinderTool::finalize
virtual StatusCode finalize() override
Definition: InDetIterativePriVxFinderTool.cxx:810
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
xAOD::VertexContainer
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Definition: VertexContainer.h:14
x
#define x
ParamDefs.h
xAOD::VxType::NoVtx
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
Definition: TrackingPrimitives.h:570
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
AmgMatrix
#define AmgMatrix(rows, cols)
Definition: EventPrimitives.h:49
Trk::RecVertex
Trk::RecVertex inherits from Trk::Vertex.
Definition: RecVertex.h:44
InDet::InDetIterativePriVxFinderTool::removeAllFrom
void removeAllFrom(std::vector< const Trk::TrackParameters * > &perigeesToFit, std::vector< Trk::ITrackLink * > &seedTracks) const
Definition: InDetIterativePriVxFinderTool.cxx:860
xAOD::TrackParameters
TrackParameters_v1 TrackParameters
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParameters.h:11
Track.h
xAOD::VxType::VertexType
VertexType
Vertex types.
Definition: TrackingPrimitives.h:569
PixelModuleFeMask_create_db.remove
string remove
Definition: PixelModuleFeMask_create_db.py:83
xAOD::Vertex_v1::setVertexType
void setVertexType(VxType::VertexType vType)
Set the type of the vertex.
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
GeoPrimitives.h
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
InDet::InDetIterativePriVxFinderTool::m_createSplitVertices
BooleanProperty m_createSplitVertices
Definition: InDetIterativePriVxFinderTool.h:164
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
InDet::InDetIterativePriVxFinderTool::m_doMaxTracksCut
BooleanProperty m_doMaxTracksCut
Definition: InDetIterativePriVxFinderTool.h:171
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LinkToXAODTrackParticle.h
TrackParticleAuxContainer.h
InDet::InDetIterativePriVxFinderTool::m_reassignTracksAfterFirstFit
BooleanProperty m_reassignTracksAfterFirstFit
Definition: InDetIterativePriVxFinderTool.h:169
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
xAOD::VertexAuxContainer
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
Definition: VertexAuxContainer.h:19
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
beamspotman.n
n
Definition: beamspotman.py:731
InDet::InDetIterativePriVxFinderTool::m_LinearizedTrackFactory
ToolHandle< Trk::IVertexLinearizedTrackFactory > m_LinearizedTrackFactory
Definition: InDetIterativePriVxFinderTool.h:144
InDet::InDetIterativePriVxFinderTool::InDetIterativePriVxFinderTool
InDetIterativePriVxFinderTool(const std::string &t, const std::string &n, const IInterface *p)
Constructor.
Definition: InDetIterativePriVxFinderTool.cxx:58
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
MuonR4::inverse
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx:65
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::InDetIterativePriVxFinderTool::m_maximumChi2cutForSeeding
DoubleProperty m_maximumChi2cutForSeeding
Definition: InDetIterativePriVxFinderTool.h:161
error::ImpactPoint3dEstimatorProblem
Definition: IImpactPoint3dEstimator.h:72
InDet::InDetIterativePriVxFinderTool::printParameterSettings
virtual void printParameterSettings()
Internal method to print the parameters setting.
Definition: InDetIterativePriVxFinderTool.cxx:816
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
DataVector::front
const T * front() const
Access the first element in the collection as an rvalue.
Trk::LinkToTrack
AUTO - An Undocumented Tracking Object.
Definition: LinkToTrack.h:20
VxTrackAtVertex.h
Trk::LinkToXAODTrackParticle
Element link to XAOD TrackParticle.
Definition: LinkToXAODTrackParticle.h:33
InDet::InDetIterativePriVxFinderTool::m_iVertexFitter
ToolHandle< Trk::IVertexFitter > m_iVertexFitter
Definition: InDetIterativePriVxFinderTool.h:126
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrackSummary.h
Trk::ParametersBase
Definition: ParametersBase.h:55
DataVector< Trk::Track >
Vertex.h
EventPrimitives.h
InDet::InDetIterativePriVxFinderTool::m_useBeamConstraint
BooleanProperty m_useBeamConstraint
Definition: InDetIterativePriVxFinderTool.h:157
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
xAOD::VxType::PileUp
@ PileUp
Pile-up vertex.
Definition: TrackingPrimitives.h:573
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
Trk::d0
@ d0
Definition: ParamDefs.h:63
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:172
InDet::InDetIterativePriVxFinderTool::removeCompatibleTracks
void removeCompatibleTracks(xAOD::Vertex *myxAODVertex, std::vector< const Trk::TrackParameters * > &perigeesToFit, std::vector< Trk::ITrackLink * > &seedTracks) const
Definition: InDetIterativePriVxFinderTool.cxx:926
InDetIterativePriVxFinderTool.h
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
IDTPM::chiSquared
float chiSquared(const U &p)
Definition: TrackParametersHelper.h:126
xAOD::Vertex_v1::numberDoF
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
TrackParticle.h
InDet::InDetIterativePriVxFinderTool::m_ImpactPoint3dEstimator
ToolHandle< Trk::IImpactPoint3dEstimator > m_ImpactPoint3dEstimator
Definition: InDetIterativePriVxFinderTool.h:138
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
InDet::InDetIterativePriVxFinderTool::initialize
virtual StatusCode initialize() override
Definition: InDetIterativePriVxFinderTool.cxx:70
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
InDet::BeamSpotData
Definition: BeamSpotData.h:21
calibdata.delete
list delete
Definition: calibdata.py:46
VertexContainer.h
InDet::InDetIterativePriVxFinderTool::m_SeedFinder
ToolHandle< Trk::IVertexSeedFinder > m_SeedFinder
Definition: InDetIterativePriVxFinderTool.h:135
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
y
#define y
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
PlaneSurface.h
DeMoScan.first
bool first
Definition: DeMoScan.py:536
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
python.BuildSignatureFlags.beamSpot
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:454
dot
Definition: dot.py:1
Trk::PriVtx
@ PriVtx
Primary Vertex.
Definition: VertexType.h:27
xAOD::Vertex_v1::vxTrackAtVertex
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
Definition: Vertex_v1.cxx:181
AthAlgTool
Definition: AthAlgTool.h:26
FitQuality.h
test_pyathena.counter
counter
Definition: test_pyathena.py:15
InDet::InDetIterativePriVxFinderTool::m_maxTracks
UnsignedIntegerProperty m_maxTracks
Definition: InDetIterativePriVxFinderTool.h:172
InDet::InDetIterativePriVxFinderTool::findVertex
virtual std::pair< xAOD::VertexContainer *, xAOD::VertexAuxContainer * > findVertex(const EventContext &ctx, const TrackCollection *trackTES) const override
Find vertex from Trk::TrackCollection.
Definition: InDetIterativePriVxFinderTool.cxx:130
error
Definition: IImpactPoint3dEstimator.h:70
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
InDet::InDetIterativePriVxFinderTool::compatibility
double compatibility(const Trk::TrackParameters &measPerigee, const xAOD::Vertex &vertex) const
Definition: InDetIterativePriVxFinderTool.cxx:830
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAOD::Vertex_v1::setCovariancePosition
void setCovariancePosition(const AmgSymMatrix(3)&covariancePosition)
Sets the vertex covariance matrix.
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
TrackParticleContainer.h
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
VertexAuxContainer.h
InDet::InDetIterativePriVxFinderTool::~InDetIterativePriVxFinderTool
virtual ~InDetIterativePriVxFinderTool()
Destructor.
Trk::LinearizedTrack
Definition: LinearizedTrack.h:43
InDet::InDetIterativePriVxFinderTool::m_trkFilter
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkFilter
Definition: InDetIterativePriVxFinderTool.h:129
InDet::InDetIterativePriVxFinderTool::m_splitVerticesTrkInvFraction
IntegerProperty m_splitVerticesTrkInvFraction
Definition: InDetIterativePriVxFinderTool.h:166