]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONCluster.cxx
react to filename change *_Barrel -> *_barrel
[u/mrichter/AliRoot.git] / MUON / AliMUONCluster.cxx
index 2ab947e661bf03f99a54c23ba191df8ce51d5af5..df5f10b58e4e9c7ef878cde48d7802507d91d1bb 100644 (file)
@@ -40,6 +40,8 @@
 ///
 //-----------------------------------------------------------------------------
 
+using std::cout;
+using std::endl;
 /// \cond CLASSIMP
 ClassImp(AliMUONCluster)
 /// \endcond
@@ -144,6 +146,7 @@ AliMUONCluster::operator=(const AliMUONCluster& src)
 AliMUONCluster::~AliMUONCluster()
 {
   /// dtor : note that we're owner of our pads
+//   fPads.Delete();
 }
 
 //_____________________________________________________________________________
@@ -152,6 +155,7 @@ AliMUONCluster::Clear(Option_t*)
 {
   /// Clear our pad array
   fPads.Clear();
+//  fPads.Delete();
 }
 
 //_____________________________________________________________________________
@@ -310,6 +314,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 +357,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 +667,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 +763,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;