Re: Using Parameters in TTreeFormula's?

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 11 Oct 2006 22:17:49 +0200


Robert,

Have a look at either TTree::Fit or better at TTree::UnbinnedFit http://root.cern.ch/root/htmldoc/TTree.html#TTree:Fit http://root.cern.ch/root/htmldoc/TTree.html#TTree:UnbinnedFit

Rene Brun

Robert Feuerbach wrote:
> Hi,
>
> Are there plans to permit normal TFormula parameters in an
> expression using a TTreeFormula? For instance, I'd like to write
> something like:
>
> TTreeFormula totEdiff("totEdiff",
> "electronP-([0]*preshowerE+[1]*showerE)",tree);
>
> where 'electronP', 'preshowerE' and 'showerE' are simple leafs in
> tree. This can be done in TFormula's, but does not appear to
> work in TTreeFormula's. In TTreeFormula::DefinedVariable fNpar
> is set to 0 and the class never looks back.
>
> I'm trying to write a general routine to minimize expressions in
> terms of tree variables by varying the set of parameters, but the
> TTreeFormula's are completely unaware of the normal '[0]'-like
> parameters. I know it can by minimized by writing a macro using
> TFitter and TMinuit directly, but I'd like to have a more general
> implementation since this is common task. It could even evolve
> into a TTree::Minimize kind of method.
>
> Thank you,
> Rob Feuerbach
>
> /***************************************************
> * Dr. Robert J. Feuerbach feuerbac_at_jlab.org *
> * 12000 Jefferson Avenue CEBAF Center A120 *
> * Suite 4 Office: (757) 269-7254 *
> * Newport News, VA 23606 Page: 584-7254 *
> * Fax: (757) 269-5703 Mailstop 12H3 *
> ***************************************************/
>
Received on Wed Oct 11 2006 - 22:17:57 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:01 MET