CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
AnalyticConvolution.hh
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: AnalyticConvolution.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
3// ---------------------------------------------------------------------------//
4// This function-object makes analytic convolutions of a gaussian plus either //
5// an exponential, or else the function exp * (1+/-cos) //
6// The choice depends on which constructor is used to build the analytic //
7// convolution and which arguments are used. //
8// //
9// Joe Boudreau, Petar Maksimovic, Hongquan Niu, Craig Blocker //
10// //
11// ---------------------------------------------------------------------------//
12#ifndef _AnalyticConvolution_h_
13#define _AnalyticConvolution_h_
14#include "CLHEP/GenericFunctions/AbsFunction.hh"
15#include "CLHEP/GenericFunctions/Parameter.hh"
16#include <complex>
17namespace Genfun {
18
19 class Gaussian;
20 class Exponential;
21 class Cosine;
22
23 /**
24 * @author
25 * @ingroup genfun
26 */
28
30
31 public:
32
33 // Flag for mixed or unmixed:
34 enum Type {MIXED =0, // PDF for mixed events
35 UNMIXED =1, // PDF for unmixed events
36 SMEARED_EXP =2, // Exponential (convolve) Gaussian
37 SMEARED_COS_EXP=3, // Exponential * Cosine (convolve) Gaussian
38 SMEARED_SIN_EXP=4, // Exponential * Sine (convolve) Gaussian
39 SMEARED_NEG_EXP=5}; // Negative exponential (convolve) Gaussian
40 // Constructor
42
43 // Copy constructor
45
46 // Destructor:
47 virtual ~AnalyticConvolution();
48
49 // Retreive function value
50 virtual double operator ()(double argument) const override;
51 virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
52
53 // Frequency of oscillation
55 const Parameter & frequency() const;
56
57 // Lifetime of exponential:
59 const Parameter & lifetime() const;
60
61 // Width of the gaussian:
62 Parameter & sigma();
63 const Parameter & sigma() const;
64
65 // The mean of the gaussian:
66 Parameter & offset();
67 const Parameter & offset() const;
68
69 private:
70
71 // These are for calculating mixing terms.
72 double pow(double x, int n) const ;
73 double erfc(double x) const ;
74 std::complex<double> nwwerf(std::complex<double> z) const;
75
76 // It is illegal to assign an adjustable constant
77 const AnalyticConvolution & operator=(const AnalyticConvolution &right);
78
79 Parameter _lifetime;
80 Parameter _frequency;
81 Parameter _sigma;
82 Parameter _offset;
83 Type _type;
84
85 };
86} // namespace Genfun
87#endif
#define FUNCTION_OBJECT_DEF(classname)
Definition: AbsFunction.hh:143
virtual double operator()(double argument) const override
Definition: Abs.hh:14