X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONVDigit.cxx;h=8d8107e8a28c47cee6d6b10ed25dd5736373e94e;hb=dba333aea1f30dee5c9f8af2b879baef7b8d9dba;hp=56721f5793234b347cab80748afa59e068a3c73b;hpb=36a014154bf44c1170bb56c03276e37a8335e1a7;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONVDigit.cxx b/MUON/AliMUONVDigit.cxx index 56721f57932..8d8107e8a28 100644 --- a/MUON/AliMUONVDigit.cxx +++ b/MUON/AliMUONVDigit.cxx @@ -15,6 +15,7 @@ // $Id$ +//----------------------------------------------------------------------------- /// \class AliMUONVDigit /// /// This is the base class of a MUON digit that most client code should deal with. @@ -38,6 +39,7 @@ /// the (half) dimensions (in cm) of the pad it corresponds to. /// /// \author Laurent Aphecetche, Subatech +//----------------------------------------------------------------------------- #include "AliMUONVDigit.h" @@ -59,6 +61,7 @@ AliMUONVDigit::AliMUONVDigit(Int_t detElemId, Int_t eCardId, //_____________________________________________________________________________ AliMUONVDigit::AliMUONVDigit() +: TObject() { /// Default ctor } @@ -73,6 +76,10 @@ AliMUONVDigit::~AliMUONVDigit() Bool_t AliMUONVDigit::IsEqual(const TObject* object) const { + /// Whether we're equal to object. + /// WARNING : only based on our identifiers (de,manu,channel,cathode), not our + /// content (i.e. charge, status...) + const AliMUONVDigit* d = static_cast(object); return ( DetElemId() == d->DetElemId() && @@ -85,6 +92,9 @@ AliMUONVDigit::IsEqual(const TObject* object) const Int_t AliMUONVDigit::Compare(const TObject* object) const { + /// Compare two digits, trying to get as complete an order as possible. + /// We sort by DE, then by charge, then by manu, etc... + /// const AliMUONVDigit* d = static_cast(object); if ( DetElemId() > d->DetElemId() ) @@ -107,17 +117,24 @@ AliMUONVDigit::Compare(const TObject* object) const } else { - if ( ManuId() < d->ManuId() ) + if ( ManuId() > d->ManuId() ) { return 1; } - else if ( ManuId() > d->ManuId() ) + else if ( ManuId() < d->ManuId() ) { return -1; } else { - return ( ManuChannel() < d->ManuChannel() ) ? 1 : -1; + if ( ManuChannel() > d->ManuChannel() ) + { + return 1; + } + else if ( ManuChannel() < d->ManuChannel() ) + { + return -1; + } } } }