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

#include <TrackDensitySeedFinder.h>

Inheritance diagram for Trk::TrackDensitySeedFinder:
Collaboration diagram for Trk::TrackDensitySeedFinder:

Public Member Functions

 TrackDensitySeedFinder (const std::string &t, const std::string &n, const IInterface *p)
 
virtual ~TrackDensitySeedFinder ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual Amg::Vector3D findSeed (const std::vector< const Trk::Track * > &vectorTrk, const xAOD::Vertex *constraint=0) const override final
 Finds a linearization point out of a vector of tracks and returns it as an Amg::Vector3D object. More...
 
virtual Amg::Vector3D findSeed (const std::vector< const Trk::TrackParameters * > &perigeeList, const xAOD::Vertex *constraint=0) const override final
 Finds a linearization point out of a vector of TrackParameters and returns it as an Amg::Vector3D object. More...
 
virtual std::pair< Amg::Vector3D, Amg::MatrixXfindAnalyticSeed (const std::vector< const Trk::TrackParameters * > &perigeeList, const xAOD::Vertex *constraint=0) const override final
 
virtual std::vector< Amg::Vector3DfindMultiSeeds (const std::vector< const Trk::Track * > &vectorTrk, const xAOD::Vertex *constraint=0) const override final
 Finds full vector of linearization points from a vector of tracks and returns it as an Amg::Vector3D object. More...
 
virtual std::vector< Amg::Vector3DfindMultiSeeds (const std::vector< const Trk::TrackParameters * > &perigeeList, const xAOD::Vertex *constraint=0) const override final
 Finds full vector of linearization points from a vector of TrackParameters and returns it as an Amg::Vector3D object. More...
 
virtual Amg::Vector3D findSeed (const std::vector< const Trk::Track * > &vectorTrk, const xAOD::Vertex *constraint=0) const=0
 Finds a linearization point out of a vector of tracks and returns it as an Amg::Vector3D object. More...
 
virtual Amg::Vector3D findSeed (const std::vector< const Trk::TrackParameters * > &perigeeList, const xAOD::Vertex *constraint=0) const=0
 Finds a linearization point out of a vector of TrackParameters and returns it as an Amg::Vector3D object. More...
 
virtual Amg::Vector3D findSeed (const double, const double, const std::vector< const Trk::TrackParameters * > &perigeeList, const xAOD::Vertex *constraint=0) const
 Finds a linearization point out of a vector of TrackParameters and returns it as an Amg::Vector3D object. More...
 
virtual Amg::Vector3D findSeed (const double, const double, std::unique_ptr< Trk::IMode3dInfo > &, const std::vector< const Trk::TrackParameters * > &perigeeList, const xAOD::Vertex *constraint=0) const
 Finds a linearization point out of a vector of TrackParameters and returns it as an Amg::Vector3D object. More...
 

Private Attributes

ToolHandle< IVertexTrackDensityEstimatorm_densityEstimator
 

Detailed Description

Definition at line 29 of file TrackDensitySeedFinder.h.

Constructor & Destructor Documentation

◆ TrackDensitySeedFinder()

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

Definition at line 27 of file TrackDensitySeedFinder.cxx.

27  {
28  }
29 
30 

◆ ~TrackDensitySeedFinder()

Trk::TrackDensitySeedFinder::~TrackDensitySeedFinder ( )
virtualdefault

Member Function Documentation

◆ finalize()

StatusCode Trk::TrackDensitySeedFinder::finalize ( )
overridevirtual

Definition at line 44 of file TrackDensitySeedFinder.cxx.

◆ findAnalyticSeed()

std::pair< Amg::Vector3D, Amg::MatrixX > Trk::TrackDensitySeedFinder::findAnalyticSeed ( const std::vector< const Trk::TrackParameters * > &  perigeeList,
const xAOD::Vertex constraint = 0 
) const
finaloverridevirtual

Definition at line 95 of file TrackDensitySeedFinder.cxx.

96  {
97  zResult = m_densityEstimator->globalMaximumWithWidth (perigeeList);
98  ATH_MSG_DEBUG("Highest density Z position found: " << zResult.first << "with width: " << zResult.second);
99  }
100  else
101  {
102  ATH_MSG_DEBUG("No tracks with sufficient weight; return z position = 0");
103  }
104 
105  if (constraint)
106  {
107  Amg::Vector3D positionVector = Amg::Vector3D(constraint->position().x(), constraint->position().y(), zResult.first + constraint->position().z());
108  Amg::MatrixX covarianceMatrix = constraint->covariancePosition() ;
109 
110  ATH_MSG_DEBUG("The vertex seed width is " << zResult.second);
111 
112  // if no seed is found, we get a NaN here.
113  // This should not propagate through the vertex fit.
114  // The upstream code aborts if position[z] == 0, which we need to ensure.
115  // In this case, the cov matrix will not be used.
116  if(std::isnan(zResult.second)){
117  positionVector[2] = 0.;
118  }
119  else covarianceMatrix.fillSymmetric(2,2,std::pow(zResult.second,2.));
120 
121  return std::make_pair(positionVector,covarianceMatrix) ;
122  }
123  else
124  {
125  Amg::Vector3D positionVector = Amg::Vector3D(0.,0.,zResult.first);
126  Amg::MatrixX covarianceMatrix;
127  for(const auto i : {0,1,2} ){
128  for(const auto j : {0,1,2}){
129  covarianceMatrix(i,j)=0;
130  }
131  }
132  return {positionVector,covarianceMatrix};
133  }
134 }
135 
136  std::vector<Amg::Vector3D> TrackDensitySeedFinder::findMultiSeeds(const std::vector<const Trk::Track*>& /* vectorTrk */,

◆ findMultiSeeds() [1/2]

std::vector< Amg::Vector3D > Trk::TrackDensitySeedFinder::findMultiSeeds ( const std::vector< const Trk::Track * > &  vectorTrk,
const xAOD::Vertex constraint = 0 
) const
finaloverridevirtual

Finds full vector of linearization points from a vector of tracks and returns it as an Amg::Vector3D object.

Intended for seed finders that produce all at once. If you want an additional constraint can be taken into account.

Definition at line 138 of file TrackDensitySeedFinder.cxx.

138  {
139  //implemented to satisfy inheritance but this algorithm only supports one seed at a time
140  ATH_MSG_WARNING("Multi-seeding requested but seed finder not able to operate in that mode, returning no seeds");
141  return std::vector<Amg::Vector3D>(0);
142  }
143 
144  std::vector<Amg::Vector3D> TrackDensitySeedFinder::findMultiSeeds(const std::vector<const Trk::TrackParameters*>& /* perigeeList */,

◆ findMultiSeeds() [2/2]

std::vector< Amg::Vector3D > Trk::TrackDensitySeedFinder::findMultiSeeds ( const std::vector< const Trk::TrackParameters * > &  perigeeList,
const xAOD::Vertex constraint = 0 
) const
finaloverridevirtual

Finds full vector of linearization points from a vector of TrackParameters and returns it as an Amg::Vector3D object.

Intended for seed finders that produce all at once. If you want an additional constraint can be taken into account.

Definition at line 146 of file TrackDensitySeedFinder.cxx.

146  {
147  //implemented to satisfy inheritance but this algorithm only supports one seed at a time
148  ATH_MSG_WARNING("Multi-seeding requested but seed finder not able to operate in that mode, returning no seeds");
149  return std::vector<Amg::Vector3D>(0);
150  }
151 
152 

◆ findSeed() [1/6]

virtual Amg::Vector3D Trk::IVertexSeedFinder::findSeed
inline

Finds a linearization point out of a vector of TrackParameters and returns it as an Amg::Vector3D object.

If you want an additional constraint can be taken into account. Must specify the primary vertex position.

Definition at line 79 of file IVertexSeedFinder.h.

83  {
84  return findSeed (perigeeList, constraint);
85  }

◆ findSeed() [2/6]

virtual Amg::Vector3D Trk::IVertexSeedFinder::findSeed
inline

Finds a linearization point out of a vector of TrackParameters and returns it as an Amg::Vector3D object.

If you want an additional constraint can be taken into account. Must specify the primary vertex position. Allows returning additional diagnostic information.

Definition at line 96 of file IVertexSeedFinder.h.

101  {
102  return findSeed (perigeeList, constraint);
103  }

◆ findSeed() [3/6]

Amg::Vector3D Trk::TrackDensitySeedFinder::findSeed ( const std::vector< const Trk::Track * > &  vectorTrk,
const xAOD::Vertex constraint = 0 
) const
finaloverridevirtual

Finds a linearization point out of a vector of tracks and returns it as an Amg::Vector3D object.

If you want an additional constraint can be taken into account.

Definition at line 50 of file TrackDensitySeedFinder.cxx.

50  {
51 
52  //create perigees from track list
53  std::vector<const TrackParameters*> perigeeList;
54 
55  std::vector<const Trk::Track*>::const_iterator begin=VectorTrk.begin();
56  std::vector<const Trk::Track*>::const_iterator end=VectorTrk.end();
57 
58  for (std::vector<const Trk::Track*>::const_iterator iter=begin;
59  iter!=end;++iter)
60  {
61  perigeeList.push_back((*iter)->perigeeParameters());
62  }
63 
64  //create seed from perigee list
65  return findSeed(perigeeList,constraint);
66  }
67 
68  Amg::Vector3D TrackDensitySeedFinder::findSeed(const std::vector<const Trk::TrackParameters*> & perigeeList,

◆ findSeed() [4/6]

virtual Amg::Vector3D Trk::IVertexSeedFinder::findSeed

Finds a linearization point out of a vector of tracks and returns it as an Amg::Vector3D object.

If you want an additional constraint can be taken into account.

◆ findSeed() [5/6]

Amg::Vector3D Trk::TrackDensitySeedFinder::findSeed ( const std::vector< const Trk::TrackParameters * > &  perigeeList,
const xAOD::Vertex constraint = 0 
) const
finaloverridevirtual

Finds a linearization point out of a vector of TrackParameters and returns it as an Amg::Vector3D object.

If you want an additional constraint can be taken into account.

Definition at line 70 of file TrackDensitySeedFinder.cxx.

70  {
71  double zResult {0.};
72  if ( !perigeeList.empty() )
73  {
74  zResult = m_densityEstimator->globalMaximum (perigeeList);
75  ATH_MSG_DEBUG("Highest density Z position found: " << zResult);
76  }
77  else
78  {
79  ATH_MSG_DEBUG("No tracks with sufficient weight; return z position = 0");
80  }
81 
82  if (constraint)
83  {
84  return Amg::Vector3D(constraint->position().x(), constraint->position().y(), zResult + constraint->position().z());
85  }
86  else
87  {
88  return Amg::Vector3D(0.,0.,zResult);
89  }
90  }
91 
92  // testing find seed with width

◆ findSeed() [6/6]

virtual Amg::Vector3D Trk::IVertexSeedFinder::findSeed

Finds a linearization point out of a vector of TrackParameters and returns it as an Amg::Vector3D object.

If you want an additional constraint can be taken into account.

◆ initialize()

StatusCode Trk::TrackDensitySeedFinder::initialize ( )
overridevirtual

Definition at line 37 of file TrackDensitySeedFinder.cxx.

43  {

Member Data Documentation

◆ m_densityEstimator

ToolHandle<IVertexTrackDensityEstimator> Trk::TrackDensitySeedFinder::m_densityEstimator
private
Initial value:
{
this,
"DensityEstimator",
"Trk::GaussianTrackDensity",
"Track density tool"
}

Definition at line 92 of file TrackDensitySeedFinder.h.


The documentation for this class was generated from the following files:
Trk::TrackDensitySeedFinder::m_densityEstimator
ToolHandle< IVertexTrackDensityEstimator > m_densityEstimator
Definition: TrackDensitySeedFinder.h:92
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
Trk::TrackDensitySeedFinder::findMultiSeeds
virtual std::vector< Amg::Vector3D > findMultiSeeds(const std::vector< const Trk::Track * > &vectorTrk, const xAOD::Vertex *constraint=0) const override final
Finds full vector of linearization points from a vector of tracks and returns it as an Amg::Vector3D ...
Definition: TrackDensitySeedFinder.cxx:138
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::TrackDensitySeedFinder::findSeed
virtual Amg::Vector3D findSeed(const std::vector< const Trk::Track * > &vectorTrk, const xAOD::Vertex *constraint=0) const override final
Finds a linearization point out of a vector of tracks and returns it as an Amg::Vector3D object.
Definition: TrackDensitySeedFinder.cxx:50