LCOV - code coverage report
Current view: top level - TEvtGen/EvtGen/EvtGenBase - EvtAmpPdf.hh (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 7 0.0 %
Date: 2016-06-14 17:26:59 Functions: 0 18 0.0 %

          Line data    Source code
       1             : /*******************************************************************************
       2             :  * Project: BaBar detector at the SLAC PEP-II B-factory
       3             :  * Package: EvtGenBase
       4             :  *    File: $Id: EvtAmpPdf.hh,v 1.2 2009-03-16 16:43:40 robbep 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 "EvtGenBase/EvtMacros.hh"
      14             : #include "EvtGenBase/EvtAmplitude.hh"
      15             : #include "EvtGenBase/EvtPdf.hh"
      16             : 
      17             : template <class T>
      18             : 
      19             : class EvtAmpPdf : public EvtPdf<T> {  
      20             : public:
      21             : 
      22             :   EvtAmpPdf() {}
      23           0 :   EvtAmpPdf(const EvtAmplitude<T>& amp) : EvtPdf<T>(), _amp(amp.clone()) {}
      24           0 :   EvtAmpPdf(const EvtAmpPdf<T>& other) : EvtPdf<T>(other), COPY_PTR(_amp) {}
      25           0 :   virtual ~EvtAmpPdf() { delete _amp; }
      26             :   
      27           0 :   virtual EvtAmpPdf<T>* clone() const { return new EvtAmpPdf(*this); }
      28             :   
      29             :   virtual double pdf(const T& p) const
      30             :   {
      31           0 :     EvtComplex amp = _amp->evaluate(p);
      32           0 :     return real(amp)*real(amp) + imag(amp)*imag(amp);
      33           0 :   }
      34             :   
      35             : private:
      36             :   
      37             :   EvtAmplitude<T>* _amp;
      38             : };
      39             : 
      40             : #endif
      41             : 

Generated by: LCOV version 1.11