BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
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, dvoretsk@slac.stanford.edu, 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 "EvtAmplitude.hh"
14#include "EvtMacros.hh"
15#include "EvtPdf.hh"
16
17template <class T>
18
19class EvtAmpPdf : public EvtPdf<T> {
20public:
22 EvtAmpPdf( const EvtAmplitude<T>& amp ) : EvtPdf<T>(), _amp( amp.clone() ) {}
23 EvtAmpPdf( const EvtAmpPdf<T>& other ) : EvtPdf<T>( other ), COPY_PTR( _amp ) {}
24 virtual ~EvtAmpPdf() { delete _amp; }
25
26 virtual EvtAmpPdf<T>* clone() const { return new EvtAmpPdf( *this ); }
27
28 virtual double pdf( const T& p ) const {
29 EvtComplex amp = _amp->evaluate( p );
30 return real( amp ) * real( amp ) + imag( amp ) * imag( amp );
31 }
32
33private:
34 EvtAmplitude<T>* _amp;
35};
36
37#endif
double imag(const EvtComplex &c)
#define COPY_PTR(X)
Definition EvtMacros.hh:15
EvtAmpPdf(const EvtAmpPdf< T > &other)
Definition EvtAmpPdf.hh:23
virtual EvtAmpPdf< T > * clone() const
Definition EvtAmpPdf.hh:26
EvtAmpPdf(const EvtAmplitude< T > &amp)
Definition EvtAmpPdf.hh:22
virtual double pdf(const T &p) const
Definition EvtAmpPdf.hh:28
virtual ~EvtAmpPdf()
Definition EvtAmpPdf.hh:24
EvtPdf()
Definition EvtPdf.hh:59