Skip to content

Further tune AMVF + gaussian density vertex seed finder CPU

This MR attempts to further identify and address performance bottlenecks in the AMVF + Gaussian seed finder combination, following up on the work started in !30672 (merged) and documented in ATLIDTRKCP-245.

A first changeset removes an expensive use of map<Perigee,TrackEntry> in the trackDensity method, which was using a lot of CPU for memory allocation and freeing due to the creation/destruction of Perigee deep-copies (~1e6 copies per event). The current iteration instead uses a simple loop over the existing, cached track map, leading to identical reco outputs with improved speed. Dropping the application of the m_maxRange filtering cut applied so far does not affect the reco outcome either in this test or in a mu=200 ttbar test with ITk in 21.9. The vertexing experts are however of course invited to double check if they are happy with this.

The speedup, while visible here, is more significant when running with the ITk in an upgrade release, where we run with tighter AMFV cuts, giving a larger weight to the seeder in the total vertexing CPU (separate MR !31636 (merged)). This is also due to the gaussian finder time scaling quadratically with the track multiplicity.

In addition, the MR fixes a bug within the TrackDensitySeedFinder. This tool unfortunately relies on a rather fragile way of signaling via the returned seed position (!) whether it is out of seeds. Previously, the beam spot constraint would be applied "out of seeds" return value of z=0 before the return, resulting in a position !=0 and the full AMVF machinery keeping running with invalid seeds for quite some time. This bug has a major performance impact, with the fix improving the speed of the vertexing algorithm by a factor of 3 (66% CPU reduction).

Together, this MR reduces the time for primary vertex finding with AMVF+GaussianSeeder in 25 test ttbar data18 events from around 23% of the track finding time to around 5.9%, which should hopefully make it much more feasible for use in the regular r3 and ITk reconstruction chain.

Adding @npetters / @sroe, @vcairo / @glee / @kostyuk / @dcasper as well as @nstyles who might be interested in trying these changes in 21.9 too.

Edited by Maximilian Emanuel Goblirsch-Kolb

Merge request reports