From e08a549233f6b6b207f3d74501d667216b207007 Mon Sep 17 00:00:00 2001 From: cblume Date: Sun, 5 Sep 2010 20:27:07 +0000 Subject: [PATCH] Fix compiler warning (=operator) --- TRD/AliTRDtrackV1.cxx | 50 +++++++++++++++++++++++++++++++++++++++++++ TRD/AliTRDtrackV1.h | 5 +++-- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/TRD/AliTRDtrackV1.cxx b/TRD/AliTRDtrackV1.cxx index 7e015cb7db2..3432523171f 100644 --- a/TRD/AliTRDtrackV1.cxx +++ b/TRD/AliTRDtrackV1.cxx @@ -229,6 +229,56 @@ AliTRDtrackV1::~AliTRDtrackV1() } } +//_______________________________________________________________ +AliTRDtrackV1 &AliTRDtrackV1::operator=(const AliTRDtrackV1 &t) +{ + // + // Assignment operator + // + + if (this != &t) { + ((AliTRDtrackV1 &) t).Copy(*this); + } + + return *this; + +} + +//_____________________________________________________________________________ +void AliTRDtrackV1::Copy(TObject &t) const +{ + // + // Copy function + // + + ((AliTRDtrackV1 &) t).fStatus = fStatus; + ((AliTRDtrackV1 &) t).fESDid = fESDid; + ((AliTRDtrackV1 &) t).fDE = fDE; + ((AliTRDtrackV1 &) t).fkReconstructor = fkReconstructor; + ((AliTRDtrackV1 &) t).fBackupTrack = 0x0; + ((AliTRDtrackV1 &) t).fTrackLow = 0x0; + ((AliTRDtrackV1 &) t).fTrackHigh = 0x0; + + for(Int_t ip = 0; ip < kNplane; ip++) { + ((AliTRDtrackV1 &) t).fTrackletIndex[ip] = fTrackletIndex[ip]; + ((AliTRDtrackV1 &) t).fTracklet[ip] = fTracklet[ip]; + } + if (fTrackLow) { + ((AliTRDtrackV1 &) t).fTrackLow = new AliExternalTrackParam(*fTrackLow); + } + if (fTrackHigh){ + ((AliTRDtrackV1 &) t).fTrackHigh = new AliExternalTrackParam(*fTrackHigh); + } + + for (Int_t i = 0; i < 3; i++) { + ((AliTRDtrackV1 &) t).fBudget[i] = fBudget[i]; + } + for (Int_t is = 0; is < AliPID::kSPECIES; is++) { + ((AliTRDtrackV1 &) t).fPID[is] = fPID[is]; + } + +} + //_______________________________________________________________ Bool_t AliTRDtrackV1::CookLabel(Float_t wrong) { diff --git a/TRD/AliTRDtrackV1.h b/TRD/AliTRDtrackV1.h index 4466768afb4..56fef19f3fe 100644 --- a/TRD/AliTRDtrackV1.h +++ b/TRD/AliTRDtrackV1.h @@ -72,8 +72,9 @@ public: AliTRDtrackV1(const AliESDtrack &ref); AliTRDtrackV1(const AliTRDtrackV1 &ref); virtual ~AliTRDtrackV1(); - AliTRDtrackV1 &operator=(const AliTRDtrackV1 &ref) { *(new(this) AliTRDtrackV1(ref)); return *this; } - + AliTRDtrackV1 &operator=(const AliTRDtrackV1 &ref); + virtual void Copy(TObject &ref) const; + Bool_t CookPID(); Bool_t CookLabel(Float_t wrong); AliTRDtrackV1* GetBackupTrack() const {return fBackupTrack;} -- 2.39.3