On 09/03/2013 04:09 PM, Volker Adler wrote:
>
> In DataFormats/PatCandidates/interface/Muon.h:
>
> > @@ -83,9 +80,20 @@
> >        reco::TrackRef combinedMuon() const;
> >        /// reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon)
> >        reco::TrackRef globalTrack() const { return combinedMuon(); }
> > +      /// reference to the Best Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon), old (default bt deprecated) tuneP
> > +      reco::TrackRef muonBestTrack();
> > +      /// reference to the Best Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon), after new tuneP
> > +      reco::TrackRef improvedMuonBestTrack();
>
> However, I do not understand, why this should be done in an access 
> function.
> Shouldn't it (determination of "newBestTrack") rather go to the 
> pat::Muon::embedWhateverTrack functions? In case the embedding is 
> switched off, one can (has to) still fix it in the PATMuonProducer 
> directly.
>
Well, the proposed code does more than that. The embed methods call the 
accessors and in case the tracks are not stored, it store them computing 
them. The accessors, if the tracks are stored, always call them 
directly, otherwise, correctly, they recomputed the values on the fly. 
If we do not do like that, the PATMuonProducer does not fix anything, 
especially the improvedMuonBestTrack, which will remain completely orphan.





> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/cms-sw/cmssw/pull/684/files#r6126430>.
>