380099b397600c479553159f88970e392381f953
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliDielectronBtoJPSItoEleCDFfitFCN.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15 #include <TFormula.h>
16 #include <TF1.h>
17 #include <TCanvas.h>
18 #include <TMath.h>
19
20 #include <AliLog.h>
21
22 #include "AliDielectronBtoJPSItoEleCDFfitFCN.h"
23
24 //_________________________________________________________________________
25 //                        Class AliDielectronBtoJPSItoEleCDFfitFCN
26 //                   Definition of main function used in 
27 //                     unbinned log-likelihood fit for
28 //                 the channel B -> JPsi + X -> e+e- + X
29 //      
30 //                           Origin: C.Di Giglio
31 //       Contact: Carmelo.Digiglio@ba.infn.it , Giuseppe.Bruno@ba.infn.it
32 //_________________________________________________________________________
33
34 ClassImp(AliDielectronBtoJPSItoEleCDFfitFCN)
35
36         //_________________________________________________________________________________________________
37         AliDielectronBtoJPSItoEleCDFfitFCN::AliDielectronBtoJPSItoEleCDFfitFCN() :
38                 fFPlus(0.),
39                 fFMinus(0.),
40                 fFSym(0.),
41                 fintmMassSig(1.),
42                 fintmMassBkg(1.),
43                 fhCsiMC(0x0),
44                 fMassWndHigh(0.),
45                 fMassWndLow(0.),
46                 fCrystalBallParam(kFALSE)
47 {
48         //
49         // constructor
50         //
51         SetCrystalBallFunction(kFALSE);
52         SetMassWndHigh(0.2);
53         SetMassWndLow(0.5);
54         for(Int_t iPar = 0; iPar < 20; iPar++) fParameters[iPar] = 0.;
55         fParameters[9] = 1.;fParameters[11] = 1.;fParameters[12] = 1.;
56         for(Int_t index=0; index<4; index++) fResolutionConstants[index] = 0.;
57         AliInfo("Instance of AliDielectronBtoJPSItoEleCDFfitFCN-class created");
58 }
59 //_________________________________________________________________________________________________
60 AliDielectronBtoJPSItoEleCDFfitFCN::AliDielectronBtoJPSItoEleCDFfitFCN(const AliDielectronBtoJPSItoEleCDFfitFCN& source) :
61         TNamed(source),
62         fFPlus(source.fFPlus),
63         fFMinus(source.fFMinus),
64         fFSym(source.fFSym),
65         fintmMassSig(source.fintmMassSig),
66         fintmMassBkg(source.fintmMassBkg),
67         fhCsiMC(source.fhCsiMC),
68         fMassWndHigh(source.fMassWndHigh),
69         fMassWndLow(source.fMassWndLow),
70         fCrystalBallParam(source.fCrystalBallParam)
71 {
72         //
73         // Copy constructor
74         //
75         for(Int_t iPar = 0; iPar < 20; iPar++) fParameters[iPar] = source.fParameters[iPar];
76         for(Int_t index=0; index<4; index++) fResolutionConstants[index] = source.fResolutionConstants[index];
77 }
78 //_________________________________________________________________________________________________
79 AliDielectronBtoJPSItoEleCDFfitFCN& AliDielectronBtoJPSItoEleCDFfitFCN::operator=(const AliDielectronBtoJPSItoEleCDFfitFCN& source) 
80 {
81         //
82         // Assignment operator
83         //
84         if(&source == this) return *this;
85         fFPlus = source.fFPlus;
86         fFMinus = source.fFMinus;
87         fFSym = source.fFSym;
88         fintmMassSig = source.fintmMassSig;
89         fintmMassBkg = source.fintmMassBkg;
90         fhCsiMC = source.fhCsiMC;
91         fCrystalBallParam = source.fCrystalBallParam;
92
93         for(Int_t iPar = 0; iPar < 20; iPar++) fParameters[iPar] = source.fParameters[iPar];
94         for(Int_t index=0; index<4; index++) fResolutionConstants[index] = source.fResolutionConstants[index];
95
96         return *this;
97 }  
98 //_________________________________________________________________________________________________
99 AliDielectronBtoJPSItoEleCDFfitFCN::~AliDielectronBtoJPSItoEleCDFfitFCN()
100 {
101         //
102         // Default destructor
103         //
104
105         delete fhCsiMC;
106         for(Int_t iPar = 0; iPar < 20; iPar++) fParameters[iPar] = 0.;
107         for(Int_t index=0; index<4; index++) fResolutionConstants[index] = 0.;
108 }
109 //_________________________________________________________________________________________________
110 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::EvaluateLikelihood(const Double_t* pseudoproperdecaytime,
111                 const Double_t* invariantmass, const Int_t ncand) const
112 {
113         //
114         // This function evaluates the Likelihood fnction
115         // It returns the -Log(of the likelihood function)
116         //
117         Double_t f = 0.;
118         Double_t ret = 0.;
119
120         for(Int_t i=0; i < ncand; i++) {
121                 f = EvaluateCDFfuncNorm(pseudoproperdecaytime[i],invariantmass[i]);
122                 if(f <= 0.) continue;  
123                 ret += -1*TMath::Log(f);  
124         }
125         return ret;
126 }
127 //_________________________________________________________________________________________________
128 void AliDielectronBtoJPSItoEleCDFfitFCN::SetAllParameters(const Double_t* parameters)
129
130         //
131         // Sets array of FCN parameters
132         //
133         for(Int_t index = 0; index < 20; index++) fParameters[index] = parameters[index];
134 }
135 //_________________________________________________________________________________________________
136 void AliDielectronBtoJPSItoEleCDFfitFCN::ComputeMassIntegral() 
137
138         //
139         // this function compute the integral of the likelihood function 
140         // (theoretical function) in order to normalize it to unity
141         //
142         Double_t npm = 20000.;
143         Double_t stepm;
144         Double_t mx=0.;
145         stepm = (fMassWndHigh-fMassWndLow)/npm; 
146         // compute integrals for  invariant mass terms        
147
148         Double_t iMassSig;
149         Double_t intmMassSig = 0.0;
150         Double_t summMassSig = 0.0;
151         for(iMassSig = 1.0;  iMassSig<= npm/2.; iMassSig++)  {
152                 mx = fMassWndLow + (iMassSig - .5)*stepm;
153                 summMassSig += EvaluateCDFInvMassSigDistr(mx);
154                 mx = fMassWndHigh - (iMassSig - .5)*stepm;
155                 summMassSig += EvaluateCDFInvMassSigDistr(mx);
156         }
157         intmMassSig = summMassSig*stepm;
158         SetIntegralMassSig(intmMassSig);
159         //
160         Double_t iMassBkg;
161         Double_t intmMassBkg = 0.0;
162         Double_t summMassBkg = 0.0;
163         for(iMassBkg = 1.0; iMassBkg <= npm/2.; iMassBkg++)  {
164                 mx = fMassWndLow + (iMassBkg - .5)*stepm;
165                 summMassBkg += EvaluateCDFInvMassBkgDistr(mx);
166                 mx = fMassWndHigh - (iMassBkg - .5)*stepm;
167                 summMassBkg += EvaluateCDFInvMassBkgDistr(mx);
168         }
169         intmMassBkg = summMassBkg*stepm;
170         SetIntegralMassBkg(intmMassBkg);
171 }
172 //_________________________________________________________________________________________________
173 void AliDielectronBtoJPSItoEleCDFfitFCN::PrintStatus()
174 {
175         //
176         //  Print the parameters of the fits 
177         //
178         printf("\n");
179         // background param
180         printf("actual value of fWeightRes------------------------------------->> | %f \n", GetResWeight());
181         printf("actual value of fPos ------------------------------------------>> | %f \n", GetFPlus());
182         printf("actual value of fNeg ------------------------------------------>> | %f \n", GetFMinus());
183         printf("actual value of fSym ------------------------------------------>> | %f \n", GetFSym()); 
184         printf("actual value of fOneOvLamPlus --------------------------------->> | %f \n", GetLamPlus());
185         printf("actual value of fOneOvLamMinus -------------------------------->> | %f \n", GetLamMinus());
186         printf("actual value of fOneOvLamSym ---------------------------------->> | %f \n", GetLamSym());
187         printf("actual value of fFractionJpsiFromBeauty ----------------------->> | %f \n", GetFractionJpsiFromBeauty());
188         printf("actual value of fFsig ----------------------------------------->> | %f \n", GetFsig());
189
190         if(fCrystalBallParam){
191                 printf("actual value of fCrystalBallMmean ----------------------------->> | %f \n", GetCrystalBallMmean());
192                 printf("actual value of fCrystalBallNexp ------------------------------>> | %f \n", GetCrystalBallNexp());
193                 printf("actual value of fCrystalBallSigma ----------------------------->> | %f \n", GetCrystalBallSigma());
194                 printf("actual value of fCrystalBallAlpha ----------------------------->> | %f \n", GetCrystalBallAlpha());
195                 printf("actual value of fCrystalBallNorm  ----------------------------->> | %f \n", GetCrystalBallNorm());
196         }else{
197                 printf("actual value of fMpv ------------------------------------------>> | %f \n", GetCrystalBallMmean());
198                 printf("actual value of fConstRovL ------------------------------------>> | %f \n", GetCrystalBallNexp());
199                 printf("actual value of fSigmaL --------------------------------------->> | %f \n", GetCrystalBallSigma());
200                 printf("actual value of fSigmaR --------------------------------------->> | %f \n", GetCrystalBallAlpha());
201         }
202
203         // back Mass func
204         printf("actual value of normBkg ----------------------------------------->> | %f \n", GetBkgInvMassNorm());
205         printf("actual value of meanBkg ----------------------------------------->> | %f \n", GetBkgInvMassMean());
206         printf("actual value of slopeBkg ---------------------------------------->> | %f \n", GetBkgInvMassSlope());
207         printf("actual value of constBkg ---------------------------------------->> | %f \n", GetBkgInvMassConst());
208         // resolution func
209         printf("actual value of norm1Gauss -------------------------------------->> | %f \n",GetNormGaus1ResFunc());
210         printf("actual value of norm2Gauss -------------------------------------->> | %f \n",GetNormGaus2ResFunc());
211
212         printf("\n");
213         // integrals constants
214         printf("Actual value of normalization integral for MassSig ---------------->> | %f \n", GetIntegralMassSig());
215         printf("Actual value of normalization integral for MassBkg ---------------->> | %f \n", GetIntegralMassBkg());
216
217         printf("\n");
218 }
219 //_________________________________________________________________________________________________
220 void AliDielectronBtoJPSItoEleCDFfitFCN::SetResolutionConstants(Double_t* resolutionConst)
221 {
222         //
223         // Resolution function is parametrized as the sum of two gaussian
224         //
225         fResolutionConstants[0]  = resolutionConst[0]; // mean 1
226         fResolutionConstants[1]  = resolutionConst[1]; // sigma 1
227         fResolutionConstants[2]  = resolutionConst[2]; // mean 2
228         fResolutionConstants[3]  = resolutionConst[3]; // sigma 2
229 }
230
231 //_________________________________________________________________________________________________
232 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::EvaluateCDFfunc(Double_t x, Double_t m) const 
233 {
234         return fParameters[8]*EvaluateCDFfuncSignalPart(x,m) + (1. - fParameters[8])*EvaluateCDFfuncBkgPart(x,m);
235 }
236
237 //_________________________________________________________________________________________________
238 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::EvaluateCDFfuncNorm(Double_t x, Double_t m) const
239 {
240         return EvaluateCDFfunc(x,m);
241 }
242
243 //_________________________________________________________________________________________________
244 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::EvaluateCDFfuncSignalPart(Double_t x, Double_t m) const 
245 {
246         return EvaluateCDFDecayTimeSigDistr(x)*(EvaluateCDFInvMassSigDistr(m)/fintmMassSig); 
247 }
248
249 //_________________________________________________________________________________________________
250 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::EvaluateCDFDecayTimeSigDistr(Double_t x) const
251 {
252         //
253         // Implementation of the Background part of the Likelyhood function
254         // 
255
256         Double_t retvalue = 0.;
257         Double_t funBnorm = FunB(x);
258         Double_t funPnorm = ResolutionFunc(x);
259         retvalue = fParameters[7]*funBnorm + (1. - fParameters[7])*funPnorm;
260         return retvalue;
261 }
262
263 //_________________________________________________________________________________________________
264 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::EvaluateCDFInvMassSigDistr(Double_t m) const
265
266         //
267         // Parametrization of signal part invariant mass distribution
268         // It can be either Crystal Ball function or sum of two Landau
269         //
270
271         Double_t fitval = 0.;
272
273         if(fCrystalBallParam){
274                 Double_t t = (m-fParameters[9])/fParameters[11]; ;
275                 if (fParameters[12] < 0) t = -t;
276
277                 Double_t absAlpha = TMath::Abs((Double_t)fParameters[12]);
278
279                 if (t >= -absAlpha) {
280                         return fParameters[13]*TMath::Exp(-0.5*t*t);
281                 }
282                 else {
283                         Double_t a =  TMath::Power(fParameters[10]/absAlpha,fParameters[10])* TMath::Exp(-0.5*absAlpha*absAlpha);
284                         Double_t b= fParameters[10]/absAlpha - absAlpha;
285                         fitval = (fParameters[13]*a/TMath::Power(b - t, fParameters[10]));
286                         return fitval;
287                 }
288         }else{
289                 Double_t t=-1*m;
290                 Double_t tmpv=-1*fParameters[9];
291                 fitval=TMath::Sqrt(TMath::Landau(t,tmpv,fParameters[11]));
292                 fitval += fParameters[10]*(TMath::Landau(m,fParameters[9],fParameters[12]));
293                 return fitval;
294         }
295 }
296 //_________________________________________________________________________________________________
297 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::FunB(Double_t x) const  
298 {
299         //  
300         // Parameterisation of the fit function for the x part of the Background
301         //
302         Double_t np = 1000.0;
303         Double_t sc = 10.;
304         Double_t sigma3 = 1000.; // valore usato nella macro
305         Double_t xprime;
306         Double_t sum = 0.0;
307         Double_t xlow,xupp;
308         Double_t step;
309         Double_t i;
310         xlow = x - sc * sigma3 ;
311         xupp = x + sc * sigma3 ;
312         step = (xupp-xlow) / np;
313         Double_t csiMCxprime = 0.;
314         Double_t resolutionxdiff = 0.;
315         Double_t xdiff = 0.;
316
317         for(i=1.0; i<=np; i++){
318                 xprime = xlow + (i-.5) * step;
319                 csiMCxprime = CsiMC(xprime);
320                 xdiff = xprime - x;
321                 resolutionxdiff = ResolutionFunc(xdiff); // normalized value
322                 sum += csiMCxprime * resolutionxdiff;
323         }
324
325         return step * sum ;
326 }
327 //_________________________________________________________________________________________________
328 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::FunP(Double_t x) const 
329 {
330         //
331         //  Parameterisation of the Prompt part for the x distribution
332         //
333         return ResolutionFunc(x);
334 }
335
336
337 //_________________________________________________________________________________________________
338 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::CsiMC(Double_t x) const 
339 {
340         //
341         //  Distribution (template) of the x distribution for the x variable 
342         //  for the J/psi coming from Beauty hadrons
343         //
344         Double_t returnvalue = 0.;
345
346         if((fhCsiMC->FindBin(x) > 0) && (fhCsiMC->FindBin(x) < fhCsiMC->GetNbinsX()+1))  
347                 returnvalue = fhCsiMC->Interpolate(x);
348
349         return returnvalue;
350 }
351
352 //_________________________________________________________________________________________________
353 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::EvaluateCDFfuncBkgPart(Double_t x,Double_t m) const 
354 {
355         //
356         // Return the part of the likelihood function for the background hypothesis
357         //
358         return EvaluateCDFDecayTimeBkgDistr(x)*(EvaluateCDFInvMassBkgDistr(m)/fintmMassBkg);
359 }  
360
361 //_________________________________________________________________________________________________
362 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::EvaluateCDFDecayTimeBkgDistr(Double_t x) const 
363 {
364         //
365         // it returns the value of the probability to have a given x for the background 
366         //
367
368         Double_t ret = fParameters[0]/(fParameters[0]+fParameters[1]+fParameters[2]+fParameters[3])*ResolutionFunc(x) + fParameters[1]/(fParameters[0]+fParameters[1]+fParameters[2]+fParameters[3])*FunBkgPos(x) +  fParameters[2]/(fParameters[0]+fParameters[1]+fParameters[2]+fParameters[3])*FunBkgNeg(x) + fParameters[3]/(fParameters[0]+fParameters[1]+fParameters[2]+fParameters[3])*FunBkgSym(x);
369         return ret;
370 }
371
372 //_________________________________________________________________________________________________
373 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::EvaluateCDFInvMassBkgDistr(Double_t m) const 
374 {
375         //
376         // it returns the value of the probability to have a given mass for the background
377         //
378         Double_t value = 0.;
379         value = fParameters[14]*TMath::Exp(-1*(m-fParameters[15])/fParameters[16]) + fParameters[17];  
380         return value;
381 }
382 //_________________________________________________________________________________________________
383 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::FunBkgPos(Double_t x) const 
384 {
385         //
386         // exponential with positive slopes for the background part (x)
387         //
388
389         Double_t np = 1000.0;
390         Double_t sc = 10.;      
391         Double_t sigma3 = 1000.; // valore usato nella macro 
392         Double_t xprime;
393         Double_t sum = 0.0;
394         Double_t xlow,xupp;
395         Double_t step;
396         Double_t i;
397         xlow = x - sc * sigma3 ;
398         xupp = x + sc * sigma3 ;
399         step = (xupp-xlow) / np;
400
401         for(i=1.0; i<=np/2; i++) {
402                 xprime = xlow + (i-.5) * step;
403                 if (xprime > 0) {sum += fParameters[4] * TMath::Exp(-1*xprime*fParameters[4])*(ResolutionFunc(xprime-x));}
404                 xprime = xupp - (i-.5) * step;
405                 if (xprime > 0) {sum += fParameters[4] * TMath::Exp(-1*xprime*fParameters[4])*(ResolutionFunc(xprime-x));}
406         }
407
408         return step * sum ;
409 }
410 //_________________________________________________________________________________________________
411 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::FunBkgNeg(Double_t x) const 
412 {
413         //
414         // exponential with negative slopes for the background part (x)
415         //
416         Double_t np = 1000.0;
417         Double_t sc = 10.;      
418         Double_t sigma3 = 1000.; 
419         Double_t xprime;
420         Double_t sum = 0.0;
421         Double_t xlow,xupp;
422         Double_t step;
423         Double_t i;
424         xlow = x - sc * sigma3 ;
425         xupp = x + sc * sigma3 ;
426         step = (xupp-xlow) / np;
427
428         for(i=1.0; i<=np/2; i++) {
429
430                 xprime = xlow + (i-.5) * step;
431                 if (xprime < 0) {sum += fParameters[5] * TMath::Exp(xprime*fParameters[5]) * (ResolutionFunc(xprime-x));}
432
433                 xprime = xupp - (i-.5) * step;
434                 if (xprime < 0) {sum += fParameters[5] * TMath::Exp(xprime*fParameters[5]) * (ResolutionFunc(xprime-x));}
435         }
436
437         return step * sum ;
438 }
439 //_________________________________________________________________________________________________
440 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::FunBkgSym(Double_t x) const 
441 {
442         //
443         // exponential with both positive and negative slopes for the background part (x)
444         //
445         Double_t np = 1000.0;
446         Double_t sc = 10.;      
447         Double_t sigma3 = 1000.; 
448         Double_t xprime;
449         Double_t sum1 = 0.0;
450         Double_t sum2 = 0.0;
451         Double_t xlow,xupp;
452         Double_t step;
453         Double_t i;
454         xlow = x - sc * sigma3 ;
455         xupp = x + sc * sigma3 ;
456         step = (xupp-xlow) / np;
457
458         for(i=1.0; i<=np/2; i++) {
459
460                 xprime = xlow + (i-.5) * step;
461                 if (xprime > 0) {sum1 += 0.5 * fParameters[6]*TMath::Exp(-1*xprime*fParameters[6]) * (ResolutionFunc(xprime-x));}
462                 if (xprime < 0) {sum2 += 0.5 * fParameters[6]*TMath::Exp(xprime*fParameters[6]) * (ResolutionFunc(xprime-x));}
463
464                 xprime = xupp - (i-.5) * step;
465                 if (xprime > 0) {sum1 += 0.5 * fParameters[6]*TMath::Exp(-1*xprime*fParameters[6]) * (ResolutionFunc(xprime-x));} 
466                 if (xprime < 0) {sum2 += 0.5 * fParameters[6]*TMath::Exp(xprime*fParameters[6]) * (ResolutionFunc(xprime-x));}
467         }
468
469         return step*(sum1 + sum2) ;
470 }
471 //_________________________________________________________________________________________________
472 Double_t AliDielectronBtoJPSItoEleCDFfitFCN::ResolutionFunc(Double_t x) const 
473 {
474         //
475         // parametrization with 2 gaus
476         //
477         Double_t ret = 0.;
478         Double_t mean1 = fResolutionConstants[0]; 
479         Double_t mean2 = fResolutionConstants[2];
480         Double_t norm1 = fParameters[18];
481         Double_t sigma1 = fResolutionConstants[1];
482         Double_t sigma2 = fResolutionConstants[3]; 
483         Double_t norm2 = fParameters[19];
484
485         ret = (norm1/(norm1+norm2))*((1/(sigma1*TMath::Sqrt(2*TMath::Pi())))*TMath::Exp(-0.5*((x-mean1)/sigma1)*((x-mean1)/sigma1)))+(norm2/(norm1+norm2))*((1/(sigma2*TMath::Sqrt(2*TMath::Pi())))*TMath::Exp(-0.5*((x-mean2)/sigma2)*((x-mean2)/sigma2))); 
486
487         return ret;
488 }
489
490 //_________________________________________________________________________________________________
491 TF1* AliDielectronBtoJPSItoEleCDFfitFCN::GetCsiMC(Double_t xmin, Double_t xmax) 
492 {
493         // return the pointer to the templateMC function 
494         TF1* templateMC = new TF1("MCtemplate",this,&AliDielectronBtoJPSItoEleCDFfitFCN::CsiMCfunc,xmin,xmax,0);
495         templateMC->SetNpx(5000);
496         return (TF1*)templateMC->Clone();
497 }
498
499 //__________________________________________________________________________________________________
500 TF1* AliDielectronBtoJPSItoEleCDFfitFCN::GetResolutionFunc(Double_t xmin, Double_t xmax){
501         // return the pointer to the resolution function
502         TF1* resFunc = new TF1("resolutionFunc",this,&AliDielectronBtoJPSItoEleCDFfitFCN::ResolutionFuncf,xmin,xmax,0);
503         resFunc->SetNpx(5000);
504         return (TF1*)resFunc->Clone();
505 }
506
507 //___________________________________________________________________________________________________
508 TF1* AliDielectronBtoJPSItoEleCDFfitFCN::GetEvaluateCDFDecayTimeBkgDistr(Double_t xmin, Double_t xmax){
509         // return the pointer to the background x distribution function
510         TF1 *backFunc = new TF1("backFunc",this,&AliDielectronBtoJPSItoEleCDFfitFCN::EvaluateCDFDecayTimeBkgDistrFunc,xmin,xmax,0);
511         backFunc->SetNpx(5000);
512         return (TF1*)backFunc->Clone();
513 }
514
515 //__________________________________________________________________________________________________
516 TF1* AliDielectronBtoJPSItoEleCDFfitFCN::GetEvaluateCDFDecayTimeSigDistr(Double_t xmin, Double_t xmax){
517         // return the pointer to the signal x distribution function
518         TF1 *signFunc = new TF1("signalFunc",this,&AliDielectronBtoJPSItoEleCDFfitFCN::EvaluateCDFDecayTimeSigDistrFunc,xmin,xmax,0);
519         signFunc->SetNpx(5000);
520         return (TF1*)signFunc->Clone();
521 }