Re: [ROOT] Broken Link on TMinuit.html

From: kmakonyi@nist.gov
Date: Sat Jul 27 2002 - 08:02:51 MEST


Dear All,

Is there any trick to take a "user defined function" to a member of a class?
I've tried the follow and it didn't work.
The error message:
"Symbol A is not defined in current scope".


class probe{
 public:
  probe::probe();
  probe::~probe();
  Double_t Voigt(Double_t* x, Double_t* par);
};

Double_t probe::Voigt(Double_t* x, Double_t* par){
  Double_t arg = 0;
  if(par[2])
    arg = (x[0] - par[1]) / par[2];
  Double_t Gaus = TMath::Exp( -0.5 * arg * arg );
  Double_t Lorentz = 1 / ( 1 + arg * arg );
  return par[0] * ( par[3] * Gaus + ( 1- par[3] ) * Lorentz );
}

main(){
  probe A;
  TF1* f1 = new TF1("f1", A.Voigt, 100, 200, 4); 
}



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:01 MET