BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtAmpPdf.hh
Go to the documentation of this file.
1/*******************************************************************************
2 * Project: BaBar detector at the SLAC PEP-II B-factory
3 * Package: EvtGenBase
4 * File: $Id: EvtAmpPdf.hh,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $
5 * Author: Alexei Dvoretskii, [email protected], 2001-2002
6 *
7 * Copyright (C) 2002 Caltech
8 *******************************************************************************/
9
10#ifndef EVT_AMP_PDF_HH
11#define EVT_AMP_PDF_HH
12
13#include "EvtGenBase/EvtMacros.hh"
14#include "EvtGenBase/EvtAmplitude.hh"
15#include "EvtGenBase/EvtPdf.hh"
16
17template <class T>
18
19class EvtAmpPdf : public EvtPdf<T> {
20public:
21
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; }
26
27 virtual EvtAmpPdf<T>* clone() const { return new EvtAmpPdf(*this); }
28
29 virtual double pdf(const T& p) const
30 {
31 EvtComplex amp = _amp->evaluate(p);
32 return real(amp)*real(amp) + imag(amp)*imag(amp);
33 }
34
35private:
36
37 EvtAmplitude<T>* _amp;
38};
39
40#endif
41
double imag(const EvtComplex &c)