Adding copy constructor and assignment operator
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Apr 2006 17:00:34 +0000 (17:00 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Apr 2006 17:00:34 +0000 (17:00 +0000)
RICH/AliRICHCluster.h

index 2009368..f4cd571 100644 (file)
@@ -9,8 +9,51 @@ class AliRICHCluster :public TObject
 {
 public:
   enum EClusterStatus {kFormed,kCoG,kUnfolded,kEmpty=-1}; 
-                       AliRICHCluster(                                     ):TObject(),fQdc(-1),fCham(-1),fX(-1),fY(-1),fStatus(kEmpty   ),fDigs(0) {}
-                       AliRICHCluster(Int_t c,Double_t x,Double_t y,Int_t q):TObject(),fQdc(q ),fCham(c) ,fX(x ),fY(y ),fStatus(kUnfolded),fDigs(0) {}
+  AliRICHCluster():
+    TObject(),
+    fQdc(-1),
+    fCham(-1),
+    fX(-1),
+    fY(-1),
+    fStatus(kEmpty),
+    fDigs(0) {
+    // Default constructor
+  }
+  AliRICHCluster(Int_t c,Double_t x,Double_t y,Int_t q):
+    TObject(),
+    fQdc(q ),
+    fCham(c) ,
+    fX(x),
+    fY(y),
+    fStatus(kUnfolded),
+    fDigs(0x0) {
+    // Constructor
+  }
+  AliRICHCluster(const AliRICHCluster & src) :
+    TObject(src),
+    fQdc(src.fQdc),
+    fCham(src.fCham),
+    fX(src.fX),
+    fY(src.fY),
+    fStatus(src.fStatus),
+    fDigs(src.fDigs ? new TObjArray(*src.fDigs) : 0x0) {
+    // Copy constructor
+  }
+  AliRICHCluster & operator=(const AliRICHCluster & src) {
+    // Assigment operator  
+    if ( this == &src ) return *this;
+
+    // Base class assignment
+    TObject::operator=(src);
+
+    fQdc    = src.fQdc;
+    fCham   = src.fCham;
+    fX      = src.fX;
+    fY      = src.fY;
+    fStatus = src.fStatus;
+    fDigs = src.fDigs ? new TObjArray(*src.fDigs) : 0x0;
+    return *this;
+  }
   virtual             ~AliRICHCluster(                                     )                                                                        {DigDel();}
 //framework part                   
          void          Print  (Option_t *opt=""                                  )const;                  //overloaded TObject::Print() to print cluster info