SetArgArray() must be initialized

What’s the meaning of the following error?

Error: Cint::G__CallFunc::SetArgArray() must be initialized with ‘Cint::G__CallFunc::SetFunc(G__ClassInfo* cls,char* fname,char* args,long* poffset)’ first

I get this when fitting a TH1F with a TF1 that uses a compiled function – the TF1 is constructed with

TF1* tfx = new TF1 (“tfx”, NacResponseFunction::wrapAFunc, 0, 1000, 6);

I hope it suffices to say NacResponseFunction::wrapAFunc is a compiled Double_t function of (double* x, double* p) and it uses x[0] and p[0] through p[5]. Now, I can draw tfx with no trouble and it looks fine. I can fit a histogram with it, getting reasonable results and no errors, if I specify option “n”:

root[26] adc_clean8->Fit(tfx,“n”)
FCN=578.07 FROM MIGRAD STATUS=CONVERGED 38 CALLS 39 TOTAL
EDM=5.32617e-16 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 p0 6.00000e+00 fixed
2 p1 4.60162e+02 5.75787e-01 -0.00000e+00 7.60322e-08
3 p2 2.77324e+00 2.37421e-02 0.00000e+00 -1.66182e-08
4 p3 8.45214e+01 4.73450e-01 -0.00000e+00 6.30600e-08
5 p4 0.00000e+00 fixed
6 p5 0.00000e+00 fixed
(Int_t)(0)

If instead I specify option “0” I get a single occurrence of the error mentioned above, and if I specify neither option I get a huge number of occurrences of that error. Likewise I get many errors if I try to draw adc_clean8 after the fit. But no error if I draw tfx after the fit.

This happens in an interpreted macro. But if I compile the macro, I get reasonable behavior and no errors. (The function itself isn’t in the interpreted macro; it’s compiled. The interpreted macro just constructs the TF1 and does the fit.)

[quote] TF1* tfx = new TF1 (“tfx”, NacResponseFunction::wrapAFunc, 0, 1000, 6); [/quote]Will work if and only if NacResponseFunction is a namespace (and not a class).

Philippe

NacResponseFunction is indeed a namespace, not a class; sorry I forgot to mention that. So that should not be the problem.

Could you provide us with a complete running example of this issue?

Thanks,
Philippe

I don’t have a simple example at this time. This is occurring in an application I’m starting to put together, with a number of new classes and namespaces; too complex, I think, for me to post here – it’d only confuse things. I can try to strip it down to something simpler but that will take some time. I was hoping someone could tell me the meaning of the rather cryptic error message so I would know what to look for in my code.