Hello,
I’m trying to generate a toy model and fit the parameters Cs,Cint on it with a pdf of the following form :
f(t)=CSexp(-x) +CLexp(-xTau1/Tau2)+Cint cos(phi-mx)exp(-xTau1/Tau3)
Tau2 >>Tau1 and Tau3=2Tau1
Physically, the last term is coming from interferance between other two channels.
Typical value of the parameters are CS=0.43, Cint=0.12*0.28 , CL=1 ( I don’t fit it, it is just to normalize other coefficients)
First try building the pdf with string expression :
RooRealVar x("x", "x", startt, endd);
RooRealVar CS("CS", "CS", CSv, 0.00, 1.0);
RooRealVar Cint("Cint", "Cint", Cintv, 0.00, 1.0);
ostringstream decayform, decayfit;
decayform<<CL<<"*exp(-x*"<<tauKS/tauKL<<") + CS*exp(-x*"<<tauKS/tauKS<<") + 2*exp(-x*"<<tauKS/tauK<<")*"<<DiluCon<<"*Cint*cos("<<Phi0<<"-("<<dMK<<"*x/"<<tauKS<<"e-9))";
decayfit<<CL<<"*exp(-x*"<<tauKS/tauKL<<") + CS*exp(-x*"<<tauKS/tauKS<<") + 2*exp(-x*"<<tauKS/tauK<<")*"<<DiluCon<<"*Cint*cos("<<Phi0<<"-("<<dMK<<"*x/"<<tauKS<<"e-9))";
RooGenericPdf decaypdf("decaypdf", "decaypdf", decayform.str().c_str(), RooArgSet(x, CS, Cint));
RooGenericPdf decaypdfit("decaypdfit", "decaypdfit", decayfit.str().c_str(), RooArgSet(x, CS, Cint));
CS.setVal(CSv);
Cint.setVal(Cintv);
RooDataSet *data = decaypdf.generate(x, events);
TH1 *roohist = data->createHistogram("roohist", x, Binning(bins,startt,endd));
RooDataHist rdh("rdh", "rdh", x, roohist);
CS.setVal(0);
Cint.setVal(0);
std::unique_ptr<RooFitResult> fitResult{decaypdfit.fitTo(rdh, Save())};
With this code I found really bad error on Cint : around 40 %
With another form using Rooaddpdf and then normalising the coefficient (dividing them by 1+CS+Cint), the fit now gives Cint with an error of 15%.
The code is :
ostringstream decayKS,decayKL,decayKint;
decayKS<<"exp(-x*"<<tauKS/tauKS<<")";
decayKL<<"exp(-x*"<<tauKS/tauKL<<")";
decayKint<<"2*exp(-x*"<<tauKS/tauK<<")*"<<DiluCon<<"*cos(Phi0-("<<dMK<<"*x/"<<tauKS<<"e-9))";
RooRealVar x("x", "x", startt, endd);
RooRealVar CS("CS", "CS", CSv/(1+CSv+Cintv*DiluCon), 0.00, 1.0);
RooRealVar Cint("Cint", "Cint", Cintv/(1+CSv+Cintv*DiluCon), 0.00, 1.0);
RooRealVar Phi0("Phi0", "Phi0", gRandom->Gaus(Phi0v,0.1), -1, 1);
RooGaussian Phicon("Phicon","Phicon", Phi0, RooConst(Phi0v), RooConst(0.1/*From Precision Measurement Paper*/)) ;
RooGenericPdf decaypdfKS("decaypdfKS", "decaypdfKS", decayKS.str().c_str(), RooArgSet(x,Phi0));
RooGenericPdf decaypdfKL("decaypdfKL", "decaypdfKL", decayKL.str().c_str(), RooArgSet(x,Phi0));
RooGenericPdf decaypdfKint("decaypdfKint", "decaypdfKint", decayKint.str().c_str(), RooArgSet(x,Phi0));
RooAddPdf model("model","model",RooArgList(decaypdfKS,decaypdfKint,decaypdfKL),RooArgList(CS,Cint)) ;
This is done with phi fixed or constrained around 0.20 for 100k events in total, I end up at best with a 15% error on Cint which is way more than 1/sqrt(Nint).
I don’t understand where the difference over the result between two techniques come from since I use the same number of event and the same fitting technique, I just use two different way to build the pdf isn’t it ?
Also I noticed that CS and Cint are really strongly correlated ( correlation of -0.96 on average !) which may explain why the fit is not that good. Do you have any idea of how to improve it ?
Moreover, I would like to do the same with destructive interferences ( phi close to pi ) but for that rooaddpdf no longer works because the part of the pdf with interference has now negative value.