CMS 3D CMS Logo

ClhepEvaluator.h
Go to the documentation of this file.
1 #ifndef ClhepEvaluator_h
2 #define ClhepEvaluator_h
3 
4 #include <vector>
5 #include <string>
6 #include "CLHEP/Evaluator/Evaluator.h"
7 
9 public:
11 
13 
14  void set(const std::string& ns, const std::string& name, const std::string& exprValue);
15 
16  double eval(const std::string& ns, const std::string& expr);
17 
18  bool isDefined(const std::string& ns, //< current namespace
19  const std::string& name //< name of the variable inside current namespace
20  );
21 
23  const std::vector<std::string>& variables() const { return variables_; }
24  const std::vector<std::string>& values() const { return values_; }
25 
27 
28  double eval(const char* expression);
29 
31  void set(const std::string& name, const std::string& value);
32 
33  void clear();
34 
35 private:
36  void prepare(const std::string& ns, // input
37  const std::string& name, // input
38  const std::string& exprValue, // input
39  std::string& nameResult, // output
40  std::string& valResult) const; // output
41 
42  void throwex(const std::string& ns,
43  const std::string& name,
44  const std::string& expr,
45  const std::string& reason,
46  int idx = 0) const;
47 
48  void checkname(const std::string& name) const;
49 
50  HepTool::Evaluator evaluator_;
51  std::vector<std::string> variables_;
52  std::vector<std::string> values_;
53 };
54 
55 #endif
ClhepEvaluator::prepare
void prepare(const std::string &ns, const std::string &name, const std::string &exprValue, std::string &nameResult, std::string &valResult) const
Definition: ClhepEvaluator.cc:139
ClhepEvaluator::ClhepEvaluator
ClhepEvaluator()
Definition: ClhepEvaluator.cc:11
ClhepEvaluator
Definition: ClhepEvaluator.h:8
ClhepEvaluator::clear
void clear()
Definition: ClhepEvaluator.cc:130
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
ClhepEvaluator::variables
const std::vector< std::string > & variables() const
access to the clhep-implementation of the dictionary variables
Definition: ClhepEvaluator.h:23
ClhepEvaluator::checkname
void checkname(const std::string &name) const
Definition: ClhepEvaluator.cc:235
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ClhepEvaluator::throwex
void throwex(const std::string &ns, const std::string &name, const std::string &expr, const std::string &reason, int idx=0) const
Definition: ClhepEvaluator.cc:227
ClhepEvaluator::evaluator_
HepTool::Evaluator evaluator_
Definition: ClhepEvaluator.h:50
ClhepEvaluator::values_
std::vector< std::string > values_
Definition: ClhepEvaluator.h:52
value
Definition: value.py:1
PixelMapPlotter.reason
reason
Definition: PixelMapPlotter.py:509
ClhepEvaluator::set
void set(const std::string &ns, const std::string &name, const std::string &exprValue)
Definition: ClhepEvaluator.cc:42
jets_cff.expr
expr
Definition: jets_cff.py:483
ClhepEvaluator::variables_
std::vector< std::string > variables_
Definition: ClhepEvaluator.h:51
ClhepEvaluator::~ClhepEvaluator
~ClhepEvaluator()
Definition: ClhepEvaluator.cc:24
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
ClhepEvaluator::eval
double eval(const std::string &ns, const std::string &expr)
Definition: ClhepEvaluator.cc:85
ClhepEvaluator::isDefined
bool isDefined(const std::string &ns, const std::string &name)
Definition: ClhepEvaluator.cc:121
ClhepEvaluator::values
const std::vector< std::string > & values() const
Definition: ClhepEvaluator.h:24