CLHEP 2.0.4.7 Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // -*- C++ -*- 00002 // $Id: AnalyticConvolution.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $ 00003 // ---------------------------------------------------------------------------// 00004 // This function-object makes analytic convolutions of a gaussian plus either // 00005 // an exponential, or else the function exp * (1+/-cos) // 00006 // The choice depends on which constructor is used to build the analytic // 00007 // convolution and which arguments are used. // 00008 // // 00009 // Joe Boudreau, Petar Maksimovic, Hongquan Niu, Craig Blocker // 00010 // // 00011 // ---------------------------------------------------------------------------// 00012 #ifndef _AnalyticConvolution_h_ 00013 #define _AnalyticConvolution_h_ 00014 #include "CLHEP/GenericFunctions/AbsFunction.hh" 00015 #include "CLHEP/GenericFunctions/Parameter.hh" 00016 #include <complex> 00017 namespace Genfun { 00018 00019 class Gaussian; 00020 class Exponential; 00021 class Cosine; 00022 00027 class AnalyticConvolution: public AbsFunction { 00028 00029 FUNCTION_OBJECT_DEF(AnalyticConvolution) 00030 00031 public: 00032 00033 // Flag for mixed or unmixed: 00034 enum Type {MIXED =0, // PDF for mixed events 00035 UNMIXED =1, // PDF for unmixed events 00036 SMEARED_EXP =2, // Exponential (convolve) Gaussian 00037 SMEARED_COS_EXP=3, // Exponential * Cosine (convolve) Gaussian 00038 SMEARED_SIN_EXP=4, // Exponential * Sine (convolve) Gaussian 00039 SMEARED_NEG_EXP=5}; // Negative exponential (convolve) Gaussian 00040 // Constructor 00041 AnalyticConvolution(Type=SMEARED_EXP); 00042 00043 // Copy constructor 00044 AnalyticConvolution(const AnalyticConvolution &right); 00045 00046 // Destructor: 00047 virtual ~AnalyticConvolution(); 00048 00049 // Retreive function value 00050 virtual double operator ()(double argument) const; 00051 virtual double operator ()(const Argument & a) const {return operator() (a[0]);} 00052 00053 // Frequency of oscillation 00054 Parameter & frequency(); 00055 const Parameter & frequency() const; 00056 00057 // Lifetime of exponential: 00058 Parameter & lifetime(); 00059 const Parameter & lifetime() const; 00060 00061 // Width of the gaussian: 00062 Parameter & sigma(); 00063 const Parameter & sigma() const; 00064 00065 // The mean of the gaussian: 00066 Parameter & offset(); 00067 const Parameter & offset() const; 00068 00069 private: 00070 00071 // These are for calculating mixing terms. 00072 double pow(double x, int n) const ; 00073 double erfc(double x) const ; 00074 std::complex<double> nwwerf(std::complex<double> z) const; 00075 00076 // It is illegal to assign an adjustable constant 00077 const AnalyticConvolution & operator=(const AnalyticConvolution &right); 00078 00079 Parameter _lifetime; 00080 Parameter _frequency; 00081 Parameter _sigma; 00082 Parameter _offset; 00083 Type _type; 00084 00085 }; 00086 } // namespace Genfun 00087 #endif