39 return StatusCode::SUCCESS;
45 return StatusCode::SUCCESS;
53 std::vector<const TrackParameters*> perigeeList;
55 std::vector<const Trk::Track*>::const_iterator begin=VectorTrk.begin();
56 std::vector<const Trk::Track*>::const_iterator end=VectorTrk.end();
58 for (std::vector<const Trk::Track*>::const_iterator iter=begin;
61 perigeeList.push_back((*iter)->perigeeParameters());
65 return findSeed(perigeeList,constraint);
72 if ( !perigeeList.empty() )
75 ATH_MSG_DEBUG(
"Highest density Z position found: " << zResult);
79 ATH_MSG_DEBUG(
"No tracks with sufficient weight; return z position = 0");
94 std::pair<double,double> zResult {0.,0.};
95 if ( !perigeeList.empty() )
98 ATH_MSG_DEBUG(
"Highest density Z position found: " << zResult.first <<
"with width: " << zResult.second);
102 ATH_MSG_DEBUG(
"No tracks with sufficient weight; return z position = 0");
108 Amg::MatrixX covarianceMatrix = constraint->covariancePosition() ;
110 ATH_MSG_DEBUG(
"The vertex seed width is " << zResult.second);
116 if(std::isnan(zResult.second)){
117 positionVector[2] = 0.;
119 else covarianceMatrix.fillSymmetric(2,2,std::pow(zResult.second,2.));
121 return std::make_pair(positionVector,covarianceMatrix) ;
127 for(
const auto i : {0,1,2} ){
128 for(
const auto j : {0,1,2}){
129 covarianceMatrix(i,j)=0;
132 return {positionVector,covarianceMatrix};
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);
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);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
virtual ~TrackDensitySeedFinder()
ToolHandle< IVertexTrackDensityEstimator > m_densityEstimator
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 ...
TrackDensitySeedFinder(const std::string &t, const std::string &n, const IInterface *p)
virtual std::pair< Amg::Vector3D, Amg::MatrixX > findAnalyticSeed(const std::vector< const Trk::TrackParameters * > &perigeeList, const xAOD::Vertex *constraint=0) const override final
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.
const Amg::Vector3D & position() const
Returns the 3-pos.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
Vertex_v1 Vertex
Define the latest version of the vertex class.