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>
17
namespace
Genfun
{
18
19
class
Gaussian;
20
class
Exponential;
21
class
Cosine;
22
23
/**
24
* @author
25
* @ingroup genfun
26
*/
27
class
AnalyticConvolution
:
public
AbsFunction
{
28
29
FUNCTION_OBJECT_DEF
(
AnalyticConvolution
)
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
41
AnalyticConvolution
(
Type
=
SMEARED_EXP
);
42
43
// Copy constructor
44
AnalyticConvolution
(
const
AnalyticConvolution
&right);
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
54
Parameter
&
frequency
();
55
const
Parameter
&
frequency
()
const
;
56
57
// Lifetime of exponential:
58
Parameter
&
lifetime
();
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
FUNCTION_OBJECT_DEF
#define FUNCTION_OBJECT_DEF(classname)
Definition:
AbsFunction.hh:143
Genfun::AbsFunction
Definition:
AbsFunction.hh:48
Genfun::AnalyticConvolution
Definition:
AnalyticConvolution.hh:27
Genfun::AnalyticConvolution::~AnalyticConvolution
virtual ~AnalyticConvolution()
Definition:
AnalyticConvolution.cc:35
Genfun::AnalyticConvolution::lifetime
Parameter & lifetime()
Definition:
AnalyticConvolution.cc:46
Genfun::AnalyticConvolution::frequency
Parameter & frequency()
Definition:
AnalyticConvolution.cc:38
Genfun::AnalyticConvolution::Type
Type
Definition:
AnalyticConvolution.hh:34
Genfun::AnalyticConvolution::UNMIXED
@ UNMIXED
Definition:
AnalyticConvolution.hh:35
Genfun::AnalyticConvolution::SMEARED_NEG_EXP
@ SMEARED_NEG_EXP
Definition:
AnalyticConvolution.hh:39
Genfun::AnalyticConvolution::SMEARED_EXP
@ SMEARED_EXP
Definition:
AnalyticConvolution.hh:36
Genfun::AnalyticConvolution::SMEARED_SIN_EXP
@ SMEARED_SIN_EXP
Definition:
AnalyticConvolution.hh:38
Genfun::AnalyticConvolution::MIXED
@ MIXED
Definition:
AnalyticConvolution.hh:34
Genfun::AnalyticConvolution::SMEARED_COS_EXP
@ SMEARED_COS_EXP
Definition:
AnalyticConvolution.hh:37
Genfun::AnalyticConvolution::offset
Parameter & offset()
Definition:
AnalyticConvolution.cc:62
Genfun::AnalyticConvolution::sigma
Parameter & sigma()
Definition:
AnalyticConvolution.cc:54
Genfun::AnalyticConvolution::operator()
virtual double operator()(double argument) const override
Definition:
AnalyticConvolution.cc:69
Genfun::Argument
Definition:
Argument.hh:17
Genfun::Parameter
Definition:
Parameter.hh:35
Genfun
Definition:
Abs.hh:14
CLHEP-CLHEP_2_4_6_4
GenericFunctions
GenericFunctions
AnalyticConvolution.hh
Generated by
1.9.6