Changeset d77b51d in git for classes/DelphesTF2.cc
- Timestamp:
- Sep 29, 2015, 2:08:10 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- a98c7ef
- Parents:
- d870fc5 (diff), 06ec139 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
classes/DelphesTF2.cc
rd870fc5 rd77b51d 18 18 19 19 #include "classes/DelphesTF2.h" 20 21 #include "RVersion.h" 20 22 #include "TString.h" 23 21 24 #include <stdexcept> 22 #include <string>23 25 24 26 using namespace std; … … 34 36 35 37 DelphesTF2::DelphesTF2(const char *name, const char *expression) : 36 TF2(name, expression)38 TF2(name, expression) 37 39 { 38 40 } … … 46 48 //------------------------------------------------------------------------------ 47 49 48 Int_t DelphesTF2:: DefinedVariable(TString &chaine, Int_t &action)50 Int_t DelphesTF2::Compile(const char *expression) 49 51 { 50 action = kVariable; 51 if(chaine == "z") 52 TString buffer; 53 const char *it; 54 for(it = expression; *it; ++it) 52 55 { 53 if( fNdim < 1) fNdim = 1;54 return 0;56 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue; 57 buffer.Append(*it); 55 58 } 56 else if(chaine == "t") 59 buffer.ReplaceAll("z", "x"); 60 buffer.ReplaceAll("t", "y"); 61 #if ROOT_VERSION_CODE < ROOT_VERSION(6,04,00) 62 if(TF2::Compile(buffer) != 0) 63 #else 64 if(TF2::GetFormula()->Compile(buffer) != 0) 65 #endif 57 66 { 58 if(fNdim < 2) fNdim = 2; 59 return 1; 67 throw runtime_error("Invalid formula."); 60 68 } 61 return -1;69 return 0; 62 70 } 63 71
Note:
See TracChangeset
for help on using the changeset viewer.