Set charge-array to zero if old class version was read.
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Aug 2008 14:38:51 +0000 (14:38 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Aug 2008 14:38:51 +0000 (14:38 +0000)
STEER/AliTrackPointArray.cxx

index 2c47748..ffe6852 100644 (file)
@@ -89,7 +89,11 @@ AliTrackPointArray::AliTrackPointArray(const AliTrackPointArray &array):
   memcpy(fX,array.fX,fNPoints*sizeof(Float_t));
   memcpy(fY,array.fY,fNPoints*sizeof(Float_t));
   memcpy(fZ,array.fZ,fNPoints*sizeof(Float_t));
-  memcpy(fCharge,array.fCharge,fNPoints*sizeof(Float_t));
+  if (array.fCharge) {
+    memcpy(fCharge,array.fCharge,fNPoints*sizeof(Float_t));
+  } else {
+    memset(fCharge, 0, fNPoints*sizeof(Float_t));
+  }
   memcpy(fVolumeID,array.fVolumeID,fNPoints*sizeof(UShort_t));
   memcpy(fCov,array.fCov,fSize*sizeof(Float_t));
 }