- Timestamp:
- Feb 14, 2019, 4:20:05 PM (6 years ago)
- Branches:
- ImprovedOutputFile, Timing, llp, master
- Children:
- 19ed91a
- Parents:
- 1f2a49a
- Location:
- classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
classes/DelphesLongFormula.cc
r1f2a49a r205ff13 57 57 } 58 58 59 buffer.ReplaceAll("pt", "[pt]");60 buffer.ReplaceAll("eta", "[eta]");61 buffer.ReplaceAll("phi", "[phi]");62 buffer.ReplaceAll("energy", "[energy]");63 buffer.ReplaceAll("d0", "[d0]");64 buffer.ReplaceAll("dz", "[dz]");65 buffer.ReplaceAll("ctgTheta", "[ctgTheta]");66 67 59 #if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0) 68 60 TFormula::SetMaxima(100000, 1000, 1000000); 61 #else 62 TFormula::AddVariable("pt"); 63 TFormula::AddVariable("eta"); 64 TFormula::AddVariable("phi"); 65 TFormula::AddVariable("energy"); 66 TFormula::AddVariable("d0"); 67 TFormula::AddVariable("dz"); 68 TFormula::AddVariable("ctgTheta"); 69 69 #endif 70 70 … … 82 82 Double_t energy, Double_t d0, Double_t dz, Double_t ctgTheta) 83 83 { 84 Double_t x[7]; 84 85 85 TVarNameMap fVarNameMap; 86 TVarValMap fVarValMap; 86 x[0] = pt; 87 x[1] = eta; 88 x[2] = phi; 89 x[3] = energy; 90 x[4] = d0; 91 x[5] = dz; 92 x[6] = ctgTheta; 87 93 88 fVarNameMap[this->GetParNumber("pt")] = "pt"; 89 fVarNameMap[this->GetParNumber("eta")] = "eta"; 90 fVarNameMap[this->GetParNumber("phi")] = "phi"; 91 fVarNameMap[this->GetParNumber("energy")] = "energy"; 92 fVarNameMap[this->GetParNumber("d0")] = "d0"; 93 fVarNameMap[this->GetParNumber("dz")] = "dz"; 94 fVarNameMap[this->GetParNumber("ctgTheta")] = "ctgTheta"; 95 96 fVarValMap["pt"] = pt; 97 fVarValMap["eta"] = eta; 98 fVarValMap["phi"] = phi; 99 fVarValMap["energy"] = energy; 100 fVarValMap["d0"] = d0; 101 fVarValMap["dz"] = dz; 102 fVarValMap["ctgTheta"] = ctgTheta; 103 104 Double_t vals[7]; 105 106 Int_t j = 0; 107 for(Int_t i = 0; i != 7; i++) 108 { 109 if(fVarNameMap.find(i) != fVarNameMap.end()) 110 { 111 TString var_name = fVarNameMap[i]; 112 vals[i] = fVarValMap[var_name]; 113 } 114 else 115 vals[i] = 0.; 116 } 117 return EvalPar(nullptr, vals); 94 return EvalPar(x); 118 95 } 119 96 -
classes/DelphesLongFormula.h
r1f2a49a r205ff13 21 21 22 22 #include "TFormula.h" 23 #include <map>24 23 25 24 class DelphesLongFormula: public TFormula … … 35 34 Double_t Eval(Double_t pt, Double_t eta = 0, Double_t phi = 0, 36 35 Double_t energy = 0, Double_t d0 = 0, Double_t dz = 0, Double_t ctgTheta = 0); 37 38 typedef std::map<Int_t, TString> TVarNameMap; //!39 typedef std::map<TString, Double_t> TVarValMap; //!40 36 }; 41 37
Note:
See TracChangeset
for help on using the changeset viewer.