ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Trk::Trk2DDistanceFinder Class Referencefinal

#include <Trk2DDistanceFinder.h>

Inheritance diagram for Trk::Trk2DDistanceFinder:
Collaboration diagram for Trk::Trk2DDistanceFinder:

Public Member Functions

 Trk2DDistanceFinder (const std::string &t, const std::string &n, const IInterface *p)
 
virtual ~Trk2DDistanceFinder ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual std::optional< TwoPointsCalculateMinimumDistance (const Trk::Perigee &, const Trk::Perigee &) const override final
 method to do the calculation starting from two MeasuredPerigees More...
 
virtual std::optional< TwoPointsCalculateMinimumDistance (const Trk::Track &, const Trk::Track &) const override final
 method to do the calculation starting from two tracks More...
 

Private Attributes

ToolHandle< Trk2dDistanceSeederm_2ddistanceseeder
 
std::atomic< int > m_numberOfMinimizationFailures
 

Detailed Description

Algotool which calculates the distance between the two tracks in 2d only, re-using the Trk2dDistanceSeeder tool, which is based on the analytic solution of the minimum distance between two circles.

Of the two possible solutions, in Trk2dDistanceSeeder the one which minimizes the distance in z is used. (not sure this is what we want to find an approximate beam spot position event by event during primary vertex finding).

Author
giaci.nosp@m.nto..nosp@m.piacq.nosp@m.uadi.nosp@m.o@cer.nosp@m.n.ch

Definition at line 38 of file Trk2DDistanceFinder.h.

Constructor & Destructor Documentation

◆ Trk2DDistanceFinder()

Trk::Trk2DDistanceFinder::Trk2DDistanceFinder ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 30 of file Trk2DDistanceFinder.cxx.

32  {
33  declareProperty("Trk2dDistanceSeeder", m_2ddistanceseeder);
34  }
35 

◆ ~Trk2DDistanceFinder()

Trk::Trk2DDistanceFinder::~Trk2DDistanceFinder ( )
virtualdefault

Member Function Documentation

◆ CalculateMinimumDistance() [1/2]

std::optional< ITrkDistanceFinder::TwoPoints > Trk::Trk2DDistanceFinder::CalculateMinimumDistance ( const Trk::Perigee a,
const Trk::Perigee b 
) const
finaloverridevirtual

method to do the calculation starting from two MeasuredPerigees

If successful, returns the points on the two tracks at minimum distance.

return value is true if calculation is successfull

Definition at line 62 of file Trk2DDistanceFinder.cxx.

62  {
63  std::pair<PointOnTrack,PointOnTrack> minpoints;
65 
66  try {
67  minpoints=m_2ddistanceseeder->GetSeed(TwoTracks(a,b), &points);
68  } catch (...) {
69  ATH_MSG_WARNING( "Problem with 2d analytic minimum distance finder" );
71  return std::nullopt;
72  }
73 
74 
75 #ifdef SEEDNEWTONTRKDISTANCEFINDER_DEBUG
76  ATH_MSG_DEBUG( "Returned a_phi " << minpoints.first.getPhiPoint() );
77  ATH_MSG_DEBUG( "Returned b_phi " << minpoints.second.getPhiPoint() );
78 #endif
79 
80  return points;
81 
82  }
83 

◆ CalculateMinimumDistance() [2/2]

std::optional< ITrkDistanceFinder::TwoPoints > Trk::Trk2DDistanceFinder::CalculateMinimumDistance ( const Trk::Track a,
const Trk::Track b 
) const
finaloverridevirtual

method to do the calculation starting from two tracks

Definition at line 88 of file Trk2DDistanceFinder.cxx.

88  {
89  if (std::isnan(a.perigeeParameters()->parameters()[Trk::d0])||std::isnan(b.perigeeParameters()->parameters()[Trk::d0])) {
90  ATH_MSG_ERROR( "Nan parameters in tracks. Cannot use them" );
91  return std::nullopt;
92  }
93 
94  return CalculateMinimumDistance(*(a.perigeeParameters()),*(b.perigeeParameters()));
95  }
96 
97 } // namespace Trk

◆ finalize()

StatusCode Trk::Trk2DDistanceFinder::finalize ( )
overridevirtual

Definition at line 52 of file Trk2DDistanceFinder.cxx.

52  : " << m_numberOfMinimizationFailures << ". Few per events is OK!" );
53  return StatusCode::SUCCESS;
54  }
55 
56 

◆ initialize()

StatusCode Trk::Trk2DDistanceFinder::initialize ( )
overridevirtual

Definition at line 40 of file Trk2DDistanceFinder.cxx.

51  {

Member Data Documentation

◆ m_2ddistanceseeder

ToolHandle<Trk2dDistanceSeeder> Trk::Trk2DDistanceFinder::m_2ddistanceseeder
private

Definition at line 61 of file Trk2DDistanceFinder.h.

◆ m_numberOfMinimizationFailures

std::atomic<int> Trk::Trk2DDistanceFinder::m_numberOfMinimizationFailures
mutableprivate

Definition at line 62 of file Trk2DDistanceFinder.h.


The documentation for this class was generated from the following files:
Trk::TwoPoints
std::pair< Amg::Vector3D, Amg::Vector3D > TwoPoints
Definition: SeedFinderParamDefs.h:20
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
Trk::Trk2DDistanceFinder::~Trk2DDistanceFinder
virtual ~Trk2DDistanceFinder()
Trk::Trk2DDistanceFinder::m_numberOfMinimizationFailures
std::atomic< int > m_numberOfMinimizationFailures
Definition: Trk2DDistanceFinder.h:62
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::Trk2DDistanceFinder::CalculateMinimumDistance
virtual std::optional< TwoPoints > CalculateMinimumDistance(const Trk::Perigee &, const Trk::Perigee &) const override final
method to do the calculation starting from two MeasuredPerigees
Definition: Trk2DDistanceFinder.cxx:62
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::d0
@ d0
Definition: ParamDefs.h:63
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::Trk2DDistanceFinder::m_2ddistanceseeder
ToolHandle< Trk2dDistanceSeeder > m_2ddistanceseeder
Definition: Trk2DDistanceFinder.h:61
jobOptions.points
points
Definition: jobOptions.GenevaPy8_Zmumu.py:97