]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTOTCAStoreIterator.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / MUON / AliMUONTOTCAStoreIterator.cxx
index f07bc60e7f59f6726dd18e443afb192c6f738e6d..ef1f3f0976e4d5d504ea0153c6b5d48a0d63ac5a 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "AliMUONTOTCAStoreIterator.h"
 
+#include "AliLog.h"
 #include <TClonesArray.h>
 #include <TObjArray.h>
 
@@ -38,7 +39,7 @@ AliMUONTOTCAStoreIterator::AliMUONTOTCAStoreIterator(const TObjArray* data,
                                                      Int_t lastChamberId)
 : 
 TIterator(),
-fData(data),
+fkData(data),
 fFirstChamberId(firstChamberId),
 fLastChamberId(lastChamberId),
 fCurrentTCA(0x0),
@@ -54,12 +55,18 @@ 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;
 }
@@ -68,7 +75,7 @@ AliMUONTOTCAStoreIterator::operator=(const TIterator& rhs)
 AliMUONTOTCAStoreIterator::AliMUONTOTCAStoreIterator(const AliMUONTOTCAStoreIterator& rhs)
 : 
 TIterator(rhs),
-fData(0x0),
+fkData(0x0),
 fFirstChamberId(-1),
 fLastChamberId(-1),
 fCurrentTCA(0x0),
@@ -101,7 +108,7 @@ void
 AliMUONTOTCAStoreIterator::CopyTo(AliMUONTOTCAStoreIterator& destination) const
 {
   /// Copy *this to destination
-  destination.fData=fData;
+  destination.fkData=fkData;
   destination.fFirstChamberId=fFirstChamberId;
   destination.fLastChamberId=fLastChamberId;
   destination.fCurrentTCAIndex=fCurrentTCAIndex;
@@ -114,7 +121,7 @@ const TCollection*
 AliMUONTOTCAStoreIterator::GetCollection() const
 {
   /// The top level collection we're iterating upon, i.e. a TObjArray
-  return fData;
+  return fkData;
 }
 
 //_____________________________________________________________________________
@@ -136,7 +143,7 @@ AliMUONTOTCAStoreIterator::Next()
             fCurrentChamberId < fLastChamberId ) 
     {
       ++fCurrentChamberId;
-      fCurrentTCA = static_cast<TClonesArray*>(fData->At(fCurrentChamberId));
+      fCurrentTCA = static_cast<TClonesArray*>(fkData->At(fCurrentChamberId));
     }
   }