Dear ROOT experts,
I defined a C function that I use to create a TF1 with parameters. [*]
I store it in a root file to use it later in another code.
However when trying to use it with different sets of parameters, for a fixed input variable value, I get always the same output value.
It seems that it is blocked on one given set of parameters and does not take into account different parameters when trying “EvalPar” or “SetParameters” methods.
Would you have an idea of what is going on ?
Here is an extract of [*] :
[quote]Double_t myFuncTurnOnMu(Double_t *x, Double_t *par) {
Double_t pt = x[0];
Double_t eta = par[0];
Int_t run = (Int_t)par[1];
Int_t ratio = (Int_t)par[2];
const int nEta=6;
const int nRun=7;
ratioEfficiencyTest* fitEffMu[nRun][nEta];
fitEffMu[0][0] = new ratioEfficiencyTest(16.9993, 8.82202e-05, 7.91529e-08, 1.40792, 0.928102);
fitEffMu[0][1] = new ratioEfficiencyTest(16.9824, 0.0694986, 0.0186614, 1.66577, 0.908218);
[…]
// choose iEta //
int iEta;
if(eta < -1.2) iEta = 0;
[…]
if(ratio==0) return fitEffMu[run][iEta]->turnOn(pt) ;
else {
if(run>=0 && run<=3)
return fitEffMu[4][iEta]->turnOn(pt)!=0 ? fitEffMu[run][iEta]->turnOn(pt) / fitEffMu[4][iEta]->turnOn(pt) : 0;
[…][/quote]
Thanks in advance !