ATLAS Offline Software
Loading...
Searching...
No Matches
Mode3dFromFsmw1dFinder.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4//Author: Lianyou Shan <lianyou.shan@cern.ch>
5//#define Mode3dFromFsmw1d_DEBUG
6
10#include <cmath>
11
12namespace Trk
13{
14
15
16Mode3dFromFsmw1dFinder::Mode3dFromFsmw1dFinder(const std::string& t, const std::string& n, const IInterface* p) :
17 base_class(t,n,p),
21 m_minXYdist2Z( 0.03 ),
22 m_fraction(0.5),
23 m_minXYbeam( 1.5 ),
24 m_broaden(true)
25{
26 declareProperty("Fraction", m_fraction );
27 declareProperty("MinimalModeDistancePhi", m_minModeDistPhi ) ;
28 declareProperty("MinimalModeDistanceRadius", m_minModeDistR ) ;
29 declareProperty("MinimalModeDistanceZ", m_minModeDistZ ) ;
30 declareProperty("MinimalDistanceFromZtoXY", m_minXYdist2Z ) ;
31 declareProperty("MinimalRadiusFromBeam", m_minXYbeam ) ;
32 declareProperty("UseBroadenModes", m_broaden );
33}
34
35// DimensionsCorrelations :
36// 0 : single one from phi OR radius mode
37// 1 : phi mode with random Radius mode
38// 2 : phi mode with coincided radius mode => could terminate with (0,0,0)
39// 3 : 1 + random Z mode
40// 4 :
41// 5 :
42// 6 : phi mode with coincided radius mode then coincide with Z mode
43
44
47 const double vy,
48 const std::vector<Trk::PositionAndWeight> & VectorOfPoints) const
49{
51 return getMode (info, vx, vy, VectorOfPoints);
52}
53
54
57 const double vy,
58 const std::vector<Trk::PositionAndWeight> & VectorOfPoints,
59 std::unique_ptr<IMode3dInfo>& info) const
60
61{
62 auto myinfo_p = std::make_unique<Mode3dFromFsmw1dInfo>();
63 Mode3dFromFsmw1dInfo& myinfo = *myinfo_p;
64 info = std::move (myinfo_p);
65 return getMode (myinfo, vx, vy, VectorOfPoints);
66}
67
68
69//obtain the 3d-mode (position) from a list of positions (distribution in space) - NO WEIGHTS
72 const double /*vy*/,
73 const std::vector<Amg::Vector3D> & VectorOfPoints) const
74{
75 //create a vector of double values from a vector of "Point" objects
76
77 std::vector<Amg::Vector3D>::const_iterator begin = VectorOfPoints.begin();
78 std::vector<Amg::Vector3D>::const_iterator end = VectorOfPoints.end();
79
80 std::vector<double> allx;
81 std::vector<double> ally;
82 std::vector<double> allz;
83
84 for (std::vector<Amg::Vector3D>::const_iterator i = begin; i!=end; ++i) {
85 allx.push_back((*i).x());
86 ally.push_back((*i).y());
87 allz.push_back((*i).z());
88 }
89
90 // now find the mode separately for the distributions in x, y and z
96 return Amg::Vector3D( 0., 0., 0. ) ;
97}
98
99
102 const double vy,
103 const std::vector<Amg::Vector3D> & VectorOfPoints,
104 std::unique_ptr<IMode3dInfo>& /*info*/) const
105{
106 return getMode (vx, vy, VectorOfPoints);
107}
108
109
112 const double vx,
113 const double vy,
114 const std::vector<Trk::PositionAndWeight> & VectorOfPoints) const
115{
116
117 ATH_MSG_DEBUG(" enter getMode " );
118 //create a vector of double values from a vector of "Point" objects
119
120 std::vector<Trk::PositionAndWeight>::const_iterator begin = VectorOfPoints.begin();
121 std::vector<Trk::PositionAndWeight>::const_iterator end = VectorOfPoints.end();
122
123 Amg::Vector3D tmpseed( 0., 0., 0. ) ;
124
125 if ( VectorOfPoints.empty() ) return tmpseed ;
126 if ( VectorOfPoints.size() == 1 )
127 return Amg::Vector3D( begin->first.x(), begin->first.y(), begin->first.z() ) ;
128
129
130 std::vector< Amg::Vector3D > tmpphi;
131 std::vector< Amg::Vector3D > tmpradi;
132 std::vector< Amg::Vector3D > tmpz;
133 // re-organize/combine the value, index and weight of a point
134
135 int idx = 0 ; // the idx is unique among the three dimensions
136 std::vector<Trk::PositionAndWeight> vectorOfPoints ;
137
138 for (std::vector<PositionAndWeight>::const_iterator i = begin; i!=end; ++i) {
139 double wght = i->second ;
140 double px = i->first.x() ; if ( px == 0 ) px += 0.000001 ;
141 double py = i->first.y() ;
142 double phi = atan2 ( py, px ) ; // please speed up
143 double r = sqrt( px*px + py*py ) ;
144
145 // this Vector3D has no physics meaning of xyz position, just borrowing its form in tri-element
146 tmpphi.emplace_back( phi, wght, 1.0*idx ) ;
147 tmpradi.emplace_back( r, wght, 1.0*idx ) ;
148 tmpz.emplace_back( i->first.z(), wght, 1.0*idx ) ;
149
150 info.pushPoint (phi, r, i->first.z(), wght);
151 vectorOfPoints.push_back( *i ) ;
152
153 idx ++ ;
154 }
155
156 // sort then the indices will be scattered independently
157 std::sort( tmpphi.begin(), tmpphi.end(), Compare1dPosition() ) ;
158 std::sort( tmpradi.begin(), tmpradi.end(), Compare1dPosition() ) ;
159 std::sort( tmpz.begin(), tmpz.end(), Compare1dPosition() ) ;
160
161 std::vector< std::pair< std::pair <double, std::pair<int,int> >, double > > allphi;
162 std::vector< std::pair< std::pair <double, std::pair<int,int> >, double > > allradi;
163 std::vector< std::pair< std::pair <double, std::pair<int,int> >, double > > allz;
164
165 idx = 0 ;
166 for ( unsigned i = 0 ; i < tmpphi.size() ; i++ )
167 {
168 std::pair<int,int> xidphi( ( int)( tmpphi[i].z()), idx ) ;
169 std::pair<int,int> xidradi( ( int)( tmpradi[i].z() ), idx ) ;
170 std::pair<int,int> xidz( ( int)( tmpz[i].z() ), idx ) ;
171
172 std::pair <double, std::pair<int,int> > phi( tmpphi[i].x(), xidphi ) ;
173 std::pair <double, std::pair<int,int> > radi( tmpradi[i].x(), xidradi ) ;
174 std::pair <double, std::pair<int,int> > zz( tmpz[i].x(), xidz ) ;
175
176 std::pair< std::pair <double, std::pair<int,int> >, double > wghtphi( phi, tmpphi[i].y() ) ;
177 allphi.push_back( wghtphi ) ;
178 std::pair< std::pair <double, std::pair<int,int> >, double > wghtradi( radi, tmpradi[i].y() ) ;
179 allradi.push_back( wghtradi ) ;
180 std::pair< std::pair <double, std::pair<int,int> >, double > wghtz( zz, tmpz[i].y() ) ;
181 allz.push_back( wghtz ) ;
182
183 idx ++ ;
184 }
185
186 ATH_MSG_DEBUG( " Refilled and sorted " );
187 // now find the mode separately for the distributions in phi, R and Z
188 // the indices returned by FsmwMode1dFinder
189
190 bool phibroader = false ;
191 int phisz = doModeSearch( &info.m_idxphi, allphi, m_minModeDistPhi ) ;
192
193 if ( phisz == 0 )
194 {
195 ATH_MSG_DEBUG(" One more searching for a mode in phi !" );
196 phisz = doModeSearch( &info.m_idxphi, allphi, m_minModeDistPhi + 1 ) ;
197 phibroader = true ;
198 if ( phisz == 0 )
199 {
200 ATH_MSG_WARNING(" Failed to find a mode in phi !" );
201 return tmpseed ;
202 }
203 }
204 ATH_MSG_DEBUG( " " << phisz << " modes found along phi " );
205
206 bool radiusbroader = false ;
207 int radisz = doModeSearch( &info.m_idxradi, allradi, m_minModeDistR ) ;
208 if ( radisz == 0 )
209 {
210 ATH_MSG_DEBUG(" One more searching for a mode in radius !" );
211 radisz = doModeSearch( &info.m_idxradi, allradi, m_minModeDistR + 1 ) ;
212 radiusbroader = true ;
213 if ( radisz == 0 )
214 {
215 ATH_MSG_WARNING(" Failed to find a mode in radius !" );
216 return tmpseed ;
217 }
218 }
219 ATH_MSG_DEBUG( " " << radisz << " modes found along radius " );
220
221
222 int Zsz = doModeSearch( &info.m_idxZ, allz, m_minModeDistZ ) ;
223 if ( Zsz == 0 )
224 {
225 ATH_MSG_DEBUG(" One more searching for a mode in Z !" );
226 Zsz = doModeSearch( &info.m_idxZ, allz, m_minModeDistZ + 1 ) ;
227 if ( Zsz == 0 )
228 {
229 ATH_MSG_WARNING(" Failed to find a mode in Z !" );
230 return tmpseed ;
231 }
232 }
233 ATH_MSG_DEBUG( " " << Zsz << " modes found along Z " );
234
235 VeVecIndices olphiZ, olradiZ, ol_phi_radi_Z ;
236
237 double tmpsdX = 0., tmpsdY = 0., tmpsdXY = 0. ;
238
239 // check the correlation firstly in phi-Radius and return the most broad
240 VeVecIndices olphiradi = CheckCorrelation( info, vectorOfPoints, info.m_idxphi, info.m_idxradi ) ;
241
242 // some efforts to patch phi-Radius correlation
243 if ( olphiradi.empty() )
244 {
245 if ( phisz > 1 && radisz > 1 )
246 {
247 ATH_MSG_WARNING(" Nothing more than direct distance correlation !" );
248 return getClosestPair(info, vectorOfPoints, vx, vy) ;
249 }
250
251 ATH_MSG_DEBUG(" One more searching for a mode in phi or/and radius !" );
252
253 if ( phisz < 2 ) phisz += doModeSearch( &info.m_idxphi, allphi, m_minModeDistPhi ) ;
254 if ( radisz < 2 ) radisz += doModeSearch( &info.m_idxradi, allradi, m_minModeDistR ) ;
255 ATH_MSG_DEBUG( " " << " more modes found : " << phisz <<" "<< radisz );
256 olphiradi = CheckCorrelation( info, vectorOfPoints, info.m_idxphi, info.m_idxradi ) ;
257
258 if ( olphiradi.empty() )
259 {
260 // shall we clear phi-Radius modes and retry with larger MinimalModeDistance ?
261 if ( phibroader && radiusbroader )
262 {
263 olphiZ = CheckCorrelation( info, vectorOfPoints, info.m_idxphi, info.m_idxZ, 1 ) ;
264 olradiZ = CheckCorrelation( info, vectorOfPoints, info.m_idxradi, info.m_idxZ, 1 ) ;
265
266 if ( olphiZ.empty() && olradiZ.empty() )
267 tmpseed = Mode2Seed( info, vectorOfPoints, info.m_idxphi, info.m_idxradi, info.m_idxZ ) ;
268 else if ( !olphiZ.empty() && olradiZ.empty() )
269 tmpseed = Mode2Seed( info, vectorOfPoints, olphiZ, info.m_idxradi ) ;
270 else if ( olphiZ.empty() && !olradiZ.empty() )
271 tmpseed = Mode2Seed( info, vectorOfPoints, olradiZ, info.m_idxphi ) ;
272 else
273 {
274 ol_phi_radi_Z = CheckCorrelation( info, vectorOfPoints, info.m_idxphi, olradiZ, 1 ) ;
275 if ( ol_phi_radi_Z.empty() )
276 {
277 ATH_MSG_WARNING(" strange arrival at NON-correlation !" );
278 tmpseed = Mode2Seed( info, vectorOfPoints, info.m_idxphi, info.m_idxradi, info.m_idxZ ) ;
279 }
280 }
281 if ( tmpseed.z() == 0. ) return getClosestPair(info, vectorOfPoints, vx, vy) ;
282 tmpsdX = tmpseed.x() - vx ;
283 tmpsdY = tmpseed.y() - vy ;
284 tmpsdXY = sqrt( tmpsdX*tmpsdX + tmpsdY*tmpsdY ) ;
285 if (tmpsdXY > m_minXYbeam){
286 return tmpseed ;
287 }
288
289 return getClosestPair(info, vectorOfPoints, vx, vy);
290
291 } // end of Z mode preCorrelation search
292
293
294 ATH_MSG_DEBUG(" One more searching for WIDER mode in phi or/and radius !" );
295 if ( ! phibroader )
296 {
297 // info.m_idxphi.clear() ;
298 phisz = doModeSearch( &info.m_idxphi, allphi, m_minModeDistPhi + 1 ) ;
299 }
300
301 if ( ! radiusbroader )
302 {
303 // info.m_idxradi.clear() ;
304 radisz = doModeSearch( &info.m_idxradi, allradi, m_minModeDistR + 1 ) ;
305 }
306
307 olphiradi = CheckCorrelation( info, vectorOfPoints, info.m_idxphi, info.m_idxradi ) ;
308
309 if ( olphiradi.empty() )
310 {
311 olphiZ = CheckCorrelation( info, vectorOfPoints, info.m_idxphi, info.m_idxZ, 1 ) ;
312 olradiZ = CheckCorrelation( info, vectorOfPoints, info.m_idxradi, info.m_idxZ, 1 ) ;
313
314 if ( olphiZ.empty() && olradiZ.empty() )
315 tmpseed = Mode2Seed( info, vectorOfPoints, info.m_idxphi, info.m_idxradi, info.m_idxZ ) ;
316 else if ( !olphiZ.empty() && olradiZ.empty() )
317 tmpseed = Mode2Seed( info, vectorOfPoints, olphiZ, info.m_idxradi ) ;
318 else if ( olphiZ.empty() && !olradiZ.empty() )
319 tmpseed = Mode2Seed( info, vectorOfPoints, olradiZ, info.m_idxphi ) ;
320 else
321 {
322 ol_phi_radi_Z = CheckCorrelation( info, vectorOfPoints, info.m_idxphi, olradiZ, 1 ) ;
323 if ( ol_phi_radi_Z.empty() )
324 {
325 ATH_MSG_WARNING(" strange arrival at NON-correlation !" );
326 tmpseed = Mode2Seed( info, vectorOfPoints, info.m_idxphi, info.m_idxradi, info.m_idxZ ) ;
327 }
328 }
329 if ( tmpseed.z() == 0. ) return getClosestPair(info, vectorOfPoints, vx, vy) ;
330 tmpsdX = tmpseed.x() - vx ;
331 tmpsdY = tmpseed.y() - vy ;
332 tmpsdXY = sqrt( tmpsdX*tmpsdX + tmpsdY*tmpsdY ) ;
333 if ( tmpsdXY > m_minXYbeam ){
334 return tmpseed ;
335 }
336
337 return getClosestPair(info, vectorOfPoints, vx, vy);
338 }
339 // end of one more seach for BROADER modes
340 } // end of one more mode seach
341 }
342 ATH_MSG_DEBUG( " " << olphiradi.size() << " modes found with phi-radius correlated " );
343
344 ol_phi_radi_Z = CheckCorrelation( info, vectorOfPoints, olphiradi, info.m_idxZ, 1 ) ;
345 if ( ol_phi_radi_Z.empty() )
346 {
347 if ( Zsz < 2 )
348 {
349 ATH_MSG_DEBUG( " One more searching for a mode in Z after CheckCorrelation !" );
350 Zsz += doModeSearch( &info.m_idxZ, allz, m_minModeDistZ ) ;
351 ol_phi_radi_Z = CheckCorrelation( info, vectorOfPoints, olphiradi, info.m_idxZ, 1 ) ;
352
353 if ( ol_phi_radi_Z.empty() )
354 {
355 Zsz += doModeSearch( &info.m_idxZ, allz, m_minModeDistZ + 1 ) ;
356 ol_phi_radi_Z = CheckCorrelation( info, vectorOfPoints, olphiradi, info.m_idxZ, 1 ) ;
357
358 if ( ol_phi_radi_Z.empty() )
359 {
360 tmpseed = Mode2Seed( info, vectorOfPoints, olphiradi, info.m_idxZ ) ;
361 if ( tmpseed.z() == 0. ) return getClosestPair(info, vectorOfPoints, vx, vy) ;
362 tmpsdX = tmpseed.x() - vx ;
363 tmpsdY = tmpseed.y() - vy ;
364 tmpsdXY = sqrt( tmpsdX*tmpsdX + tmpsdY*tmpsdY ) ;
365 if (tmpsdXY > m_minXYbeam) {
366 return tmpseed;
367 }
368
369 return getClosestPair(info, vectorOfPoints, vx, vy);
370 // for ( unsigned int xy = 0 ; xy < olphiradi.size() ;
371 // xy ++ )
372 // ol_phi_radi_Z.push_back( olphiradi[xy] ) ;
373 }
374 }
375 }
376 }
377 ATH_MSG_DEBUG( " " << ol_phi_radi_Z.size()
378 << " modes found with phi-radius-Z fully correlated " );
379
380 // finaly we found the indices with phi-radius-Z correlated
381 // unfortunately it is the broadest rather than the narrowest
382 tmpseed = Mode2Seed( info, vectorOfPoints, ol_phi_radi_Z ) ;
383 if ( tmpseed.z() == 0. ) return getClosestPair(info, vectorOfPoints, vx, vy) ;
384 tmpsdX = tmpseed.x() - vx ;
385 tmpsdY = tmpseed.y() - vy ;
386 tmpsdXY = sqrt( tmpsdX*tmpsdX + tmpsdY*tmpsdY ) ;
387 if ( tmpsdXY > m_minXYbeam ){
388 return tmpseed ;
389 }
390
391 return getClosestPair(info, vectorOfPoints, vx, vy);
392}
393
394
396 const std::vector< IndexedWeighted > & position,
397 int expectMax ) const
398{
399 int got = 0 ;
400
401 int tot = position.size() ;
402 ATH_MSG_DEBUG(" total IndexedWeighted positions : " << tot );
403
404 unsigned int M = idxs->size() ;
405 ATH_MSG_DEBUG(" Number of found modes for split : " << M );
406
407 if ( M > 3 )
408 {
409 ATH_MSG_WARNING(" No necessary to search so many ( > 3 ) modes, skip " );
410 return got ;
411 }
412
413 std::vector< std::vector< IndexedWeighted > > position_OR ; // overlap removed
414 if ( M >= 1 )
415 {
416
417 if ( M >= 2 ) std::sort( idxs->begin(), idxs->end(), VecIndicesCompare() ) ;
418 // the overall region is splitted into M+1 intervals
419
420 for ( unsigned int splt = 0 ; splt < M + 1 ; splt ++ )
421 {
422 // below lines are tooo dirty ...
423 const std::vector< std::pair< int, int> >& idxplt =
424 ( splt == M ? (*idxs)[splt-1] : (*idxs)[splt] ) ;
425
426 int sz = idxplt.size() - 1 ;
427
428 std::vector<IndexedWeighted>::const_iterator origin = position.begin() ;
429 std::vector<IndexedWeighted>::const_iterator begin = origin ;
430 std::vector<IndexedWeighted>::const_iterator end = position.end() ;
431 int offset = 0 ;
432 if ( splt == 0 ) // in the smaller/left side of existing modes
433 {
434 offset = idxplt[0].second - 1 ;
435 ATH_MSG_VERBOSE( " offset = " << offset );
436 if ( offset > tot - 2 || offset <= 1 ) continue ;
437 end = origin + offset ;
438 } else if ( splt == M )
439 {
440 offset = idxplt[sz].second + 1 ;
441 ATH_MSG_VERBOSE(" offset = " << offset );
442 if ( offset > tot - 3 || offset < sz ) continue ;
443 begin = origin + offset ;
444 } else
445 {
446 const std::vector< std::pair< int, int> >& idxprevious = (*idxs)[splt-1] ;
447 offset = idxprevious.back().second ;
448 ATH_MSG_VERBOSE(" offset begin = " << offset );
449 if ( offset > tot - 3 || offset < sz + 1 ) continue ;
450 begin = origin + offset + 1 ;
451 offset = idxplt[0].second ;
452 if ( offset < 2 || offset >= tot - 2 ) continue ;
453 ATH_MSG_VERBOSE(" offset end = " << offset );
454 end = origin + offset - 1 ;
455 }
456
457 if ( end < begin + 2 ) continue ;
458
459 ATH_MSG_DEBUG(" new searching domain is defined in splitted region " << splt );
460 position_OR.emplace_back( begin, end ) ;
461 }
462 } else
463 position_OR.push_back( position ) ; // zero split
464
465 for ( unsigned int splt = 0 ; splt < position_OR.size() ; splt ++ )
466 {
467 ATH_MSG_DEBUG(" In split " << splt <<" after overlap removal " );
468 const std::vector< IndexedWeighted >& spltposi = position_OR[splt] ;
469 int spltgot = 0, lastgot = 0 ;
470 do
471 {
472 std::vector< std::pair< int,int> > idx_tmp = getFsmw1dMode( spltposi, expectMax ) ;
473 if ( !idx_tmp.empty() )
474 {
475 idxs->push_back( std::move(idx_tmp) ) ;
476 spltgot ++ ;
477 ATH_MSG_DEBUG(" Doing 1dMode Search : " << got );
478 }
479 if ( spltgot == lastgot ) break ; // failed search without mode found
480 lastgot = spltgot ;
481 if ( lastgot > 0 ) break ; // only one mode is expected in each search
482 //coverity[DEADCODE]
483 } while ( spltgot < expectMax ) ;
484 got += lastgot ;
485 }
486
487 ATH_MSG_DEBUG(" " << got << " One-dimension mode found " );
488
489 return got ;
490}
491
492
495 const std::vector<Trk::PositionAndWeight>& vectorOfPoints,
496 const VeVecIndices &aa,
497 const VeVecIndices &bb,
498 int zin ) const
499{
500 VeVecIndices corre ;
501
502 ATH_MSG_DEBUG(" Enter to check correlations " );
503
504// the indices/contents should not repeat within each of aa or bb
505 for ( unsigned int i = 0 ; i < aa.size() ; i++ )
506 {
507 bool hit = false ;
508 std::vector<std::pair< int, int> > ax = aa[i] ;
509
510 ATH_MSG_DEBUG( " " << i << " 'th mode to be matched " );
511
512 std::vector<int > axidx ;
513 for ( unsigned int ia = 0 ; ia < ax.size() ; ia ++ )
514 {
515 axidx.push_back( ax[ia].first ) ;
516 ATH_MSG_DEBUG(" mode " << ax[ia].first << " at " << ia );
517 }
518
519 std::vector< std::pair<int,int> > supp ; // merge crossings in both modes if correlated
520 std::vector< std::pair< int, int> > bx ;
521 for ( unsigned int j = 0 ; j < bb.size() ; j++ )
522 {
523 bx = bb[j] ;
524
525 ATH_MSG_DEBUG( " " << j << " 'th mode to check : " );
526
527 bool bhit = false ; // ax probably correlated more than one element from bb
528 for ( unsigned int k = 0 ; k < bx.size() ; k ++ )
529 {
530 std::vector<int>::iterator it = std::find( axidx.begin(), axidx.end(), bx[k].first ) ;
531 ATH_MSG_DEBUG( " " << k << " 'th crossing test : " << bx[k].first );
532 if ( it != axidx.end() )
533 {
534 ATH_MSG_DEBUG(" correlated crossing found : " << bx[k].first );
535 bhit = true ;
536 break ;
537 }
538 }
539
540 if ( bhit )
541 {
542 // merging ...
543 for ( unsigned int k = 0 ; k < bx.size() ; k ++ )
544 {
545 std::vector<int>::iterator it = std::find( axidx.begin(), axidx.end(), bx[k].first ) ;
546 ATH_MSG_VERBOSE( " " << k << " 'th crossing test : " << bx[k].first );
547 if ( it == axidx.end() )
548 {
549 ATH_MSG_DEBUG(" extra indices supplemented : " << bx[k].first );
550 supp.emplace_back( bx[k].first, bx[k].second ) ;
551 }
552 }
553 hit = true ;
554 }
555 }
556
557 if ( hit )
558 {
559 supp.insert( supp.end(), ax.begin(), ax.end() ) ;
560 corre.push_back( std::move(supp) ) ;
561 }
562
563 }
564
565#ifdef Mode3dFromFsmw1d_DEBUG
566 if ( corre.size() == 0 ) return corre ;
567#else
568 if ( !corre.empty() ) return corre ;
569#endif
570
571 ATH_MSG_DEBUG(" Korrelation failed by indices match, now try 3D distance ... " );
572
573 double mindistcut = 999999999.9 , mindist = 999999999.9 ;
574
575 for (auto ax : aa)
576 {
577 double Awght = 0. ;
578 double aX = 0., aY = 0., aZ = 0. ;
579 std::vector<int > axidx ;
580 for (auto & ia : ax)
581 {
582 int idxA = ia.first ;
583 axidx.push_back( idxA ) ;
584
585 std::vector<Trk::PositionAndWeight>::const_iterator Aposi = vectorOfPoints.begin() + idxA ;
586
587 ATH_MSG_DEBUG(" Mode idx accepted with full phi-radius correlation : " << idxA );
588
589 double wght = Aposi->second ;
590 aX += Aposi->first.x()*wght ;
591 aY += Aposi->first.y()*wght ;
592 aZ += Aposi->first.z()*wght ;
593 Awght += wght ;
594 }
595
596 if ( Awght > 0 )
597 {
598 aX /= Awght ;
599 aY /= Awght ;
600 aZ /= Awght ;
601 } else
602 continue ;
603
604 std::vector< std::pair<int,int> > supp ; // merge crossings in both modes if correlated
605 double bX = 0., bY = 0., bZ = 0., Bwght = 0. ;
606 for (const auto& bx : bb)
607 {
608 for (const auto & ib : bx)
609 {
610 int idxB = ib.first ;
611 std::vector<Trk::PositionAndWeight>::const_iterator Bposi = vectorOfPoints.begin() + idxB ;
612
613 double wght = Bposi->second ;
614
615 bX = Bposi->first.x()*wght ;
616 bY = Bposi->first.y()*wght ;
617 bZ = Bposi->first.z()*wght ;
618 Bwght += wght ;
619 }
620 if ( Bwght > 0 )
621 {
622 bX /= Bwght ;
623 bY /= Bwght ;
624 bZ /= Bwght ;
625 } else
626 continue ;
627
628 bX -= aX ;
629 bY -= aY ;
630 bZ -= aZ ;
631
632 double dist = ( bX*bX + bY*bY + bZ*bZ )/( Awght + Bwght ) ;
633
634 if ( dist < mindist )
635 {
636 mindist = dist ;
637 mindistcut = sqrt( dist*( Awght + Bwght ) ) ;
638
639 ATH_MSG_DEBUG(" Distance between modes for Korrelation : " << mindistcut );
640
641 if ( mindistcut > ( zin == 0 ? m_minXYdist2Z : 10.*m_minXYdist2Z ) ) continue ;
642
643#ifdef Mode3dFromFsmw1d_DEBUG
644 info.setCorre (zin, mindistcut);
645#endif
646
647 supp.clear() ;
648 corre.clear() ;
649
650 for (const auto & m : bx)
651 {
652 std::vector<int>::iterator it = std::find( axidx.begin(), axidx.end(), m.first ) ;
653 if ( it == axidx.end() ) supp.emplace_back( m.first, m.second ) ;
654 }
655 supp.insert( supp.end(), ax.begin(), ax.end() ) ;
656 corre.push_back( supp ) ;
657 }
658 }
659 }
660
661 return corre ;
662}
663
664
665std::vector< std::pair< int, int > >
666Mode3dFromFsmw1dFinder::getFsmw1dMode( const std::vector< IndexedWeighted > & posidxwght,
667 int minModeDiff) const
668{
669 // the 1st is the absolute index from initial crossings
670 // the 2nd is the new index after sorting
671 std::vector< std::pair< int, int > > idx(0) ;
672
673 //ok now begin to consider a certain number of elements according to the fraction
674 std::vector<IndexedWeighted>::const_iterator origin = posidxwght.begin();
675 std::vector<IndexedWeighted>::const_iterator begin= origin ;
676 std::vector<IndexedWeighted>::const_iterator end=posidxwght.end();
677
678 double overallweight(0.);
679 std::vector<IndexedWeighted>::const_iterator best_begin=begin;
680 std::vector<IndexedWeighted>::const_iterator best_end=end;
681
682 double last_value(1e100);
683
684 bool isthelast=false;
685
686 if ( posidxwght.size() == 1 )
687 {
688 std::vector<IndexedWeighted>::const_iterator mid = posidxwght.begin();
689 idx.emplace_back( mid->first.second.first, mid->first.second.second ) ;
690 return idx ;
691 }
692
693 while ( ! isthelast )
694 {
695
696// the begin & end are dynamic/updatable during while loop.
697 int step = (int)std::floor( m_fraction * ( end - begin + 1 ) );
698 overallweight=0.;
699 // the total weights between begin and begin+step-1
700 if ( step < minModeDiff ) break ;
701
702 std::vector<IndexedWeighted>::const_iterator j_end= begin+step-1;
703 for (std::vector<IndexedWeighted>::const_iterator j=begin;j!=j_end;++j)
704 overallweight+=j->second;
705
706 step -- ; // since ( step - 1 ) will be frequently used in the following
707
708// begin => b , end => e , fraction => f , step => s = f*( e - b + 1 )
709// b b+s-1 e-s+1 e
710// |.....................|........................|.....................|
711//
712
713 std::vector<IndexedWeighted>::const_iterator i_last = begin+step;
714 for (std::vector<IndexedWeighted>::const_iterator i=begin;i!=(end-step);++i, ++i_last)
715 {
716
717 //calculate the weight the interval should be divided into,
718 // between ( begin+step-1 ) and the end
719 overallweight+= i_last->second;
720
721 double new_value = ( ( (i+step)->first ).first - ( i->first ).first )/overallweight;
722 ATH_MSG_VERBOSE(" new value found : " << new_value << " with step "
723 << step + 1 <<" at best "<< best_end - best_begin );
724
725 if ( new_value < last_value )
726 {
727 last_value= new_value ;
728 best_begin=i;
729 best_end=i+step;
730 ATH_MSG_VERBOSE(" iteration take place : " );
731 }
732 overallweight -= i->second;
733 ATH_MSG_VERBOSE(" overallweight in total : " << overallweight );
734
735 } // end_of_loop_between b and e-s+1
736
737 //assign the new begin and end...
738 begin=best_begin ;
739 end=best_end ;
740 last_value = 1e100 ;
741
742 //Now it should have returned the value with smallest (x2-x1)/weight
743
744 if ( best_end - best_begin <= minModeDiff )
745 {
746 ATH_MSG_DEBUG(" closest = " << best_end - best_begin );
747 isthelast=true;
748 }
749 } // end_of_while
750
751 if ( isthelast ) // otherwise above while-loop will sink dead
752 {
753// at least four crossing points will be expected
754 std::vector<IndexedWeighted>::const_iterator mid = posidxwght.begin();
755
756// if ( m_broaden && ( best_end - best_begin ) == 1 && best_begin != mid )
757 if ( m_broaden && ( best_end - best_begin ) <= 2 && best_begin != mid )
758 {
759 mid = best_begin - 1 ;
760 idx.emplace_back( mid->first.second.first, mid->first.second.second ) ;
761 ATH_MSG_DEBUG(" found 1d mode " << ( mid->first ).first <<" "
762 << ( mid->first ).second.first <<" "<< mid->first.second.second );
763 }
764
765// at least two crossing points will be collected
766 for ( mid = best_begin ; mid != best_end ; ++mid )
767 {
768 // the indexed position
769 idx.emplace_back( mid->first.second.first, mid->first.second.second ) ;
770 ATH_MSG_DEBUG(" found 1d mode " << ( mid->first ).first <<" "
771 << ( mid->first ).second.first <<" "<< mid->first.second.second );
772 }
773
774// if ( m_broaden && ( best_end - best_begin ) == 1 )
775 if ( m_broaden && ( best_end - best_begin ) <= 2 )
776 {
777 mid = posidxwght.end();
778 if ( best_end != mid )
779 {
780 mid = best_end ;
781 idx.emplace_back( mid->first.second.first, mid->first.second.second ) ;
782 ATH_MSG_DEBUG(" found 1d mode " << ( mid->first ).first <<" "
783 << ( mid->first ).second.first <<" "<< mid->first.second.second );
784 }
785 }
786 }
787
788 return idx ;
789}
790
791
794 const std::vector<Trk::PositionAndWeight>& vectorOfPoints,
795 const double vx,
796 const double vy) const
797{
798 ATH_MSG_DEBUG(" enter getMode " );
799 //create a vector of double values from a vector of "Point" objects
800
801 unsigned int sizeVP = vectorOfPoints.size() ;
802 if ( sizeVP == 0 ) return Amg::Vector3D( 0, 0, 0 ) ;
803 if ( sizeVP == 1 )
804 return Amg::Vector3D( vectorOfPoints.begin()->first.x(),
805 vectorOfPoints.begin()->first.y(),
806 vectorOfPoints.begin()->first.z() ) ;
807
808 std::vector<Trk::PositionAndWeight> VP = vectorOfPoints ;
809 std::sort( VP.begin(), VP.end(), CompareWeight() ) ;
810
811 unsigned int offset = 0 ;
812
813 std::vector<Trk::PositionAndWeight>::const_iterator pwitr = VP.begin() ;
814
815 for ( ; pwitr != VP.end() ; ++pwitr, ++offset)
816 {
817 double X = ( pwitr->first ).x() - vx ;
818 double Y = ( pwitr->first ).y() - vy ;
819 double XY = sqrt( X*X + Y*Y ) ;
820
821 if ( XY > m_minXYbeam ) break ;
822 }
823
824 if ( offset >= sizeVP ) return Amg::Vector3D( 0, 0, 0 ) ;
825
826 pwitr = VP.begin() + offset ;
827
828 for ( unsigned int mpw = 0 ; mpw < vectorOfPoints.size() ; mpw ++ )
829 {
830 Trk::PositionAndWeight tmp = vectorOfPoints[ mpw ] ;
831 if ( ( tmp.first ).x() == ( pwitr->first ).x()
832 && ( tmp.first ).y() == ( pwitr->first ).y()
833 && ( tmp.first ).z() == ( pwitr->first ).z()
834 )
835 {
836 info.pushIndex ( mpw ) ;
837 break ;
838 }
839 }
840
841 double wght = pwitr->second ;
842 double inv_wght = 1. / wght ;
843 double seedX = ( pwitr->first ).x() ;
844 double seedY = ( pwitr->first ).y() ;
845 double seedZ = ( pwitr->first ).z() ;
846 double wt = 0. ;
847
848 for (std::vector<PositionAndWeight>::const_iterator i = pwitr + 1 ; i!=VP.end(); ++i )
849 {
850 double sdX = ( i->first ).x() ;
851 double sdY = ( i->first ).y() ;
852 double sdZ = ( i->first ).z() ;
853
854 sdX -= seedX ;
855 sdY -= seedY ;
856 sdZ -= seedZ ;
857
858 double dist = sqrt( sdX*sdX + sdY*sdY + sdZ*sdZ ) ;
859
860 if ( dist < 0.1 )
861 {
862 sdX += seedX ;
863 sdY += seedY ;
864 sdZ += seedZ ;
865 wt = i->second ;
866 seedX = seedX*wght + sdX*wt ;
867 seedY = seedY*wght + sdY*wt ;
868 seedZ = seedZ*wght + sdZ*wt ;
869 wght += wt ;
870 }
871
872 }
873
874 if ( wt != 0 )
875 {
876 seedX *= inv_wght ;
877 seedY *= inv_wght ;
878 seedZ *= inv_wght ;
879 }
880
881 return Amg::Vector3D( seedX, seedY, seedZ);
882}
883
884
887 const std::vector<Trk::PositionAndWeight>& vectorOfPoints,
888 const VeVecIndices & phiradiZol ) const
889{
890 double seedX = 0., seedY = 0., seedZ = 0. ;
891 double maxWght = -99.9 ;
892 for (const auto& modes : phiradiZol)
893 {
894 double totwght = 0. ;
895 double seedX0 = 0., seedY0 = 0., seedZ0 = 0. ;
896 for (const auto & mode : modes)
897 {
898
899 int idx = mode.first ;
900 ATH_MSG_DEBUG(" Mode idx accepted with full phi-radius-Z correlation : " << idx );
901
902 std::vector<Trk::PositionAndWeight>::const_iterator posi = vectorOfPoints.begin() + idx ;
903 double wght = posi->second ;
904 seedX0 += posi->first.x()*wght ;
905 seedY0 += posi->first.y()*wght ;
906 seedZ0 += posi->first.z()*wght ;
907 totwght += wght ;
908 }
909 if (totwght == 0.)[[unlikely]]{
910 ATH_MSG_ERROR("Mode2Seed: Divisor 'totwght' is zero.");
911 return {};
912 }
913 // one will use the correlated crossings where largest weights reside.
914 if ( totwght > maxWght )
915 {
916 maxWght = totwght ;
917 seedX = seedX0/totwght ;
918 seedY = seedY0/totwght ;
919 seedZ = seedZ0/totwght ;
920
921 info.pushIndices (modes);
922 }
923 }
924
925 return Amg::Vector3D( seedX, seedY, seedZ);
926 // check the overlap/consitence among dimensions
927}
928
929
932 const std::vector<Trk::PositionAndWeight>& vectorOfPoints,
933 const VeVecIndices & phiradi,
934 const VeVecIndices & Z ) const
935{
936 double mindistcut = 999999999.9 , mindist = 999999999.9 ;
937 double seedX = 0., seedY = 0., seedZ = 0. ;
938
939 for (const auto& xymodes : phiradi)
940 {
941 double xywght = 0. ;
942 double xyX = 0., xyY = 0., xyZ = 0. ;
943 for (const auto & xymode : xymodes)
944 {
945 int idxXY = xymode.first ;
946 std::vector<Trk::PositionAndWeight>::const_iterator posi = vectorOfPoints.begin() + idxXY ;
947
948 ATH_MSG_DEBUG( " Mode idx accepted with full phi-radius correlation : " << idxXY );
949
950 double wght = posi->second ;
951 xyX += posi->first.x()*wght ;
952 xyY += posi->first.y()*wght ;
953 xyZ += posi->first.z()*wght ;
954 xywght += wght ;
955 }
956
957 if ( xywght > 0 )
958 {
959 xyX /= xywght ;
960 xyY /= xywght ;
961 xyZ /= xywght ;
962 } else
963 continue ;
964
965 double zX = 0., zY = 0., zZ = 0., zwght = 0. ;
966 for (const auto& zmodes : Z)
967 {
968 for (const auto & zmode : zmodes)
969 {
970 int idxZ = zmode.first ;
971 std::vector<Trk::PositionAndWeight>::const_iterator zposi = vectorOfPoints.begin() + idxZ ;
972
973 double wghtZ = zposi->second ;
974
975 zX = zposi->first.x()*wghtZ ;
976 zY = zposi->first.y()*wghtZ ;
977 zZ = zposi->first.z()*wghtZ ;
978 zwght += wghtZ ;
979 }
980
981 if ( zwght > 0 )
982 {
983 zX /= zwght ;
984 zY /= zwght ;
985 zZ /= zwght ;
986 } else
987 continue ;
988
989 zX -= xyX ;
990 zY -= xyY ;
991 zZ -= xyZ ;
992
993 double dist = ( zX*zX + zY*zY + zZ*zZ )/( xywght + zwght ) ;
994
995 if ( dist < mindist )
996 {
997 mindist = dist ;
998 mindistcut = sqrt( dist*( xywght + zwght ) ) ;
999
1000 if ( mindistcut > 10.*m_minXYdist2Z ) continue ;
1001
1002 double totwght = xywght + zwght ;
1003 zX += xyX ;
1004 zY += xyY ;
1005 zZ += xyZ ;
1006 seedX = ( xyX*xywght + zX*zwght )/totwght ;
1007 seedY = ( xyY*xywght + zY*zwght )/totwght ;
1008 seedZ = ( xyZ*xywght + zZ*zwght )/totwght ;
1009
1010 info.pushIndices (xymodes);
1011 info.pushIndices (zmodes);
1012 }
1013 }
1014 }
1015
1016 return Amg::Vector3D( seedX, seedY, seedZ ) ;
1017}
1018
1019
1022 const std::vector<Trk::PositionAndWeight>& vectorOfPoints,
1023 const VeVecIndices & phi,
1024 const VeVecIndices & radi,
1025 const VeVecIndices & Z ) const
1026{
1027 double mindistcut = 999999999.9 , mindist = 999999999.9 ;
1028 double seedX = 0., seedY = 0., seedZ = 0. ;
1029
1030 for (const auto& pmodes : phi)
1031 {
1032 double pwght = 0. ;
1033 double pX = 0., pY = 0., pZ = 0. ;
1034
1035 for (const auto & pmode : pmodes)
1036 {
1037 int idxp = pmode.first ;
1038 std::vector<Trk::PositionAndWeight>::const_iterator pposi = vectorOfPoints.begin() + idxp ;
1039 double xw = pposi->second ;
1040 pX += pposi->first.x()*xw ;
1041 pY += pposi->first.y()*xw ;
1042 pZ += pposi->first.z()*xw ;
1043 pwght += xw ;
1044 }
1045
1046 if ( pwght > 0 )
1047 {
1048 pX /= pwght ;
1049 pY /= pwght ;
1050 pZ /= pwght ;
1051 } else
1052 continue ;
1053
1054 for (const auto& rmodes : radi)
1055 {
1056 double rwght = 0. ;
1057 double rX = 0., rY = 0., rZ = 0. ;
1058
1059 for (const auto & rmode : rmodes)
1060 {
1061 int idxr = rmode.first ;
1062 std::vector<Trk::PositionAndWeight>::const_iterator rposi = vectorOfPoints.begin() + idxr ;
1063 double xw = rposi->second ;
1064 rX += rposi->first.x()*xw ;
1065 rY += rposi->first.y()*xw ;
1066 rZ += rposi->first.z()*xw ;
1067 rwght += xw ;
1068 }
1069
1070 if ( rwght > 0 )
1071 {
1072 rX /= rwght ;
1073 rY /= rwght ;
1074 rZ /= rwght ;
1075 } else
1076 continue ;
1077
1078 double Dxy = ( ( pX - rX )*( pX - rX ) + ( pY - rY )*( pY - rY )
1079 + ( pZ - rZ )*( pZ - rZ ) )/( pwght + rwght ) ;
1080
1081 for (const auto& zmodes : Z)
1082 {
1083 double zwght = 0. ;
1084 double zX = 0., zY = 0., zZ = 0. ;
1085
1086 for (const auto & zmode : zmodes)
1087 {
1088 int idxz = zmode.first ;
1089 std::vector<Trk::PositionAndWeight>::const_iterator zposi = vectorOfPoints.begin() + idxz ;
1090 double xw = zposi->second ;
1091 zX += zposi->first.x()*xw ;
1092 zY += zposi->first.y()*xw ;
1093 zZ += zposi->first.z()*xw ;
1094 zwght += xw ;
1095 }
1096
1097 if ( zwght > 0 )
1098 {
1099 zX /= zwght ;
1100 zY /= zwght ;
1101 zZ /= zwght ;
1102 } else
1103 continue ;
1104
1105 double distpz = ( pX - zX )*( pX - zX ) + ( pY - zY )*( pY - zY )
1106 + ( pZ - zZ )*( pZ - zZ ) ;
1107 double distrz = ( rX - zX )*( rX - zX ) + ( rY - zY )*( rY - zY )
1108 + ( rZ - zZ )*( rZ - zZ ) ;
1109 double dist = distpz/( pwght + zwght ) + distrz/( rwght + zwght ) + Dxy ;
1110
1111
1112 if ( dist < mindist )
1113 {
1114 mindist = dist ;
1115
1116 mindistcut = 0.3333*( sqrt( distpz ) + sqrt( distrz ) + sqrt( Dxy*( pwght + rwght ) ) ) ;
1117
1118 if ( mindistcut > 10.*m_minXYdist2Z ) continue ;
1119
1120 double totwght = pwght + rwght + zwght ;
1121 seedX = ( pX*pwght + rX*rwght + zX*zwght )/totwght ;
1122 seedY = ( pY*pwght + rY*rwght + zY*zwght )/totwght ;
1123 seedX = ( pZ*pwght + rZ*rwght + zZ*zwght )/totwght ;
1124
1125 info.pushIndices (pmodes);
1126 info.pushIndices (rmodes);
1127 info.pushIndices (zmodes);
1128 }
1129 }
1130 }
1131 }
1132
1133 return Amg::Vector3D( seedX, seedY, seedZ ) ;
1134}
1135
1136
1137
1138unsigned int
1140 ( std::vector<float> & phi,
1141 std::vector<float> & radi,
1142 std::vector<float> & z,
1143 std::vector<float> & wght ) const
1144{
1145 std::vector<int> allidx ;
1146
1147 for (const VecIndices& tmp : m_idxphi) {
1148 for (const std::pair<int, int >& p : tmp) {
1149 allidx.push_back( p.first ) ;
1150 }
1151 }
1152
1153 for (const VecIndices& tmp : m_idxradi) {
1154 for (const std::pair<int, int >& p : tmp) {
1155 if (std::find( allidx.begin(), allidx.end(), p.first ) == allidx.end()) {
1156 allidx.push_back( p.first ) ;
1157 }
1158 }
1159 }
1160
1161 for (const VecIndices& tmp : m_idxZ) {
1162 for (const std::pair<int, int >& p : tmp) {
1163 if (std::find( allidx.begin(), allidx.end(), p.first ) == allidx.end()) {
1164 allidx.push_back( p.first ) ;
1165 }
1166 }
1167 }
1168
1169 unsigned int min = allidx.size() ;
1170 phi.reserve (min);
1171 radi.reserve (min);
1172 z.reserve (min);
1173 wght.reserve (min);
1174
1175 for (int idx : allidx) {
1176 phi.push_back( m_phi_stk[idx] ) ;
1177 radi.push_back( m_radi_stk[idx] ) ;
1178 z.push_back( m_z_stk[idx] ) ;
1179 wght.push_back( m_wght_stk[idx] ) ;
1180 }
1181
1182 return min ;
1183}
1184
1185
1186const std::vector<int>&
1191
1192
1193void
1195 ( double &cXY, double &cZ ) const
1196{
1197 cXY = m_correXY;
1198 cZ = m_correZ;
1199}
1200
1201
1202int
1204 (std::vector<const Trk::TrackParameters*>& perigees ,
1205 const std::vector<const Trk::TrackParameters*> & perigeeList) const
1206{
1207 perigees.clear() ;
1208 std::vector<int> trklist(0) ;
1209
1210 for (int ndx : m_UsedCrossingPointsIndices) {
1211 std::pair<int,int> trk = m_trkidx.at( ndx ) ;
1212
1213 if ( std::find( trklist.begin(), trklist.end(), trk.first ) == trklist.end() )
1214 trklist.push_back( trk.first ) ;
1215 if ( std::find( trklist.begin(), trklist.end(), trk.second ) == trklist.end() )
1216 trklist.push_back( trk.second ) ;
1217 }
1218
1219 std::sort( trklist.begin(), trklist.end() ) ;
1220
1221 for (int t : trklist)
1222 {
1223 perigees.push_back( perigeeList[t] ) ;
1224 }
1225
1226 return perigees.size() ;
1227}
1228
1229
1230void
1235
1236
1237void
1239 (std::vector< std::pair <int, int> >&& trkidx)
1240{
1241 m_trkidx = std::move (trkidx);
1242}
1243
1244
1245void
1247 (const std::vector< std::pair<int,int> >& modes)
1248{
1249 for (const std::pair<int,int>& p : modes) {
1250 m_UsedCrossingPointsIndices.push_back( p.first ) ;
1251 }
1252}
1253
1254
1255void
1257 (float phi, float r, float z, float w)
1258{
1259 m_phi_stk.push_back (phi);
1260 m_radi_stk.push_back (r);
1261 m_z_stk.push_back (z);
1262 m_wght_stk.push_back (w);
1263}
1264
1265
1266void
1268{
1269 if ( zin == 0 )
1270 m_correXY = corre;
1271 else
1272 m_correZ = corre;
1273}
1274
1275
1276} // namespace Trk
1277
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
bool hit(const Container &ids, int pdgId)
static Double_t sz
std::vector< VecIndices > VeVecIndices
std::vector< std::pair< int, int > > VecIndices
#define min(a, b)
Definition cfImp.cxx:40
virtual unsigned int Modes1d(std::vector< float > &, std::vector< float > &, std::vector< float > &, std::vector< float > &) const override final
void pushPoint(float phi, float r, float z, float w)
virtual void setTrkidx(std::vector< std::pair< int, int > > &&trkidx) override final
void pushIndices(const std::vector< std::pair< int, int > > &modes)
virtual void getCorrelationDistance(double &cXY, double &cZ) const override
virtual const std::vector< int > & AcceptedCrossingPointsIndices() const override
virtual int perigeesAtSeed(std::vector< const Trk::TrackParameters * > &perigees, const std::vector< const Trk::TrackParameters * > &perigeeList) const override final
std::vector< std::pair< int, int > > getFsmw1dMode(const std::vector< IndexedWeighted > &, int) const
VeVecIndices CheckCorrelation(Mode3dFromFsmw1dInfo &info, const std::vector< Trk::PositionAndWeight > &vectorOfPoints, const VeVecIndices &, const VeVecIndices &, int zin=0) const
int doModeSearch(VeVecIndices *idxs, const std::vector< IndexedWeighted > &position, int expectMax) const
Mode3dFromFsmw1dFinder(const std::string &t, const std::string &n, const IInterface *p)
virtual Amg::Vector3D getMode(const double vx, const double vy, const std::vector< Trk::PositionAndWeight > &points) const override final
Obtain the 3d-mode (position) from a list of positions (distribution in space).
Amg::Vector3D getClosestPair(Mode3dFromFsmw1dInfo &info, const std::vector< Trk::PositionAndWeight > &vectorOfPoints, const double vx, const double vy) const
Amg::Vector3D Mode2Seed(Mode3dFromFsmw1dInfo &info, const std::vector< Trk::PositionAndWeight > &vectorOfPoints, const VeVecIndices &) const
int r
Definition globals.cxx:22
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
std::pair< Amg::Vector3D, double > PositionAndWeight
@ x
Definition ParamDefs.h:55
@ z
global position (cartesian)
Definition ParamDefs.h:57
@ y
Definition ParamDefs.h:56
@ phi
Definition ParamDefs.h:75
@ px
Definition ParamDefs.h:59
@ py
Definition ParamDefs.h:60
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
#define unlikely(x)