Implementation of copy constructor and asignment operator
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 2 Nov 2003 12:40:49 +0000 (12:40 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 2 Nov 2003 12:40:49 +0000 (12:40 +0000)
PMD/AliPMDcell.cxx
PMD/AliPMDcell.h

index ea06be2..9cdffc7 100644 (file)
@@ -35,6 +35,29 @@ AliPMDcell::AliPMDcell(Int_t trnumber, Int_t smnumber,
   fEdep     = edep;
 
 }
+
+AliPMDcell::AliPMDcell(const AliPMDcell& source):TObject(source) {
+  //Copy Constructor 
+  if(&source == this) return;
+  this->fTrNumber = source.fTrNumber;
+  this->fSMNumber = source.fSMNumber;
+  this->fXpos = source.fXpos;
+  this->fYpos = source.fYpos;
+  this->fEdep = source.fEdep;
+  return;
+}
+
+AliPMDcell& AliPMDcell::operator=(const AliPMDcell& source) {
+  //Copy Constructor 
+  if(&source == this) return *this;
+  this->fTrNumber = source.fTrNumber;
+  this->fSMNumber = source.fSMNumber;
+  this->fXpos = source.fXpos;
+  this->fYpos = source.fYpos;
+  this->fEdep = source.fEdep;
+  return *this;
+}
+
 AliPMDcell::~AliPMDcell()
 {
   // Default destructor
index 33e3dd1..a1bef87 100644 (file)
@@ -22,8 +22,8 @@ class AliPMDcell : public TObject
   AliPMDcell(Int_t trnumber, Int_t smnumber,
              Int_t xpos, Int_t ypos, Float_t edep);
   AliPMDcell(AliPMDcell *pmdcell) {*this = *pmdcell;}
-  AliPMDcell (const AliPMDcell &alipmdcell);  // dummy copy constructor
-  AliPMDcell &operator=(const AliPMDcell &alipmdcell); // dummy assignment op
+  AliPMDcell (const AliPMDcell &alipmdcell);  // copy constructor
+  AliPMDcell &operator=(const AliPMDcell &alipmdcell); // assignment op
 
   virtual ~AliPMDcell();