Hi Rene,
I had looked at TTree::UnbinnedFit and TTree::Fit, and found that they would not permit (or I had not enough imagination) for the kind of expression I wanted. A histogram or distribution is not what I am trying to work with, but something more the equivalent to a TGraph::Fit, but where there can be an arbitrary number of tree variables involved.
This is a very easy routine or method to write for the general case IF TTreeFormula's can treat the '[0]', '[1]', etc.... parameters the way the TFormula does.
Thanks for your help,
Rob Feuerbach
On Wed, 11 Oct 2006, Rene Brun wrote:
> 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:46:55 MEST
This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:01 MET