]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODCaloCells.cxx
Re-establishing creation of RecPoints in TreeR (Laurent)
[u/mrichter/AliRoot.git] / STEER / AliAODCaloCells.cxx
index e268f79d305667c5641c648b1c44f33de8e30290..67764e16bb58de7f7ad482c10a1dddd4d2460d9f 100644 (file)
@@ -29,11 +29,43 @@ AliAODCaloCells::AliAODCaloCells() : TNamed(), fNCells(0), fCellNumber(0), fAmpl
   // default constructor
 }
 
-AliAODCaloCells::AliAODCaloCells(const char* name, const char* title, AODTwrs_t ttype) : TNamed(name, title), fNCells(0), fCellNumber(0), fAmplitude(0), fIsSorted(kTRUE), fType(ttype)
+AliAODCaloCells::AliAODCaloCells(const char* name, const char* title, AODCells_t ttype) : TNamed(name, title), fNCells(0), fCellNumber(0), fAmplitude(0), fIsSorted(kTRUE), fType(ttype)
 {
   // TNamed constructor
 }
 
+AliAODCaloCells::AliAODCaloCells(const AliAODCaloCells& cells) :
+    TNamed(cells),
+    fNCells(cells.fNCells),
+    fCellNumber(0),
+    fAmplitude(0),
+    fIsSorted(cells.fIsSorted),
+    fType(cells.fType)
+{
+// Copy constructor
+
+    fCellNumber = new Short_t[fNCells];
+    fAmplitude =  new Double32_t[fNCells];
+
+    for (Int_t i = 0; i < fNCells; i++) {
+       fCellNumber[i]    = cells.fCellNumber[i];
+       fAmplitude[i]     = cells.fAmplitude[i];
+    }
+}
+
+AliAODCaloCells& AliAODCaloCells::operator=(const AliAODCaloCells& cells)
+{
+// Assignment operator
+    if(&cells == this) return *this;
+    TNamed::operator=(cells);
+    fNCells = cells.fNCells;
+    for (Int_t i = 0; i < fNCells; i++) {
+       fCellNumber[i]    = cells.fCellNumber[i];
+       fAmplitude[i]     = cells.fAmplitude[i];
+    }
+    return *this;
+}
+
 AliAODCaloCells::~AliAODCaloCells()
 {
   // destructor