]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONCluster.cxx
From Michael Knichel: The THnSparses are not merged anymore, instead a set of 1D...
[u/mrichter/AliRoot.git] / MUON / AliMUONCluster.cxx
index 2ab947e661bf03f99a54c23ba191df8ce51d5af5..a40d9fe005e2a2bec14e879359fced7c85bdbb0e 100644 (file)
@@ -144,6 +144,7 @@ AliMUONCluster::operator=(const AliMUONCluster& src)
 AliMUONCluster::~AliMUONCluster()
 {
   /// dtor : note that we're owner of our pads
+//   fPads.Delete();
 }
 
 //_____________________________________________________________________________
@@ -152,6 +153,7 @@ AliMUONCluster::Clear(Option_t*)
 {
   /// Clear our pad array
   fPads.Clear();
+//  fPads.Delete();
 }
 
 //_____________________________________________________________________________
@@ -310,6 +312,14 @@ AliMUONCluster::Area(Int_t cathode) const
                    (upperRight-lowerLeft).X()/2, (upperRight-lowerLeft).Y()/2);
 }
 
+//_____________________________________________________________________________
+Bool_t
+AliMUONCluster::IsMonoCathode() const
+{
+  /// Whether we have signals only in one of the two cathodes
+  return (Cathode()<2);
+}
+
 //_____________________________________________________________________________
 Int_t
 AliMUONCluster::Cathode() const
@@ -345,8 +355,15 @@ AliMUONCluster::Copy(TObject& obj) const
   ///
   TObject::Copy(obj);
   AliMUONCluster& dest = static_cast<AliMUONCluster&>(obj);
-  dest.fPads.Delete();
-  dest.fPads = fPads;
+
+//  dest.fPads.Delete();
+  dest.fPads.Clear();
+  
+  for ( Int_t i = 0; i <= fPads.GetLast(); ++i ) 
+  {
+    AliMUONPad* p = static_cast<AliMUONPad*>(fPads.UncheckedAt(i));
+    dest.fPads.AddLast(new AliMUONPad(*p));
+  }
   dest.fHasPosition = fHasPosition;
   dest.fPosition = fPosition;
   dest.fPositionError = fPositionError;
@@ -648,7 +665,7 @@ AliMUONCluster::DumpMe() const
 //  cout << " " << Area() << endl;
   for (Int_t i = 0; i < fPads.GetSize(); ++i) 
   {
-    cout << Form("fPads[%d]=%x",i,fPads.At(i)) << endl;
+    cout << Form("fPads[%d]=%p",i,fPads.At(i)) << endl;
     if ( fPads.At(i) ) fPads.At(i)->Print();
   }
 }
@@ -744,6 +761,7 @@ AliMUONCluster::RemovePad(AliMUONPad* pad)
   
   fPads.Remove(pad);
   fPads.Compress();
+  delete pad;
   // update cluster's data
   fIsSaturated[0]=fIsSaturated[1]=kFALSE;
   fMultiplicity[0]=fMultiplicity[1]=0;