Re: Processing only specific entries of a TTree

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Sun, 29 Aug 2010 14:54:25 +0200


Hi Mario,

see e.g. TEntryList. It should also work with cloning trees.

Cheers, Axel.

On 8/29/10 2:42 PM, Mario Kadastik wrote:
> Hello,
>
> I'm trying to write a piece of code that writes a portion of a TTree out to a CSV file based on some pre-selection criteria.
>
> I know TTree has the function GetEntries("selection") that gives me the number of entries that match the criteria and I can use this too to limit entries that I use in for example TTree::Draw, but it seems I can't easily iterate over those TTree entries, but would instead have to process every entry and check that the variables match the conditions I had set. Knowing that the cut power is an order of magnitude I'd think the code would be more optimal if I could just process the pre-selected entries.
>
> I'm currently looking into TTreeCloner etc, but any recommendations would be helpful. Also, if there's an easy piece of code to convert a TTree made of basic variables to a CSV, then even better...
>
> Mario Kadastik, PhD
> Researcher
>
> ---
> "Physics is like sex, sure it may have practical reasons, but that's not why we do it"
> -- Richard P. Feynman
>
>
Received on Sun Aug 29 2010 - 14:54:34 CEST

This archive was generated by hypermail 2.2.0 : Sun Aug 29 2010 - 17:50:01 CEST