Additional changes for #94138: Port update in Ali*CaloCells to trunk and release...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 May 2012 07:15:49 +0000 (07:15 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 May 2012 07:15:49 +0000 (07:15 +0000)
STEER/AOD/AliAODCaloCells.cxx
STEER/ESD/AliESDCaloCells.cxx

index 34414c5..c455197 100644 (file)
@@ -58,7 +58,7 @@ AliAODCaloCells::AliAODCaloCells(const AliAODCaloCells& cells) :
   for (Int_t i = 0; i < fNCells; i++) {
     fCellNumber[i]    = cells.fCellNumber[i];
     fAmplitude[i]     = cells.fAmplitude[i];
-    if(cells.fMCLabel)  fTime[i]      = cells.fTime[i];
+    if(cells.fTime)  fTime[i]      = cells.fTime[i];
     if(cells.fMCLabel)  fMCLabel[i]   = cells.fMCLabel[i];
     if(cells.fEFraction)fEFraction[i] = cells.fEFraction[i];    
   }
@@ -293,9 +293,26 @@ Bool_t AliAODCaloCells::SetCell(Short_t pos,     Short_t cellNumber, Double32_t
     fCellNumber[pos] = cellNumber;
     fAmplitude[pos]  = amplitude;
     
-    if(!fTime)      fTime      = new Double_t[fNCells];
-    if(!fMCLabel)   fMCLabel   = new Short_t[fNCells];
-    if(!fEFraction) fEFraction = new Double32_t[fNCells];
+    // note: initialize (can't use memset for non-0 values)
+    //       plus sizeof(Double32_t) is 0
+    if(!fTime){
+      fTime  = new Double32_t[fNCells];
+      
+      for( Int_t i = 0; i < fNCells; i++ )
+        fTime[i] = -1;
+    }
+    if(!fMCLabel){
+      fMCLabel = new Short_t[fNCells];
+      
+      for( Int_t i = 0; i < fNCells; i++ )
+        fMCLabel[i] = -1;
+    }
+    if(!fEFraction){
+      fEFraction = new Double32_t[fNCells];
+      
+      for( Int_t i = 0; i < fNCells; i++ )
+        fEFraction[i] = 0;
+    }
     
     fTime[pos]       = time;
     fMCLabel[pos]    = mclabel;
index e26efa7..9901283 100644 (file)
@@ -294,8 +294,20 @@ Bool_t AliESDCaloCells::SetCell(Short_t pos,     Short_t cellNumber, Double32_t
     fAmplitude[pos]  = amplitude;
     fTime[pos]       = time;
     
-    if(!fMCLabel)   fMCLabel   = new Short_t[fNCells];
-    if(!fEFraction) fEFraction = new Double32_t[fNCells];
+    // note: initialize (can't use memset for non-0 values)
+    //       plus sizeof(Double32_t) is 0
+    if(!fMCLabel){
+      fMCLabel   = new Short_t[fNCells];
+
+      for( Int_t i = 0; i < fNCells; i++ )
+        fMCLabel[i] = -1;
+    }
+    if(!fEFraction){
+      fEFraction = new Double32_t[fNCells];
+
+      for( Int_t i = 0; i < fNCells; i++ )
+        fEFraction[i] = 0;
+    }
 
     fMCLabel[pos]    = mclabel;
     fEFraction[pos]  = efrac;