CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
src
PeriodicRectangular.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id: PeriodicRectangular.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
3
#include "
CLHEP/GenericFunctions/PeriodicRectangular.hh
"
4
#include "
CLHEP/GenericFunctions/FixedConstant.hh
"
5
#include <assert.h>
6
#include <cmath>
// for floor()
7
8
namespace
Genfun {
9
FUNCTION_OBJECT_IMP
(PeriodicRectangular)
10
11
PeriodicRectangular
::
PeriodicRectangular
():
12
_a("Size-of-valley (
a
)", 1.0, 1.0, 10),
13
_b("Size-of-plateau (
b
)", 1.0, 1.0, 10),
14
_height("height",1, 0,10)
15
{}
16
17
PeriodicRectangular::PeriodicRectangular
(
const
PeriodicRectangular
& right):
18
AbsFunction
(right),
19
_a(right._a),
20
_b(right._b),
21
_height(right._height)
22
{
23
}
24
25
PeriodicRectangular::~PeriodicRectangular
() {
26
}
27
28
double
PeriodicRectangular::operator()
(
double
x)
const
{
29
double
xx = x/(_a.
getValue
()+_b.
getValue
());
30
xx = xx - floor(xx);
31
if
(xx < _a.
getValue
()/(_a.
getValue
()+_b.
getValue
())) {
32
return
0;
33
}
34
else
{
35
return
_height.
getValue
();
36
}
37
}
38
39
Parameter
&
PeriodicRectangular::a
() {
40
return
_a;
41
}
42
43
Parameter
&
PeriodicRectangular::b
() {
44
return
_b;
45
}
46
47
48
Parameter
&
PeriodicRectangular::height
() {
49
return
_height;
50
}
51
52
53
54
Derivative
PeriodicRectangular::partial
(
unsigned
int
index)
const
{
55
assert(index==0);
56
const
AbsFunction
& fPrime =
FixedConstant
(0);
57
return
Derivative
(&fPrime);
58
}
59
60
}
// namespace Genfun
FixedConstant.hh
Genfun::PeriodicRectangular::a
Parameter & a()
Definition:
PeriodicRectangular.cc:39
Genfun::PeriodicRectangular
Definition:
CLHEP/GenericFunctions/PeriodicRectangular.hh:19
Genfun::AbsFunction
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:48
Genfun::PeriodicRectangular::partial
Derivative partial(unsigned int) const
Definition:
PeriodicRectangular.cc:54
Genfun::PeriodicRectangular::b
Parameter & b()
Definition:
PeriodicRectangular.cc:43
Genfun::PeriodicRectangular::PeriodicRectangular
PeriodicRectangular()
Definition:
PeriodicRectangular.cc:11
PeriodicRectangular.hh
a
Definition:
testCategories.cc:125
Genfun::PeriodicRectangular::~PeriodicRectangular
virtual ~PeriodicRectangular()
Definition:
PeriodicRectangular.cc:25
Genfun::FixedConstant
Definition:
CLHEP/GenericFunctions/FixedConstant.hh:23
b
Definition:
testCategories.cc:125
Genfun::Derivative
FunctionNoop Derivative
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:40
FUNCTION_OBJECT_IMP
#define FUNCTION_OBJECT_IMP(classname)
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:156
Genfun::PeriodicRectangular::operator()
virtual double operator()(double argument) const
Definition:
PeriodicRectangular.cc:28
Genfun::FunctionNoop
Definition:
CLHEP/GenericFunctions/FunctionNoop.hh:19
Genfun::Parameter
Definition:
CLHEP/GenericFunctions/Parameter.hh:35
Genfun::PeriodicRectangular::height
Parameter & height()
Definition:
PeriodicRectangular.cc:48
Genfun::Parameter::getValue
virtual double getValue() const
Definition:
Parameter.cc:27
Generated on Sat Apr 26 2014 07:58:34 for CLHEP by
1.8.6