Dear ROOTers, sometimes it is necessary to sort objects stored in whatever collection in a way, which one wouldn't like to code in ::Compare method of an object. In my case I have a list of jets and I want to order the jets based on the corrected value of jet Et, where the algorithm of correcting the jet Et is a) complicated b) not very stable so you really don't want to hide it in Jet::Compare (in this example I assume that Jet inherits from TObject and can overload its Compare method). I remember that this issue has been discussed a while ago however looking at the source codes I didn't find any resolution of it. Reiterating, I think it would be very nice to have a method like TCollection::Sort(less), where `less' is a comparison function for 2 objects with the signature Int_t less(TObject* a, TObject* b); I apologise if I missed something which already exists, thanks, Pasha
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:37 MET