EvtBreitWignerPdf Class Reference

#include <EvtBreitWignerPdf.hh>

Inheritance diagram for EvtBreitWignerPdf:

EvtIntegPdf1D EvtPdf< EvtPoint1D > List of all members.

Public Member Functions

 EvtBreitWignerPdf (double min, double max, double m0, double g0)
 EvtBreitWignerPdf (const EvtBreitWignerPdf &other)
virtual ~EvtBreitWignerPdf ()
double pdf (const EvtPoint1D &x) const
EvtPdf< EvtPoint1D > * clone () const
double pdfIntegral (double m) const
double pdfIntegralInverse (double x) const
double m0 () const
double g0 () const
virtual EvtValError compute_integral () const
virtual EvtValError compute_integral (int N) const
virtual EvtPoint1D randomPoint ()
double evaluate (const EvtPoint1D &p) const
EvtPdfMax< EvtPoint1DfindMax (const EvtPdf< EvtPoint1D > &pc, int N)
EvtValError findGenEff (const EvtPdf< EvtPoint1D > &pc, int N, int nFindMax)
void setItg (EvtValError itg)
EvtValError getItg () const
EvtValError getItg (int N) const
EvtValError compute_mc_integral (const EvtPdf< EvtPoint1D > &pc, int N)
EvtPredGen< EvtPdfGen< EvtPoint1D >,
EvtPdfPred< EvtPoint1D > > 
accRejGen (const EvtPdf< EvtPoint1D > &pc, int nMax, double factor=1.)

Protected Attributes

double _min
double _max
EvtValError _itg

Private Attributes

double _m0
double _g0

Detailed Description

Definition at line 17 of file EvtBreitWignerPdf.hh.


Constructor & Destructor Documentation

EvtBreitWignerPdf::EvtBreitWignerPdf ( double  min,
double  max,
double  m0,
double  g0 
)

Definition at line 21 of file EvtBreitWignerPdf.cc.

Referenced by clone().

00022   : EvtIntegPdf1D(min,max), _m0(m0), _g0(g0)
00023 {}

EvtBreitWignerPdf::EvtBreitWignerPdf ( const EvtBreitWignerPdf other  ) 

Definition at line 26 of file EvtBreitWignerPdf.cc.

00027   : EvtIntegPdf1D(other), _m0(other._m0), _g0(other._g0)
00028 {}

EvtBreitWignerPdf::~EvtBreitWignerPdf (  )  [virtual]

Definition at line 31 of file EvtBreitWignerPdf.cc.

00032 {}


Member Function Documentation

EvtPredGen<EvtPdfGen<EvtPoint1D >,EvtPdfPred<EvtPoint1D > > EvtPdf< EvtPoint1D >::accRejGen ( const EvtPdf< EvtPoint1D > &  pc,
int  nMax,
double  factor = 1. 
) [inherited]

EvtPdf<EvtPoint1D>* EvtBreitWignerPdf::clone (  )  const [inline, virtual]

Implements EvtPdf< EvtPoint1D >.

Definition at line 26 of file EvtBreitWignerPdf.hh.

References EvtBreitWignerPdf().

00027   {
00028     return new EvtBreitWignerPdf(*this);
00029   }

virtual EvtValError EvtPdf< EvtPoint1D >::compute_integral ( int  N  )  const [inline, virtual, inherited]

Definition at line 95 of file EvtPdf.hh.

References EvtPdf< T >::compute_integral().

00095 { return compute_integral(); }

EvtValError EvtIntegPdf1D::compute_integral (  )  const [virtual, inherited]

Reimplemented from EvtPdf< EvtPoint1D >.

Definition at line 29 of file EvtIntegPdf1D.cc.

References EvtIntegPdf1D::_max, EvtIntegPdf1D::_min, and EvtIntegPdf1D::pdfIntegral().

00030 {
00031   double x1 = pdfIntegral(_min); 
00032   double x2 = pdfIntegral(_max);
00033   return EvtValError(x2-x1,0.);
00034 }

EvtValError EvtPdf< EvtPoint1D >::compute_mc_integral ( const EvtPdf< EvtPoint1D > &  pc,
int  N 
) [inherited]

double EvtPdf< EvtPoint1D >::evaluate ( const EvtPoint1D p  )  const [inline, inherited]

Definition at line 65 of file EvtPdf.hh.

References EvtPdf< T >::pdf().

00065                                     { 
00066     if(p.isValid()) return pdf(p); 
00067     else return 0.;
00068   }

EvtValError EvtPdf< EvtPoint1D >::findGenEff ( const EvtPdf< EvtPoint1D > &  pc,
int  N,
int  nFindMax 
) [inherited]

EvtPdfMax<EvtPoint1D > EvtPdf< EvtPoint1D >::findMax ( const EvtPdf< EvtPoint1D > &  pc,
int  N 
) [inherited]

double EvtBreitWignerPdf::g0 (  )  const [inline]

Definition at line 37 of file EvtBreitWignerPdf.hh.

References _g0.

00037 { return _g0; }

EvtValError EvtPdf< EvtPoint1D >::getItg ( int  N  )  const [inline, inherited]

Definition at line 87 of file EvtPdf.hh.

References EvtPdf< T >::_itg, EvtPdf< T >::compute_integral(), and EvtValError::valueKnown().

00087                                   {
00088     if(!_itg.valueKnown()) _itg = compute_integral(N);
00089     return _itg;
00090   }

EvtValError EvtPdf< EvtPoint1D >::getItg (  )  const [inline, inherited]

Definition at line 83 of file EvtPdf.hh.

References EvtPdf< T >::_itg, EvtPdf< T >::compute_integral(), and EvtValError::valueKnown().

00083                              {
00084     if(!_itg.valueKnown()) _itg = compute_integral();
00085     return _itg;
00086   }

double EvtBreitWignerPdf::m0 (  )  const [inline]

Definition at line 36 of file EvtBreitWignerPdf.hh.

References _m0.

00036 { return _m0; }

double EvtBreitWignerPdf::pdf ( const EvtPoint1D x  )  const [virtual]

Implements EvtPdf< EvtPoint1D >.

Definition at line 35 of file EvtBreitWignerPdf.cc.

References _g0, _m0, EvtConst::twoPi, and x.

00036 {
00037   double m = x.value();
00038   if((0 == (m - _m0)) && (0. == _g0)) {
00039 
00040     printf("Delta function Breit-Wigner\n");
00041     assert(0);
00042   }
00043   
00044   double ret = _g0/EvtConst::twoPi/((m-_m0)*(m-_m0)+_g0*_g0/4);
00045   
00046   return ret;
00047 }

double EvtBreitWignerPdf::pdfIntegral ( double  m  )  const [virtual]

Implements EvtIntegPdf1D.

Definition at line 50 of file EvtBreitWignerPdf.cc.

References _g0, _m0, and EvtConst::pi.

00051 {
00052   double itg = 0;
00053   if(_g0 == 0) {
00054 
00055     if(m > _m0) itg = 1.;
00056     else
00057       if(m < _m0) itg = 0.;
00058       else
00059         itg = 0.5;
00060   }
00061   else itg = atan((m-_m0)/(_g0/2.))/EvtConst::pi + 0.5; 
00062 
00063   return itg;
00064 }

double EvtBreitWignerPdf::pdfIntegralInverse ( double  x  )  const [virtual]

Implements EvtIntegPdf1D.

Definition at line 67 of file EvtBreitWignerPdf.cc.

References _g0, _m0, EvtConst::pi, and tan().

00068 {
00069   if(x < 0 || x > 1) {
00070     
00071     printf("Invalid integral value %f\n",x);
00072     assert(0);
00073   }
00074 
00075   double m = _m0;
00076   if(_g0 != 0) m = _m0 + (_g0/2.)*tan(EvtConst::pi*(x-0.5));
00077  
00078   return m;
00079 }

EvtPoint1D EvtIntegPdf1D::randomPoint (  )  [virtual, inherited]

Reimplemented from EvtPdf< EvtPoint1D >.

Definition at line 37 of file EvtIntegPdf1D.cc.

References EvtIntegPdf1D::_max, EvtIntegPdf1D::_min, EvtRandom::Flat(), EvtIntegPdf1D::pdfIntegral(), and EvtIntegPdf1D::pdfIntegralInverse().

00038 {
00039   double itgmin = pdfIntegral(_min);
00040   double itgmax = pdfIntegral(_max);
00041   double itgrnd = EvtRandom::Flat(itgmin,itgmax);
00042 
00043   return EvtPoint1D(_min,_max,pdfIntegralInverse(itgrnd));
00044 }

void EvtPdf< EvtPoint1D >::setItg ( EvtValError  itg  )  [inline, inherited]

Definition at line 81 of file EvtPdf.hh.

References EvtPdf< T >::_itg.

00081 {_itg = itg; }


Member Data Documentation

double EvtBreitWignerPdf::_g0 [private]

Definition at line 42 of file EvtBreitWignerPdf.hh.

Referenced by g0(), pdf(), pdfIntegral(), and pdfIntegralInverse().

EvtValError EvtPdf< EvtPoint1D >::_itg [mutable, protected, inherited]

Definition at line 111 of file EvtPdf.hh.

double EvtBreitWignerPdf::_m0 [private]

Definition at line 41 of file EvtBreitWignerPdf.hh.

Referenced by m0(), pdf(), pdfIntegral(), and pdfIntegralInverse().

double EvtIntegPdf1D::_max [protected, inherited]

Definition at line 37 of file EvtIntegPdf1D.hh.

Referenced by EvtIntegPdf1D::compute_integral(), and EvtIntegPdf1D::randomPoint().

double EvtIntegPdf1D::_min [protected, inherited]

Definition at line 36 of file EvtIntegPdf1D.hh.

Referenced by EvtIntegPdf1D::compute_integral(), and EvtIntegPdf1D::randomPoint().


Generated on Tue Nov 29 23:18:53 2016 for BOSS_7.0.2 by  doxygen 1.4.7