]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTOTCAStoreIterator.cxx
fix error in dEdx slice calculation for LQ method (Alex Wilk)
[u/mrichter/AliRoot.git] / MUON / AliMUONTOTCAStoreIterator.cxx
index 6120216c3148e91c0f9922790db4448553075645..36777647efc5a5a4e269fad6b9e4ab5d30f97b4a 100644 (file)
 
 // $Id$
 
-///
+//-----------------------------------------------------------------------------
 /// \class AliMUONTOTCAStoreIterator
 ///
 /// An iterator to access TObject stored in a TObjArray of TClonesArray
 ///
-///
 /// \author Laurent Aphecetche, Subatech
-///
+//-----------------------------------------------------------------------------
 
 #include "AliMUONTOTCAStoreIterator.h"
 
+#include "AliLog.h"
 #include <TClonesArray.h>
 #include <TObjArray.h>
 
@@ -51,16 +51,22 @@ fCurrentChamberId(-1)
 }
 
 //_____________________________________________________________________________
-TIterator& 
+AliMUONTOTCAStoreIterator& 
 AliMUONTOTCAStoreIterator::operator=(const TIterator& rhs)
 {
   /// Overriden operator= (imposed by Root's declaration of TIterator ?)
-  if ( this != &rhs && rhs.IsA() == AliMUONTOTCAStoreIterator::Class() )
+  if ( this != &rhs )
   {
-    const AliMUONTOTCAStoreIterator& rhs1 = 
-    static_cast<const AliMUONTOTCAStoreIterator&>(rhs);
-    
-    rhs1.CopyTo(*this);
+    if ( rhs.IsA() != AliMUONTOTCAStoreIterator::Class() )
+    {
+      AliErrorGeneral("AliMUONTOTCAStoreIterator::operator=","Wrong type");
+    }
+    else
+    {
+      const AliMUONTOTCAStoreIterator& rhs1 = 
+      static_cast<const AliMUONTOTCAStoreIterator&>(rhs);
+      rhs1.CopyTo(*this);
+    }
   }
   return *this;
 }