/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenBase/EvtAmpPdf.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: EvtAmpPdf.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_PDF_HH
00011 #define EVT_AMP_PDF_HH
00012 
00013 #include "EvtGenBase/EvtMacros.hh"
00014 #include "EvtGenBase/EvtAmplitude.hh"
00015 #include "EvtGenBase/EvtPdf.hh"
00016 
00017 template <class T>
00018 
00019 class EvtAmpPdf : public EvtPdf<T> {  
00020 public:
00021 
00022   EvtAmpPdf() {}
00023   EvtAmpPdf(const EvtAmplitude<T>& amp) : EvtPdf<T>(), _amp(amp.clone()) {}
00024   EvtAmpPdf(const EvtAmpPdf<T>& other) : EvtPdf<T>(other), COPY_PTR(_amp) {}
00025   virtual ~EvtAmpPdf() { delete _amp; }
00026   
00027   virtual EvtAmpPdf<T>* clone() const { return new EvtAmpPdf(*this); }
00028   
00029   virtual double pdf(const T& p) const
00030   {
00031     EvtComplex amp = _amp->evaluate(p);
00032     return real(amp)*real(amp) + imag(amp)*imag(amp);
00033   }
00034   
00035 private:
00036   
00037   EvtAmplitude<T>* _amp;
00038 };
00039 
00040 #endif
00041 

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