CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
Fields
Fields
XF.h
Go to the documentation of this file.
1
//---------------XF::Function (transformation field)--------------------//
2
// //
3
// XF::Function, class of function objects which evaluate to a //
4
// evaluate to a HepTransform, and a class XF::Pow which can be //
5
// used to exponentiate any transform. The transformations fields //
6
// can be multiplied together or multiplied with a fixed global //
7
// transformation. These can be used to build arbitrary //
8
// HepTransform3D-valued-fields which are very compact. Chief //
9
// application so far is in geometry modelling where it is a //
10
// powerful technique for parameterization. //
11
// //
12
// Example: //
13
// //
14
// // Define some constants: //
15
// int N; //
16
// double c1, c2, r, z; //
17
// //
18
// // Construct a simple linear function of a variable i: //
19
// //
20
// Variable i; //
21
// //
22
// GENFUNCTION g = c1+c2*i; //
23
// //
24
// // Create a transfunction //
25
// //
26
// TRANSFUNCTION xf = Pow(HepRotateZ3D(1),g)* //
27
// HepTranslateX3D(r)* //
28
// HepTranslateZ3D(z); //
29
// //
30
// // Evaluation of TRANSFUNCTION //
31
// //
32
// HepTransform3D x = xf(33.2); //
33
// //
34
// //
35
// ... //
36
// Similar techniques may be used to create a transformation field of //
37
// more than one variable. //
38
// //
39
// //
40
//----------------------------------------------------------------------//
41
#ifndef TransformFunction_h
42
#define TransformFunction_h 1
43
#include "
CLHEP/GenericFunctions/AbsFunction.hh
"
44
#include "
CLHEP/GenericFunctions/Argument.hh
"
45
#include "
CLHEP/Geometry/Transform3D.h
"
46
47
//-----------------------------------------------------------------------//
48
// Exact return type of arithmentic operations. To the user, the return //
49
// type is TRANSFUNCTION, or const XF::Function &. //
50
//-----------------------------------------------------------------------//
51
52
namespace
XF
53
{
54
55
class
Product
;
56
class
PreMult
;
57
class
PostMult
;
58
class
Pow
;
59
60
61
class
Function
62
{
63
64
public
:
65
66
// Default Constructor
67
Function
();
68
69
// Destructor
70
virtual
~ Function
();
71
72
// Function value: N-dimensional functions must override these:
73
virtual
unsigned
int
dimensionality
()
const
;
//returns 1;
74
75
// Function value
76
virtual
HepGeom::Transform3D
operator ()
(
double
argument)
const
= 0;
77
virtual
HepGeom::Transform3D
operator ()
(
const
Genfun
::
78
Argument & argument)
const
=
79
0;
80
81
// Every function must override this:
82
virtual
Function
*
clone
()
const
= 0;
83
84
// Copy constructor
85
Function
(
const
Function
& right);
86
87
private
:
88
89
// Assignment operator
90
const
Function
& operator = (
const
Function
& right);
91
92
};
93
94
95
96
97
98
99
class
Pow
:
public
Function
100
{
101
102
public
:
103
104
Pow
(
const
HepGeom::Transform3D
&,
Genfun::GENFUNCTION
f
);
105
106
virtual
~ Pow
();
107
108
virtual
HepGeom::Transform3D
operator ()
(
double
argument)
const
;
109
virtual
HepGeom::Transform3D
operator ()
(
const
Genfun
::
110
Argument & argument)
const
;
111
112
// Every function must override this:
113
Pow
*
clone
()
const
;
114
115
// Copy constructor:
116
Pow
(
const
Pow
& right);
117
118
private
:
119
120
// Assignment operator
121
const
Pow
& operator = (
const
Pow
& right);
122
123
const
HepGeom::Transform3D
xf;
124
const
Genfun::AbsFunction
*
function
;
125
126
};
127
128
129
130
131
132
Product
operator *
(
const
Function
& op1,
const
Function
& op2);
133
PreMult
operator *
(
const
HepGeom::Transform3D
& xf,
const
Function
& op2);
134
PostMult
operator *
(
const
Function
& op2,
const
HepGeom::Transform3D
& xf);
135
136
137
// Internally used class:: Product:
138
139
class
Product
:
public
Function
140
{
141
142
public
:
143
144
145
Product
(
const
Function
* arg1,
const
Function
* arg2);
146
147
virtual
~ Product
();
148
149
virtual
unsigned
int
dimensionality
()
const
;
150
151
virtual
HepGeom::Transform3D
operator ()
(
double
argument)
const
;
152
virtual
HepGeom::Transform3D
operator ()
(
const
Genfun
::
153
Argument & argument)
const
;
154
155
// Every function must override this:
156
virtual
Product
*
clone
()
const
;
157
158
// Copy constructor:
159
Product
(
const
Product
& right);
160
161
private
:
162
163
const
Function
*_arg1;
164
const
Function
*_arg2;
165
166
};
167
168
// Internally used class:: PreMult :
169
170
class
PreMult
:
public
Function
171
{
172
173
public
:
174
175
176
PreMult
(
const
HepGeom::Transform3D
& arg1,
const
Function
* arg2);
177
178
virtual
~ PreMult
();
179
180
virtual
unsigned
int
dimensionality
()
const
;
181
182
virtual
HepGeom::Transform3D
operator ()
(
double
argument)
const
;
183
virtual
HepGeom::Transform3D
operator ()
(
const
Genfun
::
184
Argument & argument)
const
;
185
186
// Every function must override this:
187
virtual
PreMult
*
clone
()
const
;
188
189
// Copy constructor:
190
PreMult
(
const
PreMult
& right);
191
192
private
:
193
194
const
HepGeom::Transform3D
_arg1;
195
const
Function
*_arg2;
196
197
};
198
199
// Internally used class:: PostMult :
200
201
class
PostMult
:
public
Function
202
{
203
204
public
:
205
206
207
PostMult
(
const
Function
* arg1,
const
HepGeom::Transform3D
& arg2);
208
209
virtual
~ PostMult
();
210
211
virtual
unsigned
int
dimensionality
()
const
;
212
213
virtual
HepGeom::Transform3D
operator ()
(
double
argument)
const
;
214
virtual
HepGeom::Transform3D
operator ()
(
const
Genfun
::
215
Argument & argument)
const
;
216
217
// Every function must override this:
218
virtual
PostMult
*
clone
()
const
;
219
220
// Copy constructor:
221
PostMult
(
const
PostMult
& right);
222
223
private
:
224
225
const
Function
*_arg1;
226
const
HepGeom::Transform3D
_arg2;
227
228
};
229
230
typedef
const
Function
&
TRANSFUNCTION
;
231
232
233
234
}
235
236
#endif
XF
Definition:
XF.h:52
XF::Pow::clone
Pow * clone() const
Definition:
XF.cc:230
XF::Pow::operator()
virtual HepGeom::Transform3D operator()(double argument) const
Definition:
XF.cc:201
XF::Function::Function
Function()
Definition:
XF.cc:15
HepGeom::Transform3D
Definition:
CLHEP/Geometry/Transform3D.h:172
Genfun::AbsFunction
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:48
XF::PostMult::operator()
virtual HepGeom::Transform3D operator()(double argument) const
Definition:
XF.cc:180
XF::Pow::~Pow
virtual ~Pow()
Definition:
XF.cc:196
Transform3D.h
Argument.hh
XF::Product
Definition:
XF.h:139
XF::Function::dimensionality
virtual unsigned int dimensionality() const
Definition:
XF.cc:38
XF::Function::~Function
virtual ~Function()
Definition:
XF.cc:19
XF::Product::dimensionality
virtual unsigned int dimensionality() const
Definition:
XF.cc:80
XF::Product::~Product
virtual ~Product()
Definition:
XF.cc:74
XF::Function
Definition:
XF.h:61
XF::PreMult::operator()
virtual HepGeom::Transform3D operator()(double argument) const
Definition:
XF.cc:133
XF::PreMult
Definition:
XF.h:170
XF::Product::operator()
virtual HepGeom::Transform3D operator()(double argument) const
Definition:
XF.cc:85
XF::PostMult::dimensionality
virtual unsigned int dimensionality() const
Definition:
XF.cc:175
AbsFunction.hh
XF::PreMult::clone
virtual PreMult * clone() const
Definition:
XF.cc:111
XF::PreMult::~PreMult
virtual ~PreMult()
Definition:
XF.cc:123
XF::Function::clone
virtual Function * clone() const =0
XF::PostMult::clone
virtual PostMult * clone() const
Definition:
XF.cc:158
f
void f(void g())
Definition:
excDblThrow.cc:38
XF::Pow::Pow
Pow(const HepGeom::Transform3D &, Genfun::GENFUNCTION f)
Definition:
XF.cc:191
XF::Function::operator()
virtual HepGeom::Transform3D operator()(double argument) const =0
Genfun
Definition:
CLHEP/GenericFunctions/Abs.hh:14
XF::PostMult::~PostMult
virtual ~PostMult()
Definition:
XF.cc:170
XF::PreMult::PreMult
PreMult(const HepGeom::Transform3D &arg1, const Function *arg2)
Definition:
XF.cc:103
XF::Product::clone
virtual Product * clone() const
Definition:
XF.cc:62
XF::PostMult::PostMult
PostMult(const Function *arg1, const HepGeom::Transform3D &arg2)
Definition:
XF.cc:150
XF::Pow
Definition:
XF.h:99
XF::PreMult::dimensionality
virtual unsigned int dimensionality() const
Definition:
XF.cc:128
XF::Product::Product
Product(const Function *arg1, const Function *arg2)
Definition:
XF.cc:49
XF::PostMult
Definition:
XF.h:201
XF::operator*
Product operator*(const Function &op1, const Function &op2)
Definition:
XF.cc:23
XF::TRANSFUNCTION
const Function & TRANSFUNCTION
Definition:
XF.h:230
Generated by
1.8.9.1