29 inline double square(
const double tosquare) {
32 double dist(
const std::pair<Amg::Vector3D,Amg::Vector3D>& pairofpos) {
34 return std::sqrt(square(
diff.x())+square(
diff.y())+square(
diff.z()));
45 m_trackdistcutoff(0.020),
46 m_trackdistexppower(2),
47 m_constraintcutoff(9.),
49 m_maximumTracksNoCut(20),
50 m_maximumDistanceCut(3.)
70 return StatusCode::SUCCESS;
77 std::vector<const TrackParameters*> perigeeList;
78 for (
const auto *iter : VectorTrk) {
79 if (std::isnan(iter->perigeeParameters()->parameters()[
Trk::d0])) {
82 perigeeList.push_back(iter->perigeeParameters());
85 if (perigeeList.size()<2)
91 return findSeed(perigeeList,constraint);
97 bool useCutOnDistance=
false;
100 useCutOnDistance=
true;
108 weightMatrixPositionConstraint.setIdentity();
109 if (constraint !=
nullptr) {
110 weightMatrixPositionConstraint = constraint->covariancePosition().inverse();
114 std::vector<PositionAndWeight> CrossingPointsAndWeights;
115 std::vector<Amg::Vector3D> CrossingPoints;
118 const std::vector<const Trk::TrackParameters*>::const_iterator
begin=perigeeList.begin();
119 const std::vector<const Trk::TrackParameters*>::const_iterator
end=perigeeList.end();
121 for (std::vector<const Trk::TrackParameters*>::const_iterator
i=
begin;
i!=
end-1;++
i) {
125 ATH_MSG_WARNING(
"Neutrals not supported for seeding. Rejecting this track..." );
129 for (std::vector<const Trk::TrackParameters*>::const_iterator j=
i+1;j!=
end;++j) {
133 ATH_MSG_WARNING(
"Neutrals not supported for seeding. Rejecting this track..." );
137 #ifdef CROSSDISTANCESSEEDFINDER_DEBUG
145 std::optional<ITrkDistanceFinder::TwoPoints>
result
147 if (!
result) {
ATH_MSG_DEBUG(
"Problem with distance finder: THIS POINT WILL BE SKIPPED!" );
153 #ifdef CROSSDISTANCESSEEDFINDER_DEBUG
155 " y: " <<
result->first.y() <<
156 " z: " <<
result->first.z() );
158 " y: " <<
result->second.y() <<
159 " z: " <<
result->second.z() );
172 if (constraint!=
nullptr) {
176 ATH_MSG_DEBUG(
"position x: " << DeltaP.x() <<
"position y: " << DeltaP.y() <<
"position z: " << DeltaP.z() );
177 DeltaPConv[0]=DeltaP.x();
178 DeltaPConv[1]=DeltaP.y();
179 DeltaPConv[2]=DeltaP.z();
182 double chi2=DeltaPConv.transpose()*weightMatrixPositionConstraint*DeltaPConv;
192 CrossingPointsAndWeights.push_back(thispoint);
200 CrossingPoints.push_back(thispoint);
205 ATH_MSG_ERROR(
"Something wrong in distance calculation: please report..." );
214 if (CrossingPoints.empty() && CrossingPointsAndWeights.empty())
230 #ifdef CROSSDISTANCESSEEDFINDER_DEBUG
231 ATH_MSG_INFO(
"Resulting mean POINT FOUND: x: " << myresult.x() <<
232 " y: " << myresult.y() <<
233 " z: " << myresult.z() );
247 ATH_MSG_WARNING(
"Multi-seeding requested but seed finder not able to operate in that mode, returning no seeds" );
248 return std::vector<Amg::Vector3D>(0);
255 ATH_MSG_WARNING(
"Multi-seeding requested but seed finder not able to operate in that mode, returning no seeds" );
256 return std::vector<Amg::Vector3D>(0);