randomize tree/ntpl

From: Rutger van der Eijk (r36@nikhef.nl)
Date: Wed Feb 16 2000 - 14:31:18 MET


Hi,

Does anybody know of an easy way to randomize the entries of a ntuple?

The problem I have is that I have a TNtuple with lets say 1000 entries.
However due to some reason (clear to me, but not important to you) the
entries are in a certain order. I want to remove this order by randomizing
the entry order.

I thought of randomly swapping entries within the ntpl. But I didn't find
a method to do so (something like refill...). 

If I could use STL within CINT I would just make a list<int>, where the
integer is the index number. Then randomize the list with random_shuffle
(stl algorithm), and finally copy the elements of the ntpl into another
ntpl in the order defined by the randomized list<int>.

I don't see how I can easily do this with ROOT inside CINT. (defining
list<int> gives me 

Limitation: Can't instantiate precompiled template list<int>
FILE:/user/r36/mycmt/ot/ott/current/macros/rtNtplDipCorrector.C LINE:139

Any suggestions how to do this with ROOT list/vector classes?

Rutger



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:19 MET