1 /*******************************************************************************
2 * Project: BaBar detector at the SLAC PEP-II B-factory
4 * File: $Id: EvtAmpPdf.hh,v 1.5 2003/06/20 17:19:59 dvoretsk Exp $
5 * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
7 * Copyright (C) 2002 Caltech
8 *******************************************************************************/
10 #ifndef EVT_AMP_PDF_HH
11 #define EVT_AMP_PDF_HH
13 #include "EvtGenBase/EvtMacros.hh"
14 #include "EvtGenBase/EvtAmplitude.hh"
15 #include "EvtGenBase/EvtPdf.hh"
19 class EvtAmpPdf : public EvtPdf<T> {
23 EvtAmpPdf(const EvtAmplitude<T>& amp) : EvtPdf<T>(), _amp(amp.clone()) {}
24 EvtAmpPdf(const EvtAmpPdf<T>& other) : EvtPdf<T>(other), COPY_PTR(_amp) {}
25 virtual ~EvtAmpPdf() { delete _amp; }
27 virtual EvtAmpPdf<T>* clone() const { return new EvtAmpPdf(*this); }
29 virtual double pdf(const T& p) const
31 EvtComplex amp = _amp->evaluate(p);
32 return real(amp)*real(amp) + imag(amp)*imag(amp);
37 EvtAmplitude<T>* _amp;