boudry
February 12, 2004, 3:09pm
1
Bonjour,
We have a certain number of files containing trees which were produced using a few calls to Branch(name, address, leaflist), ie simple data mode.
How could one apply some methods on these branches (eg as summing of an array) and use them in a TTree:Draw, without recreating everything ?
Is there a way for exemple to give a classname ?
Merci d’avance.
Vincent Boudry.
pcanal
February 15, 2004, 6:11pm
2
Hi,
You can use the skeleton produced using TTree::MakeSelector (or TTree::MakeClass).
In TTree::Draw you can also call a method that takes numerical
arguments and return numerical arguments. For example:
Cheers,
Philippe
boudry
February 20, 2004, 9:28am
3
Thank you for your answer,
I do use the MakeClass, my point was more to have a practical use of the Draw call for interactive building work.
Concerning the code:
As far as I can deduce, the branch variable is in effect an alias of the first variable in that branch. Is that true ?
Can I then assume that the all the elements of the branch are contiguous in memory ?
best regards, Vincent.
pcanal
February 20, 2004, 2:53pm
4
This is absolutely correct.
Not in this context. In the memory allocated by the branches for its data, the elements are usually contiguous in memory. When TTree::Draw calls a sub-functions, it sends a copy of the numerical value (and the rest of the data is NOT contiguous with that temporary).
Cheers,
Philippe.