Fork me on GitHub

Changeset d77b51d in git for classes/DelphesFormula.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/DelphesFormula.cc

    rd870fc5 rd77b51d  
    2323
    2424#include <stdexcept>
    25 #include <string>
    2625
    2726using namespace std;
     
    5150Int_t DelphesFormula::Compile(const char *expression)
    5251{
    53   string buffer;
     52  TString buffer;
    5453  const char *it;
    5554  for(it = expression; *it; ++it)
    5655  {
    5756    if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue;
    58     buffer.push_back(*it);
     57    buffer.Append(*it);
    5958  }
    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)
    6164  {
    6265    throw runtime_error("Invalid formula.");
     
    7477
    7578//------------------------------------------------------------------------------
    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.