Skip to content

Remove remaining const_casts from CombinedMuonTrackBuilder

William Axel Leight requested to merge wleight/athena:ATLASRECTS-1973 into master

None of the the const_casts involved objects from SG. One was totally unnecessary, and the others were only needed because CombinedMuonTrackBuilder was using ITrackFitter interfaces, which assumed const tracks. As it turns out, there is only one case in which the ITrackFitter interface to the CombinedMuonTrackBuilder was actually used, by the MuonSegmentRegionRecoveryTool, which uses the global chi2 fitter in EO-only mode, and the CombinedMuonTrackBuilder otherwise. So a CombinedMuonTrackBuilder ToolHandle has been added to the MuonSegmentRegionRecoveryTool, and the configuration updated appropriately. Depending on whether m_onlyEO is true or false, the appropriate tool is retrieved and used in the fit. The interfaces in ICombinedMuonTrackBuilder are now non-const in cases where a const track is not expected, and the const_casts have been removed.

Closes ATLASRECTS-1973

Merge request reports