Fork me on GitHub

Changeset 205ff13 in git for classes/DelphesLongFormula.cc


Ignore:
Timestamp:
Feb 14, 2019, 4:20:05 PM (6 years ago)
Author:
Pavel Demin <pavel-demin@…>
Branches:
ImprovedOutputFile, Timing, llp, master
Children:
19ed91a
Parents:
1f2a49a
Message:

remove TVarNameMap and TVarValMap from DelphesLongFormula

File:
1 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesLongFormula.cc

    r1f2a49a r205ff13  
    5757  }
    5858
    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 
    6759#if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0)
    6860  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");
    6969#endif
    7070
     
    8282  Double_t energy, Double_t d0, Double_t dz, Double_t ctgTheta)
    8383{
     84  Double_t x[7];
    8485
    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;
    8793
    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);
    11895}
    11996
Note: See TracChangeset for help on using the changeset viewer.