Dear All,
I have simple macro like below:
[code]class asd : public TObject {
private:
TF1 * f_n_Ev_r;
public:
double fcn2(double * a_, double * p_) {
return a_[0]/2.0;
}
double fcn_Ev_r(double * th_, double * p_);
asd() {
param = 3.14;
TF1 * f2 = new TF1("f2", asd::fcn2, 0, 10, 0);
f_n_Ev_r = new TF1("n(Ev, r);Energy;radius", asd::fcn_Ev_r, 0, TMath::Pi()/128.0, 0);//1
f2->DrawCopy("same");
f_n_Ev_r->DrawCopy("same");
}
};
double asd::fcn_Ev_r(double * th_, double * p_) {
double th = atan(th_/1.0);
return 0.999 * 30 * (1.0 + 0.9cos(th));
}
double fcn(double * a_, double * p_) {
return p_[0] * a_[0];
}
double fcnn(double * a_, double * p_) {
return p_[0] * a_[0];
}
test() {
TF1 * f = new TF1(“f”, fcn, 0, 10, 1);
TF1 * fn = new TF1(“fn”, fcnn, 0, 10, 1);
f->SetParameter(0, 3);
fn->SetParameter(0, 2);
f->DrawCopy();
fn->DrawCopy("same");
new asd();
}[/code]
Problem is when I run it, i get:
Error: Cint::G__CallFunc::SetArgArray() must be initialized with 'Cint::G__CallFunc::SetFunc(G__ClassInfo* cls,char* fname,char* args,long* poffset)' first
Error: Cint::G__CallFunc::SetArgArray() must be initialized with 'Cint::G__CallFunc::SetFunc(G__ClassInfo* cls,char* fname,char* args,long* poffset)' first
This problem relates to:
f2->DrawCopy("same");
f_n_Ev_r->DrawCopy("same");
But problem exist only for TF1 created from class member functions. Other two created from global functions work fine.
Can somebody explain it to me?
Cheers,
Rafal