From 7941f004e6b0a6c55423da0f3012a010b3388494 Mon Sep 17 00:00:00 2001 From: richterm Date: Wed, 12 May 2010 23:34:03 +0000 Subject: [PATCH] adding copy constructor to create AliHLTGlobalBarrelTrack from AliHLTExternalTrackParam --- HLT/BASE/util/AliHLTGlobalBarrelTrack.cxx | 13 ++++++++++++- HLT/BASE/util/AliHLTGlobalBarrelTrack.h | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/HLT/BASE/util/AliHLTGlobalBarrelTrack.cxx b/HLT/BASE/util/AliHLTGlobalBarrelTrack.cxx index 46553956b41..c1c2eb46af5 100644 --- a/HLT/BASE/util/AliHLTGlobalBarrelTrack.cxx +++ b/HLT/BASE/util/AliHLTGlobalBarrelTrack.cxx @@ -70,13 +70,24 @@ AliHLTGlobalBarrelTrack::AliHLTGlobalBarrelTrack(const AliHLTExternalTrackParam& // the 5 track parameters are named in the AliHLTExternalTrackParam // while AliExternalTrackParam just uses an array[5] - // the members have the some order, fY is the first one + // the members have the same order, fY is the first one Set(p.fX, p.fAlpha, &p.fY, p.fC); SetPoints(p.fPointIDs, p.fNPoints); SetNumberOfClusters(p.fNPoints); //SetIntegratedLength(GetPathLengthTo( GetLastPointX(), b); } +AliHLTGlobalBarrelTrack::AliHLTGlobalBarrelTrack(const AliExternalTrackParam& p ) + : AliKalmanTrack() + , fPoints() + , fLastX(0) + , fLastY(0) + , fTrackID(0) +{ + // see header file for class documentation + *(dynamic_cast(this))=p; +} + template AliHLTGlobalBarrelTrack& AliHLTGlobalBarrelTrack::operator=(const c& p) { diff --git a/HLT/BASE/util/AliHLTGlobalBarrelTrack.h b/HLT/BASE/util/AliHLTGlobalBarrelTrack.h index 84566820a72..0be23facce7 100644 --- a/HLT/BASE/util/AliHLTGlobalBarrelTrack.h +++ b/HLT/BASE/util/AliHLTGlobalBarrelTrack.h @@ -33,6 +33,8 @@ class AliHLTGlobalBarrelTrack : public AliKalmanTrack AliHLTGlobalBarrelTrack(const AliHLTGlobalBarrelTrack& t); /** copy constructor */ AliHLTGlobalBarrelTrack(const AliHLTExternalTrackParam& p); + /** copy constructor */ + AliHLTGlobalBarrelTrack(const AliExternalTrackParam& p); /** assignment operator */ template -- 2.43.0