EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <eic-smear/blob/master/include/eicsmear/smear/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.
View newest version in sPHENIX GitHub at line 27 of file FormulaString.h
|
virtual |
Destructor.
Definition at line 68 of file FormulaString.cxx.
View newest version in sPHENIX GitHub at line 68 of file FormulaString.cxx
References mFormula.
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.
View newest version in sPHENIX GitHub 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.
View newest version in sPHENIX GitHub at line 79 of file FormulaString.cxx
References Detector::AsString(), mFormula, and Parse().
|
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.
View newest version in sPHENIX GitHub at line 86 of file FormulaString.cxx
References mFormula, and mVariables.
Referenced by Smear::Device::Smear().
|
virtual |
Returns the unprocessed input formula string.
Definition at line 143 of file FormulaString.cxx.
View newest version in sPHENIX GitHub at line 143 of file FormulaString.cxx
References mInput.
Referenced by Smear::Device::Print().
|
static |
Returns the name corresponding the a Smear::KinType.
Definition at line 155 of file FormulaString.cxx.
View newest version in sPHENIX GitHub at line 155 of file FormulaString.cxx
References name.
Referenced by Smear::Device::Device(), and Smear::Device::Print().
|
static |
Returns the KinType corresponding to the variable name, or kInvalidKinType if the name is invalid.
Definition at line 147 of file FormulaString.cxx.
View newest version in sPHENIX GitHub at line 147 of file FormulaString.cxx
References Smear::kInvalidKinType, and name.
Referenced by Parse().
|
virtual |
Returns the processed formula string with variables substituted.
Definition at line 135 of file FormulaString.cxx.
View newest version in sPHENIX GitHub at line 135 of file FormulaString.cxx
References mFormula.
|
protected |
Process the input string, containing "P", "theta" etc into a version with "x", "y", "z", "t" substituted, compatible with TFormula.
TODO: kk Implicitly limits the number of variables in a formula to 4. TODO: kk Needs documentation and graceful handling.
Definition at line 104 of file FormulaString.cxx.
View newest version in sPHENIX GitHub at line 104 of file FormulaString.cxx
References charm_jet_coverage::args, GetKinType(), mVariables, Acts::VectorHelpers::position(), Acts::UnitConstants::s, and vector().
Referenced by FormulaString().
|
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.
View newest version in sPHENIX GitHub at line 98 of file FormulaString.cxx
References mVariables.
Referenced by Smear::Device::Smear().
|
protected |
Definition at line 107 of file FormulaString.h.
View newest version in sPHENIX GitHub at line 107 of file FormulaString.h
Referenced by Eval(), FormulaString(), GetString(), and ~FormulaString().
|
protected |
Original formula (before parsing)
Definition at line 108 of file FormulaString.h.
View newest version in sPHENIX GitHub at line 108 of file FormulaString.h
Referenced by GetInputString().
|
protected |
Definition at line 109 of file FormulaString.h.
View newest version in sPHENIX GitHub at line 109 of file FormulaString.h
Referenced by Eval(), Parse(), and Variables().