BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
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, dvoretsk@slac.stanford.edu, 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 "EvtAmplitude.hh"
17#include "EvtMacros.hh"
18#include "EvtPdf.hh"
19#include <assert.h>
20
21enum { POSRE = 0, NEGRE, POSIM, NEGIM };
22
23template <class T> class EvtAmpAmpPdf : public EvtPdf<T> {
24public:
26 EvtAmpAmpPdf( int type, const EvtAmplitude<T>& amp1, const EvtAmplitude<T>& amp2 )
27 : EvtPdf<T>(), _type( type ), _amp1( amp1.clone() ), _amp2( amp2.clone() ) {}
29 : EvtPdf<T>( other ), _type( other._type ), COPY_PTR( _amp1 ), COPY_PTR( _amp2 ) {}
30 virtual ~EvtAmpAmpPdf() {
31 delete _amp1;
32 delete _amp2;
33 }
34
35 virtual EvtAmpAmpPdf<T>* clone() const { return new EvtAmpAmpPdf( *this ); }
36
37 virtual double pdf( const T& p ) const {
38 EvtComplex amp1 = _amp1->evaluate( p );
39 EvtComplex amp2 = _amp2->evaluate( p );
40 EvtComplex pr = amp1 * conj( amp2 );
41
42 if ( _type == POSRE ) return real( pr ) > 0 ? real( pr ) : 0.;
43 if ( _type == NEGRE ) return real( pr ) < 0 ? -real( pr ) : 0.;
44 if ( _type == POSIM ) return imag( pr ) > 0 ? imag( pr ) : 0.;
45 if ( _type == NEGIM ) return imag( pr ) < 0 ? -imag( pr ) : 0.;
46
47 assert( 0 );
48 }
49
50private:
51 int _type;
52 EvtAmplitude<T>* _amp1;
53 EvtAmplitude<T>* _amp2;
54};
55
56#endif
Evt3Rank3C conj(const Evt3Rank3C &t2)
@ NEGRE
@ POSIM
@ POSRE
@ NEGIM
double imag(const EvtComplex &c)
#define COPY_PTR(X)
Definition EvtMacros.hh:15
virtual ~EvtAmpAmpPdf()
EvtAmpAmpPdf(int type, const EvtAmplitude< T > &amp1, const EvtAmplitude< T > &amp2)
virtual EvtAmpAmpPdf< T > * clone() const
virtual double pdf(const T &p) const
EvtAmpAmpPdf(const EvtAmpAmpPdf< T > &other)
EvtPdf()
Definition EvtPdf.hh:59