If you want an additional constraint can be taken into account. Must specify the primary vertex position. Allows returning additional diagnostic information.
94 {
96
97 bool useCutOnDistance=false;
99 {
100 useCutOnDistance=true;
101 }
102
103
104
105
107 weightMatrixPositionConstraint.setIdentity();
108 if (constraint !=
nullptr) {
109 weightMatrixPositionConstraint = constraint->covariancePosition().inverse();
110 }
111
112
113 std::vector<PositionAndWeight> CrossingPointsAndWeights;
114 std::vector<Amg::Vector3D> CrossingPoints;
115
116
117 const std::vector<const Trk::TrackParameters*>::const_iterator
begin=perigeeList.begin();
118 const std::vector<const Trk::TrackParameters*>::const_iterator
end=perigeeList.end();
119
120 ATH_MSG_DEBUG(
" Loop pairs of TrackParameters for modes " );
121
122 std::vector< std::pair <int, int> > trkidx ;
123 int idx_i = 0 ;
124 for (std::vector<const Trk::TrackParameters*>::const_iterator i=begin;
i!=
end-1;++
i)
125 {
126 idx_i ++ ;
128 if (MyI==nullptr) {
129 ATH_MSG_WARNING(
"Neutrals not supported for seeding. Rejecting this track..." );
130 continue;
131 }
132
133 int idx_j = idx_i ;
134 for (std::vector<const Trk::TrackParameters*>::const_iterator j=i+1;j!=
end;++j++) {
135
136 idx_j ++ ;
138
139 if (MyJ==nullptr) {
140 ATH_MSG_WARNING(
"Neutrals not supported for seeding. Rejecting this track..." );
141 continue;
142 }
143
144
145 try {
146
147 std::optional<ITrkDistanceFinder::TwoPoints>
result
149 if (!result) {
ATH_MSG_DEBUG(
"Problem with distance finder: THIS POINT WILL BE SKIPPED!");
150 }
151 else
152 {
153
155#ifdef CROSSDISTANCESSEEDFINDER_DEBUG
157 " y: " <<
result->first.y() <<
158 " z: " <<
result->first.z() );
160 " y: " <<
result->second.y() <<
161 " z: " <<
result->second.z() );
163#endif
164
166
168 {
171
173
174 if (constraint!=nullptr) {
175
178 ATH_MSG_DEBUG(
"position x: " << DeltaP.x() <<
"position y: " << DeltaP.y() <<
"position z: " << DeltaP.z() );
179 DeltaPConv[0]=DeltaP.x();
180 DeltaPConv[1]=DeltaP.y();
181 DeltaPConv[2]=DeltaP.z();
182
183
184 double chi2=DeltaPConv.transpose()*weightMatrixPositionConstraint*DeltaPConv;
185
188
190
191 }
192
194 {
195 CrossingPointsAndWeights.push_back( thispoint );
196
197 trkidx.emplace_back( idx_i - 1 , idx_j - 1 );
198
200 << MyI->parameters()[
Trk::d0] <<
" "<< idx_j - 1 <<
" "
201 << MyJ->parameters()[
Trk::d0] );
202
203 }
204 }
205 else
206 {
209 {
210 CrossingPoints.push_back( thispoint );
211 }
212 }
213 }
214 } catch (...) {
215 ATH_MSG_ERROR(
"Something wrong in distance calculation: please report..." );
216 }
217 }
218
219 }
220
221
222
223
225 || (
m_useweights && CrossingPointsAndWeights.empty() ) )
226 {
228 }
229
230 ATH_MSG_DEBUG(
" crossing points prepared : " << CrossingPointsAndWeights.size() );
231
233
235 {
236 myresult=
m_mode3dfinder->getMode(vx, vy, CrossingPointsAndWeights, info);
237 }
238 else
239 {
241 }
242
243 info->setTrkidx (std::move (trkidx));
245
246 return myresult;
247
248 }
#define ATH_MSG_VERBOSE(x)
#define AmgSymMatrix(dim)
constexpr int pow(int base, int exp) noexcept
ToolHandle< ITrkDistanceFinder > m_distancefinder
ToolHandle< IMode3dFinder > m_mode3dfinder
const Amg::Vector3D & position() const
Returns the 3-pos.
double chi2(TH1 *h0, TH1 *h1)
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Eigen::Matrix< double, 3, 1 > Vector3D
std::pair< Amg::Vector3D, double > PositionAndWeight
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee