Hi,
I couldn’t find how to use EvalPar(const double* x, const double* p) of TTreeFormula. My basic confusion is
how to provide x and p array those have tree variables and parameters in same sequence as the TTreeFormula.
Hi,
Neither Eval not EvalPar are supported in TTreeFormula (those are relics of a somewhat odd inheritance tree).
Cheers,
Philippe.
Okk…
Actually the reason I wanted it, was that, I want to optimize the coefficients of an user defined function.
The procedure of this optimisations is like,
- User provides the functional form in terms of different variables stored in different branches of a TTree, from an input file
- User provides the initial value, step size and and limits on parameters in same file
- This functional form is used to calculate some parameter called theta for each entry in TTree and then average theta of all entries is calculated
- The parameters are optimized by minimizing average theta.
I have written the code using TTreeFormula, but it doesn’t seem to work as expected. Please tell me what’s wrong. I am attaching the code,input file and the ROOT file here. The parameter ‘PARA01’ in disp formula doesn’t get updated in each TMinuit minimization call and that’s the problem.
DispOptimisation.txt (196 Bytes)
DispOptimisation.cxx (9.4 KB)
This is the .root file that contains the data over which minimization works.
It is much smaller version of actual file.
Do
g++ DispOptimisation.cxx root-config --cflags --libs --glibs
-lMinuit -lTreePlayer -o DispOptimisation
then
./DispOptimisation DispOptimisation.input 1
ParamC.root (16 KB)
Okk… Solved the problem… It was small mistake… sorry