Changeset e4caec4 in git for classes/DelphesTF2.cc
- Timestamp:
- Jan 20, 2014, 12:19:36 PM (11 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 0ed696f
- Parents:
- 1150871
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
classes/DelphesTF2.cc
r1150871 re4caec4 27 27 28 28 //------------------------------------------------------------------------------ 29 /*30 Int_t DelphesTF2::Compile(const char *expression)31 {32 string buffer;33 const char *it;34 for(it = expression; *it; ++it)35 {36 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue;37 buffer.push_back(*it);38 }39 40 TFormula f("",buffer.c_str());41 if(f.Compile() != 0)42 {43 throw runtime_error("Invalid formula.");44 }45 return 0;46 }47 48 //------------------------------------------------------------------------------49 50 Double_t DelphesTF2::Eval(Double_t z, Double_t t)51 {52 Double_t x[2] = {z , t};53 return EvalPar(x);54 }55 56 //------------------------------------------------------------------------------57 58 void DelphesTF2::ReplaceAll(std::string& subject, const std::string& search, const std::string& replace)59 {60 size_t pos = 0;61 while ((pos = subject.find(search, pos)) != std::string::npos)62 {63 subject.replace(pos, search.length(), replace);64 pos += replace.length();65 }66 }67 68 69 //------------------------------------------------------------------------------70 71 string DelphesTF2::ChangeVariables(const char *expression)72 {73 DelphesTF2::Compile(expression);74 75 string str = string(expression);76 ReplaceAll(str,"z","x");77 ReplaceAll(str,"t","y");78 79 return str;80 }81 82 */83 //------------------------------------------------------------------------------84 29 85 30 Int_t DelphesTF2::DefinedVariable(TString &chaine, Int_t &action)
Note:
See TracChangeset
for help on using the changeset viewer.