EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FormulaString.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FormulaString.h
1 
10 #ifndef INCLUDE_EICSMEAR_SMEAR_FORMULASTRING_H_
11 #define INCLUDE_EICSMEAR_SMEAR_FORMULASTRING_H_
12 
13 #include <string>
14 #include <vector>
15 
16 #include <TObject.h>
17 
18 #include "eicsmear/smear/Smear.h" // For KinType enum
19 
20 class TFormula;
21 
22 namespace Smear {
23 
27 class FormulaString : public TObject {
28  public:
32  virtual ~FormulaString();
33 
40  FormulaString();
41 
59  explicit FormulaString(const std::string&);
60 
69  virtual double Eval(const std::vector<double>&) const;
70 
77  virtual std::vector<Smear::KinType> Variables() const;
78 
82  virtual std::string GetString() const;
83 
87  virtual std::string GetInputString() const;
88 
92  static std::string GetKinName(KinType);
93 
98  static KinType GetKinType(const std::string&);
99 
100  protected:
105  std::string Parse(const std::string&);
106 
107  TFormula* mFormula;
108  std::string mInput;
109  std::vector<Smear::KinType> mVariables;
110 
111  ClassDef(Smear::FormulaString, 1)
112 };
113 
114 } // namespace Smear
115 
116 #endif // INCLUDE_EICSMEAR_SMEAR_FORMULASTRING_H_