Line data Source code
1 : /*******************************************************************************
2 : * Project: BaBar detector at the SLAC PEP-II B-factory
3 : * Package: EvtGenBase
4 : * File: $Id: EvtAmplitude.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 : // Complex-valued amplitude
11 :
12 : #ifndef EVT_AMPLITUDE_HH
13 : #define EVT_AMPLITUDE_HH
14 :
15 : #include "EvtGenBase/EvtComplex.hh"
16 :
17 : template <class T>
18 : class EvtAmplitude {
19 : public:
20 :
21 0 : EvtAmplitude() {}
22 0 : EvtAmplitude(const EvtAmplitude&) {}
23 0 : virtual ~EvtAmplitude() {}
24 : virtual EvtAmplitude<T>* clone() const = 0;
25 :
26 : EvtComplex evaluate(const T& p) const
27 : {
28 0 : EvtComplex ret(0.,0.);
29 0 : if(p.isValid()) ret = amplitude(p);
30 0 : return ret;
31 : }
32 :
33 : protected:
34 :
35 : // Derive in subclasses to define amplitude computation
36 : // for a fully constructed amplitude object.
37 :
38 : virtual EvtComplex amplitude(const T&) const = 0;
39 :
40 : };
41 :
42 : #endif
43 :
44 :
45 :
46 :
47 :
|