flexibility in sort compare functions

George Irwin (gmieg@EGNEXT1.SLAC.STANFORD.EDU)
Mon, 02 Feb 1998 14:24:27 -0800


I need the ability to sort a TClonesArray with various compare
functions. For example, sort on plane number, or counter number
within plane, or pulse height, or time, or some combination of these,
etc. TClonesArray seems to want me to compile my compare function
into the object occupying the TClonesArray. But I need the
flexibility to define new kinds of sorts in an analysis job
constructed after the object in the TClonesArray is defined.
With STL containers I would use the STL sort construct with different
externally defined compare functions. How can I achieve this
functionality with TClonesArray. Thanks. George