From ed7122711e1d6a15da49eac3a752f3b4da36ee4a Mon Sep 17 00:00:00 2001 From: morsch Date: Wed, 14 May 2008 14:24:33 +0000 Subject: [PATCH] Replication of arrays in setters. (G. Conesa Balbastre) --- STEER/AliESDCaloCluster.cxx | 20 ++++++++++++++++++++ STEER/AliESDCaloCluster.h | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/STEER/AliESDCaloCluster.cxx b/STEER/AliESDCaloCluster.cxx index 60c417b7ec7..15b55e0111a 100644 --- a/STEER/AliESDCaloCluster.cxx +++ b/STEER/AliESDCaloCluster.cxx @@ -296,3 +296,23 @@ void AliESDCaloCluster::GetMomentum(TLorentzVector& p, Double_t *vertex ) { p.SetPxPyPzE( fEnergy*fGlobalPos[0]/r, fEnergy*fGlobalPos[1]/r, fEnergy*fGlobalPos[2]/r, fEnergy) ; } + +//_______________________________________________________________________ +void AliESDCaloCluster::SetCellsAbsId(UShort_t *array) +{ + // Set the array of cell absId numbers + if (fNCells) { + fCellsAbsId = new UShort_t[fNCells]; + for (Int_t i = 0; i < fNCells; i++) fCellsAbsId[i] = array[i]; + } +} + +//_______________________________________________________________________ +void AliESDCaloCluster::SetCellsAmplitudeFraction(Double32_t *array) +{ + // Set the array of cell amplitude fraction + if (fNCells) { + fCellsAmpFraction = new Double32_t[fNCells]; + for (Int_t i = 0; i < fNCells; i++) fCellsAmpFraction[i] = array[i]; + } +} diff --git a/STEER/AliESDCaloCluster.h b/STEER/AliESDCaloCluster.h index c10afab3427..2c6bb7be604 100644 --- a/STEER/AliESDCaloCluster.h +++ b/STEER/AliESDCaloCluster.h @@ -111,10 +111,10 @@ public: void SetNCells(Int_t n) { fNCells = n;} Int_t GetNCells() const { return fNCells;} - void SetCellsAbsId(UShort_t *array) { fCellsAbsId = array; } + void SetCellsAbsId(UShort_t *array) ; UShort_t *GetCellsAbsId() {return fCellsAbsId;} - void SetCellsAmplitudeFraction(Double32_t *array) { fCellsAmpFraction = array; } + void SetCellsAmplitudeFraction(Double32_t *array) ; Double32_t *GetCellsAmplitudeFraction() {return fCellsAmpFraction;} Int_t GetCellAbsId(Int_t i) const { -- 2.43.0