Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesFormula.cc

    r730bc64 r3b5d79a  
    1616 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1717 */
    18 
    1918
    2019#include "classes/DelphesFormula.h"
     
    5453  for(it = expression; *it; ++it)
    5554  {
    56     if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue;
     55    if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\') continue;
    5756    buffer.Append(*it);
    5857  }
     
    6160  buffer.ReplaceAll("phi", "z");
    6261  buffer.ReplaceAll("energy", "t");
     62  buffer.ReplaceAll("d0", "[0]");
     63  buffer.ReplaceAll("dz", "[1]");
     64  buffer.ReplaceAll("ctgTheta", "[2]");
    6365
     66#if ROOT_VERSION_CODE < ROOT_VERSION(6, 3, 0)
     67  TFormula::SetMaxima(100000, 1000, 1000000);
     68#endif
    6469
    65 
    66   #if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
    67     TFormula::SetMaxima(100000,1000,1000000);
    68   #endif
    69  
    7070  if(TFormula::Compile(buffer) != 0)
    7171  {
     
    7777//------------------------------------------------------------------------------
    7878
    79 Double_t DelphesFormula::Eval(Double_t pt, Double_t eta, Double_t phi, Double_t energy)
     79Double_t DelphesFormula::Eval(Double_t pt, Double_t eta, Double_t phi,
     80  Double_t energy, Double_t d0, Double_t dz,
     81  Double_t ctgTheta)
    8082{
    81    Double_t x[4] = {pt, eta, phi, energy};
    82    return EvalPar(x);
     83  Double_t x[4] = {pt, eta, phi, energy};
     84  Double_t params[3] = {d0, dz, ctgTheta};
     85  return EvalPar(x, params);
    8386}
    8487
Note: See TracChangeset for help on using the changeset viewer.