ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Evaluator.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Evaluator.h
1
// -*- C++ -*-
2
// ---------------------------------------------------------------------------
3
4
#ifndef HEP_EVALUATOR_H
5
#define HEP_EVALUATOR_H
6
7
#include <string>
8
9
namespace
HepTool {
10
25
class
Evaluator
{
26
public
:
27
38
enum
{
39
OK
,
40
WARNING_EXISTING_VARIABLE
,
41
WARNING_EXISTING_FUNCTION
,
42
WARNING_BLANK_STRING
,
43
ERROR_NOT_A_NAME
,
44
ERROR_SYNTAX_ERROR
,
45
ERROR_UNPAIRED_PARENTHESIS
,
46
ERROR_UNEXPECTED_SYMBOL
,
47
ERROR_UNKNOWN_VARIABLE
,
48
ERROR_UNKNOWN_FUNCTION
,
49
ERROR_EMPTY_PARAMETER
,
50
ERROR_CALCULATION_ERROR
51
};
52
56
Evaluator
();
57
61
~Evaluator
();
62
75
double
evaluate
(
const
char
* expression);
76
80
int
status
()
const
;
81
85
int
error_position
()
const
;
86
90
void
print_error
()
const
;
94
std::string
error_name
()
const
;
95
104
void
setVariable
(
const
char
*
name
,
double
value
);
105
115
void
setVariable
(
const
char
*
name
,
const
char
* expression);
116
125
void
setFunction
(
const
char
*
name
,
double
(*fun)());
126
135
void
setFunction
(
const
char
* name,
double
(*fun)(
double
));
136
145
void
setFunction
(
const
char
* name,
double
(*fun)(
double
,
double
));
146
155
void
setFunction
(
const
char
* name,
double
(*fun)(
double
,
double
,
double
));
156
165
void
setFunction
(
const
char
* name,
166
double
(*fun)(
double
,
double
,
double
,
double
));
167
176
void
setFunction
(
const
char
* name,
177
double
(*fun)(
double
,
double
,
double
,
double
,
double
));
178
185
bool
findVariable
(
const
char
* name)
const
;
186
194
bool
findFunction
(
const
char
* name,
int
npar)
const
;
195
201
void
removeVariable
(
const
char
* name);
202
209
void
removeFunction
(
const
char
* name,
int
npar);
210
214
void
clear
();
215
219
void
setStdMath
();
220
247
void
setSystemOfUnits
(
double
meter
= 1.0,
248
double
kilogram
= 1.0,
249
double
second
= 1.0,
250
double
ampere
= 1.0,
251
double
kelvin
= 1.0,
252
double
mole
= 1.0,
253
double
candela
= 1.0);
254
255
private
:
256
void
*
p
;
// private data
257
Evaluator
(
const
Evaluator
&);
// copy constructor is not allowed
258
Evaluator
&
operator=
(
const
Evaluator
&);
// assignment is not allowed
259
};
260
261
}
// namespace HepTool
262
263
#endif
/* HEP_EVALUATOR_H */
geant4
tree
geant4-10.6-release
source
externals
clhep
include
CLHEP
Evaluator
Evaluator.h
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:14
using
1.8.2 with
ECCE GitHub integration