Re: How to get only a value in tree->Scan

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Mon, 23 Jan 2012 15:22:28 -0600


Hi Jordi,

Not directly. In order to get the value in a variable you need to use explicitly the TTreeFormula class. (See TTreePlayer::Scan for example on how to use it).

Cheers,
Philippe.

On 11/10/11 4:26 AM, Jordi Nadal wrote:
> Hello Philippe,
>
> another quick question ;)
>
>
> is there a way to save the output of :
>
> HangingTree->Scan("k_ttbar", "", "", 1, 0)
> HangingTree->Scan("k_ttbar", "", "", 1, 1)
>
> in a variable?
>
> something like int k = HangingTree->Scan("k_ttbar", "", "", 1, 0) ??
>
> Thanks!
>
> Jordi
>
>
> On Nov 9, 2011, at 5:50 PM, Philippe Canal wrote:
>
>> Hi,
>>
>> Try:
>> HangingTree->Scan("k_ttbar","","col=d");
>>
>> See description TTree::Scan / TTreePlayer::ScanSelect for details.
>>
>> Cheers,
>> Philippe.
>>
>>
>> On 11/9/11 9:51 AM, Jordi Nadal wrote:
>>> Hello experts,
>>>
>>> Quick question:
>>>
>>> Is there a way to get only the value for 0, or 1, ...
>>>
>>> root [18] HangingTree->Scan("k_ttbar")
>>> ************************
>>> * Row * k_ttbar *
>>> ************************
>>> * 0 * 0.9779894 *
>>> * 1 * 0.9909867 *
>>> * 2 * 0.9958174 *
>>> * 3 * 1.0182429 *
>>> * 4 * 1.0084756 *
>>> * 5 * 1.0146944 *
>>> * 6 * 0.9960489 *
>>> * 7 * 1.0123547 *
>>> * 8 * 0.9920289 *
>>> * 9 * 0.9788400 *
>>> ************************
>>> (Long64_t)10
>>> root [19]
>>>
>>> Thanks you!
>>>
>>>
>>> Jordi Nadal
>>>
>>> --
>>> Avís - Aviso - Legal Notice - (LOPD) - http://legal.ifae.es <http://legal.ifae.es/>
>>>
>
> Jordi Nadal
>
> --
> Avís - Aviso - Legal Notice - (LOPD) - http://legal.ifae.es <http://legal.ifae.es/>
>
Received on Mon Jan 23 2012 - 22:22:37 CET

This archive was generated by hypermail 2.2.0 : Tue Jan 24 2012 - 11:50:01 CET