Fork me on GitHub

Changeset c1ce3fe in git for classes


Ignore:
Timestamp:
Jun 29, 2015, 10:28:05 PM (9 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
ff37d75
Parents:
839deb7
Message:

adapt DelphesCylindricalFormula and PhotonConversions to ROOT 6.04

Location:
classes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesCylindricalFormula.cc

    r839deb7 rc1ce3fe  
    2323
    2424#include <stdexcept>
    25 #include <string>
    2625
    2726using namespace std;
     
    5150Int_t DelphesCylindricalFormula::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("r", "x");
     60  buffer.ReplaceAll("phi", "y");
     61  buffer.ReplaceAll("z", "z");
     62  if(TFormula::Compile(buffer) != 0)
    6163  {
    6264    throw runtime_error("Invalid formula.");
     
    6971Double_t DelphesCylindricalFormula::Eval(Double_t r, Double_t phi, Double_t z)
    7072{
    71    Double_t x[3] = {r, phi, z};
    72    return EvalPar(x);
     73  Double_t x[3] = {r, phi, z};
     74  return EvalPar(x);
    7375}
    7476
    7577//------------------------------------------------------------------------------
    76 
    77 Int_t DelphesCylindricalFormula::DefinedVariable(TString &chaine, Int_t &action)
    78 {
    79   action = kVariable;
    80   if(chaine == "r")
    81   {
    82     if(fNdim < 1) fNdim = 1;
    83     return 0;
    84   }
    85   else if(chaine == "phi")
    86   {
    87     if(fNdim < 2) fNdim = 2;
    88     return 1;
    89   }
    90   else if(chaine == "z")
    91   {
    92     if(fNdim < 3) fNdim = 3;
    93     return 2;
    94   }
    95   return -1;
    96 }
    97 
    98 //------------------------------------------------------------------------------
  • classes/DelphesCylindricalFormula.h

    r839deb7 rc1ce3fe  
    3535
    3636  Double_t Eval(Double_t r, Double_t phi = 0, Double_t z = 0);
    37 
    38   Int_t DefinedVariable(TString &variable, Int_t &action);
    3937};
    4038
Note: See TracChangeset for help on using the changeset viewer.