]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODCaloCluster.cxx
Summary of all changes:
[u/mrichter/AliRoot.git] / STEER / AliAODCaloCluster.cxx
index 260fab57791f232fffe4b19cb84b4a5000c4360f..fb34ec1ba644616ccc9651ece43ab320234cc1b7 100644 (file)
@@ -36,7 +36,9 @@ AliAODCaloCluster::AliAODCaloCluster() :
   fEmcCpvDistance(-999.),
   fNExMax(0),
   fTracksMatched(),
-  fCellNumber()
+  fNCells(0),
+  fCellsAbsId(),
+  fCellsAmpFraction()
 {
   // default constructor
 
@@ -61,7 +63,9 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id,
   fEmcCpvDistance(-999.),
   fNExMax(0),
   fTracksMatched(),
-  fCellNumber()
+  fNCells(0),
+  fCellsAbsId(),
+  fCellsAmpFraction()
 {
   // constructor
 
@@ -86,7 +90,9 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id,
   fEmcCpvDistance(-999.),
   fNExMax(0),
   fTracksMatched(),
-  fCellNumber()
+  fNCells(0),
+  fCellsAbsId(),
+  fCellsAmpFraction()
 {
   // constructor
 }
@@ -96,6 +102,8 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id,
 AliAODCaloCluster::~AliAODCaloCluster() 
 {
   // destructor
+  if(fCellsAmpFraction) delete[] fCellsAmpFraction; fCellsAmpFraction=0;
+  if(fCellsAbsId) delete[] fCellsAbsId;  fCellsAbsId = 0;
 }
 
 
@@ -111,9 +119,28 @@ AliAODCaloCluster::AliAODCaloCluster(const AliAODCaloCluster& clus) :
   fEmcCpvDistance(clus.fEmcCpvDistance),
   fNExMax(clus.fNExMax),
   fTracksMatched(clus.fTracksMatched),
-  fCellNumber(clus.fCellNumber)
+  fNCells(clus.fNCells),
+  fCellsAbsId(),
+  fCellsAmpFraction()
 {
   // Copy constructor
+
+  if (clus.fNCells > 0) {
+    
+    if(clus.fCellsAbsId){
+      fCellsAbsId = new UShort_t[clus.fNCells];
+      for (Int_t i=0; i<clus.fNCells; i++)
+       fCellsAbsId[i]=clus.fCellsAbsId[i];
+    }
+    
+    if(clus.fCellsAmpFraction){
+      fCellsAmpFraction = new Double32_t[clus.fNCells];
+      for (Int_t i=0; i<clus.fNCells; i++)
+       fCellsAmpFraction[i]=clus.fCellsAmpFraction[i];
+    }
+    
+  }
+  
 }
 
 //______________________________________________________________________________
@@ -133,7 +160,24 @@ AliAODCaloCluster& AliAODCaloCluster::operator=(const AliAODCaloCluster& clus)
     fEmcCpvDistance = clus.fEmcCpvDistance;
     fNExMax = clus.fNExMax;
     fTracksMatched = clus.fTracksMatched;
-    fCellNumber = clus.fCellNumber;
+
+    fNCells= clus. fNCells;
+    if (clus.fNCells > 0) {
+      
+      if(clus.fCellsAbsId){
+       fCellsAbsId = new UShort_t[clus.fNCells];
+       for (Int_t i=0; i<clus.fNCells; i++)
+         fCellsAbsId[i]=clus.fCellsAbsId[i];
+      }
+      
+      if(clus.fCellsAmpFraction){
+       fCellsAmpFraction = new Double32_t[clus.fNCells];
+       for (Int_t i=0; i<clus.fNCells; i++)
+         fCellsAmpFraction[i]=clus.fCellsAmpFraction[i];
+      }
+      
+    }
+
   }
 
   return *this;