1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///\class AliMUONPointWithRef
20 /// A class used to represent a point with an external integer reference
21 /// and with a specific sorting method (see AliMUONContourMaker)
23 /// \author Laurent Aphecetche, Subatech
26 #include "AliMUONPointWithRef.h"
28 #include "AliMUONSegment.h"
29 #include "Riostream.h"
33 ClassImp(AliMUONPointWithRef)
36 //_____________________________________________________________________________
37 AliMUONPointWithRef::AliMUONPointWithRef() : fX(), fY(), fRef(-1)
42 //_____________________________________________________________________________
43 AliMUONPointWithRef::AliMUONPointWithRef(Double_t x, Double_t y, Int_t ref)
44 : fX(x), fY(y), fRef(ref)
49 //_____________________________________________________________________________
51 AliMUONPointWithRef::Compare(const TObject* obj) const
53 /// Should serve to sort the vertical edges in ascending order, first on absissa,
56 if ( this == obj ) return 0;
58 const AliMUONPointWithRef* rhs = static_cast<const AliMUONPointWithRef*>(obj);
60 if ( AliMUONSegment::AreEqual(Y(),rhs->Y()) )
62 if ( AliMUONSegment::AreEqual(X(),rhs->X()) )
66 else if ( X() > rhs->X() )
73 else if ( Y() < rhs->Y() )
83 //_____________________________________________________________________________
85 AliMUONPointWithRef::Print(Option_t*) const
88 cout << Form("(%10.5f,%10.5f) [%4d]",X(),Y(),Ref()) << endl;