/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenBase/EvtAmpAmpPdf.hh

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Project: BaBar detector at the SLAC PEP-II B-factory
00003  * Package: EvtGenBase
00004  *    File: $Id: EvtAmpAmpPdf.hh,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $
00005  *  Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
00006  *
00007  * Copyright (C) 2002 Caltech
00008  *******************************************************************************/
00009 
00010 #ifndef EVT_AMP_AMP_PDF_HH
00011 #define EVT_AMP_AMP_PDF_HH
00012 
00013 // From the product A1A2* four PDF terms can be constructed, by taking the positive
00014 // and the negative parts or the real and imaginary part of the product.
00015 
00016 #include <assert.h>
00017 #include "EvtGenBase/EvtMacros.hh"
00018 #include "EvtGenBase/EvtAmplitude.hh"
00019 #include "EvtGenBase/EvtPdf.hh"
00020 
00021 enum {POSRE=0,NEGRE,POSIM,NEGIM};
00022 
00023 template <class T>
00024 class EvtAmpAmpPdf : public EvtPdf<T> {  
00025 public:
00026 
00027   EvtAmpAmpPdf() {}
00028   EvtAmpAmpPdf(int type, const EvtAmplitude<T>& amp1, const EvtAmplitude<T>& amp2) 
00029     : EvtPdf<T>(), _type(type), _amp1(amp1.clone()), _amp2(amp2.clone()) 
00030   {}
00031   EvtAmpAmpPdf(const EvtAmpAmpPdf<T>& other) 
00032     : EvtPdf<T>(other), _type(other._type), COPY_PTR(_amp1), COPY_PTR(_amp2) 
00033   {}
00034   virtual ~EvtAmpAmpPdf() 
00035   { 
00036     delete _amp1; 
00037     delete _amp2; 
00038   }
00039     
00040   virtual EvtAmpAmpPdf<T>* clone() const { return new EvtAmpAmpPdf(*this); }
00041 
00042   virtual double pdf(const T& p) const
00043   {
00044     EvtComplex amp1 = _amp1->evaluate(p);
00045     EvtComplex amp2 = _amp2->evaluate(p);
00046     EvtComplex pr = amp1 * conj(amp2);
00047 
00048     if(_type == POSRE) return real(pr) > 0 ? real(pr) : 0.;
00049     if(_type == NEGRE) return real(pr) < 0 ? -real(pr) : 0.;
00050     if(_type == POSIM) return imag(pr) > 0 ? imag(pr) : 0.;
00051     if(_type == NEGIM) return imag(pr) < 0 ? -imag(pr) : 0.;
00052     
00053     assert(0);
00054   }
00055   
00056 private:
00057   
00058   int _type;
00059   EvtAmplitude<T>* _amp1;
00060   EvtAmplitude<T>* _amp2;
00061 };
00062 
00063 #endif
00064 

Generated on Tue Nov 29 23:12:12 2016 for BOSS_7.0.2 by  doxygen 1.4.7