]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDCaloCells.cxx
Useful macros for the shifter
[u/mrichter/AliRoot.git] / STEER / AliESDCaloCells.cxx
index 1a0c3f1878563b8aad630cd67b19dab8c1f33eb5..da5c2d981406aa32ccf8e8d4eccf5b97dacc7cb7 100644 (file)
@@ -59,10 +59,17 @@ AliESDCaloCells & AliESDCaloCells::operator =(const AliESDCaloCells& source)
   if(&source == this) return *this;
   TNamed::operator=(source);
 
+  if(fNCells != source.fNCells){
+    DeleteContainer();
+    CreateContainer(source.fNCells);
+  }
+
   fNCells = source.fNCells; 
   fIsSorted = source.fIsSorted;
   fType = source.fType;
-  
+
+
+
   for(Int_t i = 0; i < fNCells; i++){
     fCellNumber[i] = source.fCellNumber[i];
     fAmplitude[i] = source.fAmplitude[i];
@@ -73,6 +80,20 @@ AliESDCaloCells & AliESDCaloCells::operator =(const AliESDCaloCells& source)
 
 }
 
+
+void AliESDCaloCells::Copy(TObject &obj) const {
+  
+  // this overwrites the virtual TOBject::Copy()
+  // to allow run time copying without casting
+  // in AliESDEvent
+
+  if(this==&obj)return;
+  AliESDCaloCells *robj = dynamic_cast<AliESDCaloCells*>(&obj);
+  if(!robj)return; // not an AliESDCaloCells
+  *robj = *this;
+
+}
+
 //_______________________________________________________________________
 AliESDCaloCells::~AliESDCaloCells()
 {