Linear Fitter without "++"

From: Gemmel, Claudia <gemmelc_at_uni-mainz.de>
Date: Thu, 17 Dec 2009 16:26:45 +0100


Hello,

could anyone tell me if there is a possibility to tell ROOT to use the linear fitter without using the syntax "++"? My fit function is a piecewise defined function, but it is linear in the parameters. So I would like to use a C function in the following way:

Double_t fitfun(Double_t *x, Double_t *par) {

   Double_t returnval;
   Double_t t =x[0];
   Double_t ws = 7.2921150e-5; 
   Double_t t01 = 0;
   Double_t t02 = 137554;
   Double_t tmess1 = 52000;   
   Double_t tmess2 = 47000;    
  
   if (t <= tmess1) {
     returnval= par[2] + par[3]*(t-t01) + TMath::TwoPi()/ws*(par[0]*sin(ws*t)-par[1]*cos(ws*t)); 
   }
   else {
   if ((t > t02) && (t <= (t02+tmess2)))      returnval= par[6] + par[7]*(t-t02) + TMath::TwoPi()/ws*(par[0]*sin(ws*t)-par[1]*cos(ws*t));    }
   return returnval;
}

But here I cannot use the "++" notation... Thanks in advance for your help!
Claudia Received on Thu Dec 17 2009 - 16:26:51 CET

This archive was generated by hypermail 2.2.0 : Fri Dec 18 2009 - 17:50:03 CET