From 705d9e7b6abef5d5933bb526fe4535b8417ac529 Mon Sep 17 00:00:00 2001 From: cblume Date: Thu, 29 Jan 2009 19:37:14 +0000 Subject: [PATCH] Add a Reset funcion --- TRD/AliTRDarrayADC.cxx | 12 ++++++++++++ TRD/AliTRDarrayADC.h | 1 + TRD/AliTRDarrayDictionary.cxx | 12 ++++++++++++ TRD/AliTRDarrayDictionary.h | 1 + TRD/AliTRDarraySignal.cxx | 11 +++++++++++ TRD/AliTRDarraySignal.h | 1 + 6 files changed, 38 insertions(+) diff --git a/TRD/AliTRDarrayADC.cxx b/TRD/AliTRDarrayADC.cxx index 91f96ccd504..d1cce1e85e5 100644 --- a/TRD/AliTRDarrayADC.cxx +++ b/TRD/AliTRDarrayADC.cxx @@ -545,3 +545,15 @@ void AliTRDarrayADC::DeleteNegatives() } } } +//________________________________________________________________________________ +void AliTRDarrayADC::Reset() +{ + // + // Reset the array, the old contents are deleted + // The array keeps the same dimensions as before + // + + memset(fADC,0,sizeof(Short_t)*fNAdim); + +} + diff --git a/TRD/AliTRDarrayADC.h b/TRD/AliTRDarrayADC.h index ca724e167e5..c31c6beb381 100644 --- a/TRD/AliTRDarrayADC.h +++ b/TRD/AliTRDarrayADC.h @@ -42,6 +42,7 @@ class AliTRDarrayADC: public TObject Int_t GetNcol() const {return fNcol;}; Int_t GetDim() const {return fNAdim;}; void DeleteNegatives(); + void Reset(); protected: diff --git a/TRD/AliTRDarrayDictionary.cxx b/TRD/AliTRDarrayDictionary.cxx index 7ee6a1db421..335e212be6a 100644 --- a/TRD/AliTRDarrayDictionary.cxx +++ b/TRD/AliTRDarrayDictionary.cxx @@ -25,6 +25,7 @@ ///////////////////////////////////////////////////////// #include "AliTRDarrayDictionary.h" +#include "TArray.h" ClassImp(AliTRDarrayDictionary) @@ -328,3 +329,14 @@ void AliTRDarrayDictionary::Expand() if(longArr) delete [] longArr; } +//________________________________________________________________________________ +void AliTRDarrayDictionary::Reset() +{ + // + // Reset the array, the old contents are deleted + // and the data array elements are set to zero. + // + + memset(fDictionary,0,sizeof(Int_t)*fNDdim); + +} diff --git a/TRD/AliTRDarrayDictionary.h b/TRD/AliTRDarrayDictionary.h index c57ca01a747..360d4498f16 100644 --- a/TRD/AliTRDarrayDictionary.h +++ b/TRD/AliTRDarrayDictionary.h @@ -34,6 +34,7 @@ class AliTRDarrayDictionary: public TObject Int_t GetDim() const {return fNDdim;}; void Compress(); void Expand(); + void Reset(); protected: diff --git a/TRD/AliTRDarraySignal.cxx b/TRD/AliTRDarraySignal.cxx index 68749de2dd5..25bfd50deb3 100644 --- a/TRD/AliTRDarraySignal.cxx +++ b/TRD/AliTRDarraySignal.cxx @@ -356,3 +356,14 @@ void AliTRDarraySignal::Expand() if(longArr) delete [] longArr; } +//________________________________________________________________________________ +void AliTRDarraySignal::Reset() +{ + // + // Reset the array, the old contents are deleted + // The array keeps the same dimensions as before + // + + memset(fSignal,0,sizeof(Float_t)*fNdim); + +} diff --git a/TRD/AliTRDarraySignal.h b/TRD/AliTRDarraySignal.h index 481e11233bd..02c25698add 100644 --- a/TRD/AliTRDarraySignal.h +++ b/TRD/AliTRDarraySignal.h @@ -39,6 +39,7 @@ class AliTRDarraySignal: public TObject Int_t GetOverThreshold(Float_t threshold); void Compress(Float_t minval); void Expand(); + void Reset(); protected: -- 2.39.3