X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONTOTCAStoreIterator.cxx;h=36777647efc5a5a4e269fad6b9e4ab5d30f97b4a;hb=cd40b2870b90589a61a21719cd3727c010e7d408;hp=6120216c3148e91c0f9922790db4448553075645;hpb=55ab3bd1b4f931a5876a53131df38858b06c5437;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONTOTCAStoreIterator.cxx b/MUON/AliMUONTOTCAStoreIterator.cxx index 6120216c314..36777647efc 100644 --- a/MUON/AliMUONTOTCAStoreIterator.cxx +++ b/MUON/AliMUONTOTCAStoreIterator.cxx @@ -15,17 +15,17 @@ // $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 #include @@ -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(rhs); - - rhs1.CopyTo(*this); + if ( rhs.IsA() != AliMUONTOTCAStoreIterator::Class() ) + { + AliErrorGeneral("AliMUONTOTCAStoreIterator::operator=","Wrong type"); + } + else + { + const AliMUONTOTCAStoreIterator& rhs1 = + static_cast(rhs); + rhs1.CopyTo(*this); + } } return *this; }