File indexing completed on 2024-04-06 12:31:37
0001 #include "CruijffPdf.h"
0002 #include "RooRealVar.h"
0003 #include "RooRealConstant.h"
0004 using namespace RooFit;
0005
0006 ClassImp(CruijffPdf);
0007
0008 CruijffPdf::CruijffPdf(const char *name, const char *title,
0009 RooAbsReal& _m, RooAbsReal& _m0,
0010 RooAbsReal& _sigmaL, RooAbsReal& _sigmaR,
0011 RooAbsReal& _alphaL, RooAbsReal& _alphaR)
0012 :
0013 RooAbsPdf(name, title),
0014 m("m", "Dependent", this, _m),
0015 m0("m0", "M0", this, _m0),
0016 sigmaL("sigmaL", "SigmaL", this, _sigmaL),
0017 sigmaR("sigmaR", "SigmaR", this, _sigmaR),
0018 alphaL("alphaL", "AlphaL", this, _alphaL),
0019 alphaR("alphaR", "AlphaR", this, _alphaR)
0020 {
0021 }
0022
0023 CruijffPdf::CruijffPdf(const CruijffPdf& other, const char* name) :
0024 RooAbsPdf(other, name), m("m", this, other.m), m0("m0", this, other.m0),
0025 sigmaL("sigmaL", this, other.sigmaL), sigmaR("sigmaR", this, other.sigmaR),
0026 alphaL("alphaL", this, other.alphaL), alphaR("alphaR", this, other.alphaR)
0027 {
0028 }
0029
0030 Double_t CruijffPdf::evaluate() const
0031 {
0032 double dx = (m-m0) ;
0033 double sigma = dx<0 ? sigmaL: sigmaR ;
0034 double alpha = dx<0 ? alphaL: alphaR ;
0035 double f = 2*sigma*sigma + alpha*dx*dx ;
0036 return exp(-dx*dx/f) ;
0037 }