Re: list of unique values from a TTree

From: Tim Head <betatim_at_gmail.com>
Date: Fri, 25 May 2012 14:23:53 +0100


Hello Rob,

On Fri, May 25, 2012 at 2:08 PM, Rob Mahurin <rob_at_jlab.org> wrote:
>
>        2. Why is this (and the equivalent GetEntry loop called from
>           CINT) so much slower that tree.Draw("scandata1")?
>

A workaround for this might be to use something along the following (unfortunately) multi line snippet:

tree.Draw("scandata1>>h", "goff")
v1 = tree.GetV1() # gets an array of value you jsut drew set(v1[n] for n in xrange(tree.GetEntries())

I think the reason things are so much slower from python is because ROOT was written as a C++ library with a pretty nifty python interface bolted on afterwards, instead of being written in C++ as a python library from the get go.

Tim

-- 
http://tim.jottit.com/
Received on Fri May 25 2012 - 15:24:01 CEST

This archive was generated by hypermail 2.2.0 : Fri May 25 2012 - 23:50:02 CEST