#include <RegularFormula.h>
Definition at line 27 of file RegularFormula.h.
◆ RegularFormula() [1/3]
Root::RegularFormula::RegularFormula |
( |
| ) |
|
◆ RegularFormula() [2/3]
Root::RegularFormula::RegularFormula |
( |
const char * |
name, |
|
|
const char * |
expression |
|
) |
| |
◆ ~RegularFormula()
Root::RegularFormula::~RegularFormula |
( |
| ) |
|
|
virtual |
◆ RegularFormula() [3/3]
◆ getNPars()
unsigned int Root::RegularFormula::getNPars |
( |
| ) |
const |
|
inline |
◆ getParNames()
const std::list<TString>& Root::RegularFormula::getParNames |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ parseExpression()
void Root::RegularFormula::parseExpression |
( |
const char * |
expression, |
|
|
TString & |
expr |
|
) |
| |
|
private |
Definition at line 63 of file RegularFormula.cxx.
68 TRegexp specialChars(
"[+-/*%&=!><()|]+");
72 lastIdx = parStr.Index(specialChars, lastIdx+1);
74 bool needsReplacement =
false;
77 char isEscape = parStr[lastIdx-1];
78 if (isEscape ==
'\\') {
81 parStr = parStr.Remove(lastIdx-1, 1);
82 expr = expr.Remove(lastIdx-1, 1);
83 needsReplacement =
false;
86 needsReplacement =
true;
90 needsReplacement =
true;
93 if (needsReplacement) {
95 parStr = parStr.Replace(lastIdx, 1,
" ");
98 }
while (lastIdx >= 0);
100 TMsgLogger mylogger(
"RegularFormula" );
102 mylogger <<
kINFO <<
"Please be aware that Cling errors are expected and aren't inherently a problem" <<
GEndl;
104 TFormula analyzer(
"analyzer",
"1");
105 TObjArray* parArr = parStr.Tokenize(
" ");
106 for (
int count(0),
i(0);
i<parArr->GetEntries(); ++
i) {
107 TString myPar = ((TObjString*)parArr->At(
i))->GetString();
108 if ( 0==analyzer.Compile(myPar.Data()) ||
109 0==analyzer.Compile(Form(
"%s(1)",myPar.Data())) ) {
113 if (itrF==
m_par.end()) {
114 expr = expr.ReplaceAll(myPar,Form(
"[%d]",
count));
115 m_par.push_back(myPar);
122 mylogger <<
kINFO <<
"Number of interpreted input parameters : " <<
m_par.size() <<
GEndl;
123 mylogger <<
kINFO <<
"Parsed regular expression : " << expr <<
GEndl;
◆ setFormula()
Int_t Root::RegularFormula::setFormula |
( |
const char * |
expression | ) |
|
◆ m_expr
TString Root::RegularFormula::m_expr |
|
private |
◆ m_par
std::list<TString> Root::RegularFormula::m_par |
|
private |
The documentation for this class was generated from the following files: