![]() |
eic-smear
1.0.3
A collection of ROOT classes for Monte Carlo events and a fast-smearing code simulating detector effects for the Electron-Ion Collider task force
|
#include <FormulaString.h>
Public Member Functions | |
virtual | ~FormulaString () |
FormulaString () | |
FormulaString (const std::string &) | |
virtual double | Eval (const std::vector< double > &) const |
virtual std::vector < Smear::KinType > | Variables () const |
virtual std::string | GetString () const |
virtual std::string | GetInputString () const |
Static Public Member Functions | |
static std::string | GetKinName (KinType) |
static KinType | GetKinType (const std::string &) |
Protected Member Functions | |
std::string | Parse (const std::string &) |
Protected Attributes | |
TFormula * | mFormula |
std::string | mInput |
Original formula (before parsing) | |
std::vector< Smear::KinType > | mVariables |
A formula described by a string with up to four variables.
Definition at line 27 of file FormulaString.h.
|
virtual |
Destructor.
Definition at line 68 of file FormulaString.cxx.
Smear::FormulaString::FormulaString | ( | ) |
Default construtor. Only present to meet ROOT requirements for objects to have a default constructor. Always evaluates to zero.
Definition at line 75 of file FormulaString.cxx.
|
explicit |
Initialise with a string describing the formula. Formula syntax is as for ROOT::TFormula. Valid variable names are:
Variable names ARE case sensitive. Energy (momentum) are in GeV(/c), angles are in radians. e.g. for the function p/sin(theta) Smear::FormulaString("P/sin(theta)");
Definition at line 79 of file FormulaString.cxx.
|
virtual |
Evaluate the formula with the provided arguments. Arguments should be listed in the order they were named in the constructor string. e.g. if the input function was "P/sin(theta)" pass a vector with element 0 == 0.5 and element 1 == 3 to evaluate at P == 0.5 and theta == 3.
Definition at line 86 of file FormulaString.cxx.
|
virtual |
Returns the unprocessed input formula string.
Definition at line 141 of file FormulaString.cxx.
|
static |
Returns the name corresponding the a Smear::KinType.
Definition at line 153 of file FormulaString.cxx.
|
static |
Returns the KinType corresponding to the variable name, or kInvalidKinType if the name is invalid.
Definition at line 145 of file FormulaString.cxx.
|
virtual |
Returns the processed formula string with variables substituted.
Definition at line 133 of file FormulaString.cxx.
|
protected |
Process the input string, containing "P", "theta" etc into a version with "x", "y", "z", "t" substituted, compatible with TFormula.
Definition at line 102 of file FormulaString.cxx.
|
virtual |
Returns a vector of Smear::KinType corresponding to the variables named in the constructor string. e.g. If initialised with "P/sin(theta)", would result in a vector with two elements: kP, kTheta.
Definition at line 98 of file FormulaString.cxx.