Changeset f59e9c1 in git for classes/DelphesFormula.cc
- Timestamp:
- Jun 24, 2015, 5:44:37 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- c9803f7
- Parents:
- 3cac201
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
classes/DelphesFormula.cc
r3cac201 rf59e9c1 23 23 24 24 #include <stdexcept> 25 #include <string>26 25 27 26 using namespace std; … … 51 50 Int_t DelphesFormula::Compile(const char *expression) 52 51 { 53 string buffer;52 TString buffer; 54 53 const char *it; 55 54 for(it = expression; *it; ++it) 56 55 { 57 56 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue; 58 buffer. push_back(*it);57 buffer.Append(*it); 59 58 } 60 if(TFormula::Compile(buffer.c_str()) != 0) 59 buffer.ReplaceAll("pt", "x"); 60 buffer.ReplaceAll("eta", "y"); 61 buffer.ReplaceAll("phi", "z"); 62 buffer.ReplaceAll("energy", "t"); 63 if(TFormula::Compile(buffer) != 0) 61 64 { 62 65 throw runtime_error("Invalid formula."); … … 74 77 75 78 //------------------------------------------------------------------------------ 76 77 Int_t DelphesFormula::DefinedVariable(TString &chaine, Int_t &action)78 {79 action = kVariable;80 if(chaine == "pt")81 {82 if(fNdim < 1) fNdim = 1;83 return 0;84 }85 else if(chaine == "eta")86 {87 if(fNdim < 2) fNdim = 2;88 return 1;89 }90 else if(chaine == "phi")91 {92 if(fNdim < 3) fNdim = 3;93 return 2;94 }95 else if(chaine == "energy")96 {97 if(fNdim < 4) fNdim = 4;98 return 3;99 }100 return -1;101 }102 103 //------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.