Hi,
ROOT 6.18 seems to have an issue updating TF1Convolution objects constructed from defined TF1 objects. Partly taken from the fitConvolution.cxx tutorial, here is a MWE:
Double_t FExpo(Double_t* x, Double_t* p){
return p[0]*TMath::Exp(-p[1]*x[0]);
}
Double_t FGaus(Double_t* x, Double_t* p){
return p[0]*TMath::Gaus(x[0],0,p[1],true);
}
TF1* F1 = new TF1("Gaus",FGaus,-1,6,2)
TF1* F2 = new TF1("Expo",FExpo,-1,6,2)
TF1Convolution *f_conv = new TF1Convolution(F1,F2,-1,6,true);
f_conv->SetRange(-1.,6.);
f_conv->SetNofPointsFFT(1000);
TF1 *f = new TF1("f",f_conv, 0., 5., f_conv->GetNpar());
f->SetParameters(1.,-0.3,0.,1.);
If you draw f
, you will see that the parameters have not updated from 0, nor will changing them again or calling Update on any of the objects fix this… I need to define my own TF1 objects this way since I’m convolving a Cauchy (lorentzian) distribution with an exponentially modified gaussian.
I recently updated from 6.10.08 where this worked.
ROOT Version: 6.18/00
Platform: linuxx8664gcc
Compiler: Provided