1 #include "EvtGenBase/EvtPatches.hh"
2 /*******************************************************************************
3 * Project: BaBar detector at the SLAC PEP-II B-factory
5 * File: $Id: EvtBreitWignerPdf.cc,v 1.14 2004/12/21 19:58:41 ryd Exp $
6 * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
8 * Copyright (C) 2002 Caltech
9 *******************************************************************************/
11 // Breit-Wigner shape PDF. If the width is zero it degenerates into a delta
12 // function. The integral and its inverse can be still evaluated.
17 #include "EvtGenBase/EvtPatches.hh"
18 #include "EvtGenBase/EvtBreitWignerPdf.hh"
19 #include "EvtGenBase/EvtConst.hh"
21 EvtBreitWignerPdf::EvtBreitWignerPdf(double min, double max, double m0, double g0)
22 : EvtIntegPdf1D(min,max), _m0(m0), _g0(g0)
26 EvtBreitWignerPdf::EvtBreitWignerPdf(const EvtBreitWignerPdf& other)
27 : EvtIntegPdf1D(other), _m0(other._m0), _g0(other._g0)
31 EvtBreitWignerPdf::~EvtBreitWignerPdf()
35 double EvtBreitWignerPdf::pdf(const EvtPoint1D& x) const
38 if((0 == (m - _m0)) && (0. == _g0)) {
40 printf("Delta function Breit-Wigner\n");
44 double ret = _g0/EvtConst::twoPi/((m-_m0)*(m-_m0)+_g0*_g0/4);
50 double EvtBreitWignerPdf::pdfIntegral(double m) const
61 else itg = atan((m-_m0)/(_g0/2.))/EvtConst::pi + 0.5;
67 double EvtBreitWignerPdf::pdfIntegralInverse(double x) const
71 printf("Invalid integral value %f\n",x);
76 if(_g0 != 0) m = _m0 + (_g0/2.)*tan(EvtConst::pi*(x-0.5));