Fork me on GitHub

Changeset d77b51d in git for classes/DelphesTF2.cc


Ignore:
Timestamp:
Sep 29, 2015, 2:08:10 PM (9 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
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.
Message:

Merge remote-tracking branch 'upstream/master'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesTF2.cc

    rd870fc5 rd77b51d  
    1818
    1919#include "classes/DelphesTF2.h"
     20
     21#include "RVersion.h"
    2022#include "TString.h"
     23
    2124#include <stdexcept>
    22 #include <string>
    2325
    2426using namespace std;
     
    3436
    3537DelphesTF2::DelphesTF2(const char *name, const char *expression) :
    36   TF2(name,expression)
     38  TF2(name, expression)
    3739{
    3840}
     
    4648//------------------------------------------------------------------------------
    4749
    48 Int_t DelphesTF2::DefinedVariable(TString &chaine, Int_t &action)
     50Int_t DelphesTF2::Compile(const char *expression)
    4951{
    50   action = kVariable;
    51   if(chaine == "z")
     52  TString buffer;
     53  const char *it;
     54  for(it = expression; *it; ++it)
    5255  {
    53     if(fNdim < 1) fNdim = 1;
    54     return 0;
     56    if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue;
     57    buffer.Append(*it);
    5558  }
    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
    5766  {
    58     if(fNdim < 2) fNdim = 2;
    59     return 1;
     67    throw runtime_error("Invalid formula.");
    6068  }
    61   return -1;
     69  return 0;
    6270}
    6371
Note: See TracChangeset for help on using the changeset viewer.