Computation on-the-fly is not the problem, but the "set(Improved)BestTrack" calls in the accessors. They assign an enum for the track type IIUC, but seems not to be used anywhere after that (track remains unembedded) - and why can't that be done in the PATMuonProducer once at muon creation time?