00001 /******************************************************************************* 00002 * Project: BaBar detector at the SLAC PEP-II B-factory 00003 * Package: EvtGenBase 00004 * File: $Id: EvtAmplitude.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 // Complex-valued amplitude 00011 00012 #ifndef EVT_AMPLITUDE_HH 00013 #define EVT_AMPLITUDE_HH 00014 00015 #include "EvtGenBase/EvtComplex.hh" 00016 00017 template <class T> 00018 class EvtAmplitude { 00019 public: 00020 00021 EvtAmplitude() {} 00022 EvtAmplitude(const EvtAmplitude&) {} 00023 virtual ~EvtAmplitude() {} 00024 virtual EvtAmplitude<T>* clone() const = 0; 00025 00026 EvtComplex evaluate(const T& p) const 00027 { 00028 EvtComplex ret(0.,0.); 00029 if(p.isValid()) ret = amplitude(p); 00030 return ret; 00031 } 00032 00033 protected: 00034 00035 // Derive in subclasses to define amplitude computation 00036 // for a fully constructed amplitude object. 00037 00038 virtual EvtComplex amplitude(const T&) const = 0; 00039 00040 }; 00041 00042 #endif 00043 00044 00045 00046 00047