ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
AGDD
AGDDControl
AGDDControl
ExpressionEvaluator.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef EXPRESSION_EVALUATOR_H
6
#define EXPRESSION_EVALUATOR_H
7
8
#include "CLHEP/Evaluator/Evaluator.h"
9
10
#include <string>
11
#include <string_view>
12
#include <vector>
13
#include <map>
14
15
namespace
AGDD
{
16
17
typedef
std::map< std::string, double>
ConstantsTable
;
18
typedef
std::map< std::string, double>
PhysicalConstantsTable
;
19
typedef
std::map< std::string, std::string>
ExpressionsTable
;
20
21
class
ExpressionEvaluator
22
{
23
public
:
24
ExpressionEvaluator
();
25
~ExpressionEvaluator
();
26
27
bool
RegisterConstant
( std::string& c,
double
v );
28
bool
RegisterPhysConstant
( std::string&,
const
std::string&,
const
std::string& );
29
bool
RegisterExpression
( std::string& c,
const
std::string& v );
30
bool
RegisterArray
( std::string& c,
const
std::vector<double>& v );
31
bool
RegisterVariable
(
const
std::string& var_name,
double
value);
32
33
double
EvaluateString
(
const
std::string&
str
);
34
bool
is_delimiter
(
char
c);
35
bool
is_real_variable
(
const
std::string& var_name);
36
double
Eval
( std::string_view expr );
37
38
static
std::string
trim
(
const
std::string&);
39
static
std::vector<std::string>
tokenize
(
const
std::string&,
const
std::string&);
40
41
void
setFileCurrentlyParsed
(
const
std::string&
set
)
42
{
43
m_fileCurrentlyParsed
=
set
;
44
}
45
46
private
:
47
HepTool::Evaluator
m_calc
;
48
ConstantsTable
m_CTable
;
49
PhysicalConstantsTable
m_PCTable
;
50
std::string
m_fileCurrentlyParsed
;
51
std::vector<std::string>
m_real_vars
;
52
};
53
54
}
// namespace AGDD
55
56
#endif
// EXPRESSION_EVALUATOR_H
57
AGDD::ExpressionEvaluator::EvaluateString
double EvaluateString(const std::string &str)
Definition
ExpressionEvaluator.cxx:95
AGDD::ExpressionEvaluator::m_fileCurrentlyParsed
std::string m_fileCurrentlyParsed
Definition
ExpressionEvaluator.h:50
AGDD::ExpressionEvaluator::~ExpressionEvaluator
~ExpressionEvaluator()
Definition
ExpressionEvaluator.cxx:26
AGDD::ExpressionEvaluator::m_real_vars
std::vector< std::string > m_real_vars
Definition
ExpressionEvaluator.h:51
AGDD::ExpressionEvaluator::m_PCTable
PhysicalConstantsTable m_PCTable
Definition
ExpressionEvaluator.h:49
AGDD::ExpressionEvaluator::tokenize
static std::vector< std::string > tokenize(const std::string &, const std::string &)
Definition
ExpressionEvaluator.cxx:293
AGDD::ExpressionEvaluator::is_real_variable
bool is_real_variable(const std::string &var_name)
Definition
ExpressionEvaluator.cxx:70
AGDD::ExpressionEvaluator::RegisterVariable
bool RegisterVariable(const std::string &var_name, double value)
Definition
ExpressionEvaluator.cxx:63
AGDD::ExpressionEvaluator::is_delimiter
bool is_delimiter(char c)
Definition
ExpressionEvaluator.cxx:89
AGDD::ExpressionEvaluator::trim
static std::string trim(const std::string &)
Definition
ExpressionEvaluator.cxx:272
AGDD::ExpressionEvaluator::RegisterPhysConstant
bool RegisterPhysConstant(std::string &, const std::string &, const std::string &)
Definition
ExpressionEvaluator.cxx:150
AGDD::ExpressionEvaluator::RegisterArray
bool RegisterArray(std::string &c, const std::vector< double > &v)
Definition
ExpressionEvaluator.cxx:48
AGDD::ExpressionEvaluator::m_calc
HepTool::Evaluator m_calc
Definition
ExpressionEvaluator.h:47
AGDD::ExpressionEvaluator::m_CTable
ConstantsTable m_CTable
Definition
ExpressionEvaluator.h:48
AGDD::ExpressionEvaluator::ExpressionEvaluator
ExpressionEvaluator()
Definition
ExpressionEvaluator.cxx:17
AGDD::ExpressionEvaluator::Eval
double Eval(std::string_view expr)
Definition
ExpressionEvaluator.cxx:192
AGDD::ExpressionEvaluator::setFileCurrentlyParsed
void setFileCurrentlyParsed(const std::string &set)
Definition
ExpressionEvaluator.h:41
AGDD::ExpressionEvaluator::RegisterConstant
bool RegisterConstant(std::string &c, double v)
Definition
ExpressionEvaluator.cxx:33
AGDD::ExpressionEvaluator::RegisterExpression
bool RegisterExpression(std::string &c, const std::string &v)
Definition
ExpressionEvaluator.cxx:172
set
STL class.
AGDD
Definition
ExpressionEvaluator.h:15
AGDD::PhysicalConstantsTable
std::map< std::string, double > PhysicalConstantsTable
Definition
ExpressionEvaluator.h:18
AGDD::ConstantsTable
std::map< std::string, double > ConstantsTable
Definition
ExpressionEvaluator.h:17
AGDD::ExpressionsTable
std::map< std::string, std::string > ExpressionsTable
Definition
ExpressionEvaluator.h:19
str
Definition
BTagTrackIpAccessor.cxx:11
Generated on
for ATLAS Offline Software by
1.17.0