Skip to content

MuonSegmentTagging - Recycle MS intersections

Hi,

this is another episode of the series 'speed up' the muon reconstruction software. This time the target is MuTagIMO. The algorithm as it is today extrapolates the ID track candidate through all 3 MS stations to find close-by segments. The step is indeed necessary to perform segment tagging at all, but also super expensive and it's also been done before in MuonInsideOut. The only reason why segment tagging has not exploded thus far in terms of CPU is the tight segment preselection & that the algorithm is scheduled after MuIdCo in the current master.

grafik grafik

However, the scenery changes once we are looking at super high pile-up where MuTagIMO is expected to be the second top CPU consumer. This MR takes out the shovel and beats the CPU time of this algorithm as I'll demonstrate below. But first let's come to the changes.

  • As already said the extrapolations of the ID candidates were already made before and are available as Intersections. Instead of going from one predefined MSSurface to the next, the algorithm first searches the closest InterSections and skips extrapolation to the particular surface in case it found one. In any case, the algorithm extrapolates - and has been also doing in the past - to the close-by segments to perform the segment matching.
  • The procedure to test each MS station was quite cumbersome. It was a blind loop overall 12 categories, where the BEE category was excluded for what-ever reason & a rough close-by check of the segments was performed beforehand to avoid unnecessary extrapolations beforehand. If a previous extrapolation failed the entire game started from the Calo exit again. Segments are now presorted into the 11 Surface categories in two steps. A general sorting in the first step. In the second step, the segments are roughly matched to the candidate. Instead of the perigee parameters, the calo exit is chosen as a reference point. The dPhi cut is replaced by the requirement that segment & track have to be on the same or the neighboring sector & the dTheta cut could be tightened to an overall 0.2.
  • The MuTagMatchingTool relied on string comparisons to match segment surfaces & to determine whether the segments are on the desired surface or not. Super cumbersome & error-prone. This interface has been much simplified now.
  • Move the MSSurfaces from the MuonCombinedBaseTools to the MuonCombinedEvent & clean-up of the MuonSegmentTag classes + removal of dangling pointers.

To test that the refactored algorithm preserves physics performance & is actually faster than the current version, a sample of 250k particle gun muons is reconstructed with & without the patch. To avoid the high efficiency of MuidCo killing all stats, all other combined algorithms were disabled. In MC_Comparison.pdf, you can find comparisons against eta, phi, pt, etc. in different regions of the detector. In most cases, a perfect match is achieved, in some, the revised MuTagIMO performs even better.

The measured CPU times are

Revised: 248274.15349502373
Master:  4581296.953238002

or in other words only 5% of the resources are consumed. The same test is performed also in 25k data events. Results are given in Data_Comparisons.pdf. In general, fewer muons are segment-tagged now, which I interpret as a more efficient reduction of the fakes given that particle gun shows a perfect agreement.

The measured CPU times are

Revised: 201528.98866201888
Master:  2362924.0044650105

or the improved alg is about 8% of the alg in terms of CPU

Tagging: @amete, @goblirsc, @iliadis, @mvanadia, @gabarone, @yoyamagu, @sroe, @npetters

Edited by Johannes Junggeburth

Merge request reports