]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODCaloCluster.cxx
Type of trigger (beam-gas, beam-beam), only for RAW, is put in ESD
[u/mrichter/AliRoot.git] / STEER / AliAODCaloCluster.cxx
index be5beaea2be630b15278b20fef8c11c3a6b799e2..908188a24f157ee1fe5e8fd51cb82add9b163f61 100644 (file)
@@ -37,8 +37,8 @@ AliAODCaloCluster::AliAODCaloCluster() :
   fTOF(0.),
   fTracksMatched(),
   fNCells(0),
-  fCellsAbsId(),
-  fCellsAmpFraction()
+  fCellsAbsId(0x0),
+  fCellsAmpFraction(0x0)
 {
   // default constructor
 
@@ -50,7 +50,7 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id,
                                     Int_t *label, 
                                     Double_t energy,
                                     Double_t x[3],
-                                    Double_t pid[9],
+                                    Double_t pid[13],
                                     Char_t ttype,
                                     UInt_t selectInfo) :
   AliAODCluster(id, nLabel, label, energy, x, pid, ttype, selectInfo),
@@ -63,8 +63,8 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id,
   fTOF(0.),
   fTracksMatched(),
   fNCells(0),
-  fCellsAbsId(),
-  fCellsAmpFraction()
+  fCellsAbsId(0x0),
+  fCellsAmpFraction(0x0)
 {
   // constructor
 
@@ -76,7 +76,7 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id,
                                     Int_t *label, 
                                     Float_t energy,
                                     Float_t x[3],
-                                    Float_t pid[9],
+                                    Float_t pid[13],
                                     Char_t ttype,
                                     UInt_t selectInfo) :
   AliAODCluster(id, nLabel, label, energy, x, pid, ttype, selectInfo),
@@ -89,8 +89,8 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id,
   fTOF(0.),
   fTracksMatched(),
   fNCells(0),
-  fCellsAbsId(),
-  fCellsAmpFraction()
+  fCellsAbsId(0x0),
+  fCellsAmpFraction(0x0)
 {
   // constructor
 }
@@ -117,8 +117,8 @@ AliAODCaloCluster::AliAODCaloCluster(const AliAODCaloCluster& clus) :
   fTOF(clus.fTOF),
   fTracksMatched(clus.fTracksMatched),
   fNCells(clus.fNCells),
-  fCellsAbsId(),
-  fCellsAmpFraction()
+  fCellsAbsId(0x0),
+  fCellsAmpFraction(0x0)
 {
   // Copy constructor
 
@@ -158,6 +158,10 @@ AliAODCaloCluster& AliAODCaloCluster::operator=(const AliAODCaloCluster& clus)
     fTracksMatched = clus.fTracksMatched;
 
     fNCells= clus. fNCells;
+    // delete anyway 
+    if(fCellsAbsId)delete [] fCellsAbsId;
+    if(fCellsAmpFraction)delete [] fCellsAmpFraction;
+
     if (clus.fNCells > 0) {
       
       if(clus.fCellsAbsId){
@@ -221,8 +225,8 @@ void  AliAODCaloCluster::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];
+      if(!fCellsAbsId)fCellsAbsId = new  UShort_t[fNCells];
+      for (Int_t i = 0; i < fNCells; i++) fCellsAbsId[i] = array[i];
     }
 }
 
@@ -230,7 +234,7 @@ void  AliAODCaloCluster::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];
+      if(!fCellsAmpFraction)fCellsAmpFraction = new  Double32_t[fNCells];
+      for (Int_t i = 0; i < fNCells; i++) fCellsAmpFraction[i] = array[i];
     }
 }