BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtAmpAmpPdf.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: EvtAmpAmpPdf.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_AMP_PDF_HH
11#define EVT_AMP_AMP_PDF_HH
12
13// From the product A1A2* four PDF terms can be constructed, by taking the positive
14// and the negative parts or the real and imaginary part of the product.
15
16#include <assert.h>
17#include "EvtGenBase/EvtMacros.hh"
18#include "EvtGenBase/EvtAmplitude.hh"
19#include "EvtGenBase/EvtPdf.hh"
20
22
23template <class T>
24class EvtAmpAmpPdf : public EvtPdf<T> {
25public:
26
28 EvtAmpAmpPdf(int type, const EvtAmplitude<T>& amp1, const EvtAmplitude<T>& amp2)
29 : EvtPdf<T>(), _type(type), _amp1(amp1.clone()), _amp2(amp2.clone())
30 {}
32 : EvtPdf<T>(other), _type(other._type), COPY_PTR(_amp1), COPY_PTR(_amp2)
33 {}
34 virtual ~EvtAmpAmpPdf()
35 {
36 delete _amp1;
37 delete _amp2;
38 }
39
40 virtual EvtAmpAmpPdf<T>* clone() const { return new EvtAmpAmpPdf(*this); }
41
42 virtual double pdf(const T& p) const
43 {
44 EvtComplex amp1 = _amp1->evaluate(p);
45 EvtComplex amp2 = _amp2->evaluate(p);
46 EvtComplex pr = amp1 * conj(amp2);
47
48 if(_type == POSRE) return real(pr) > 0 ? real(pr) : 0.;
49 if(_type == NEGRE) return real(pr) < 0 ? -real(pr) : 0.;
50 if(_type == POSIM) return imag(pr) > 0 ? imag(pr) : 0.;
51 if(_type == NEGIM) return imag(pr) < 0 ? -imag(pr) : 0.;
52
53 assert(0);
54 }
55
56private:
57
58 int _type;
59 EvtAmplitude<T>* _amp1;
60 EvtAmplitude<T>* _amp2;
61};
62
63#endif
64
Evt3Rank3C conj(const Evt3Rank3C &t2)
double imag(const EvtComplex &c)
EvtAmpAmpPdf(int type, const EvtAmplitude< T > &amp1, const EvtAmplitude< T > &amp2)