Skip to content

Commit 2aa6d61

Browse files
authored
[MUON] Fix assignment of GlobalFwdTrack from base class (#15785)
The fix introduces an explicit assignment operator between the GlobalFwdTrack class and its TrackParCovFwd base class. This prevents a SEGFAULT in this kind of assignment: o2::track::TrackParCovFwd trackParCovFwd; o2::dataformats::GlobalFwdTrack globalFwdTrack; globalFwdTrack = trackParCovFwd;
1 parent b7d563b commit 2aa6d61

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

DataFormats/Reconstruction/include/ReconstructionDataFormats/GlobalFwdTrack.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ class GlobalFwdTrack : public o2::track::TrackParCovFwd, public o2::dataformats:
3434
GlobalFwdTrack(o2::track::TrackParCovFwd const& t) { *this = t; }
3535
~GlobalFwdTrack() = default;
3636

37+
GlobalFwdTrack& operator=(const TrackParCovFwd& rhs)
38+
{
39+
o2::track::TrackParCovFwd::operator=(rhs);
40+
return *this;
41+
}
42+
43+
GlobalFwdTrack& operator=(const GlobalFwdTrack& rhs)
44+
{
45+
o2::track::TrackParCovFwd::operator=(rhs);
46+
o2::dataformats::MatchInfoFwd::operator=(rhs);
47+
return *this;
48+
}
49+
3750
SMatrix5 computeResiduals2Cov(const o2::track::TrackParCovFwd& t) const
3851
{
3952
SMatrix5 Residuals2Cov;

0 commit comments

Comments
 (0)