Fork me on GitHub

Changeset d612dec in git for classes/DelphesFormula.cc


Ignore:
Timestamp:
Dec 9, 2021, 7:52:15 AM (3 years ago)
Author:
christinaw97 <christina.wang@…>
Children:
29b722a
Parents:
a5af1df (diff), 0c0c9af (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 branch 'master' of github.com:Christinaw97/delphes into HEAD

File:
1 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesFormula.cc

    ra5af1df rd612dec  
    1818
    1919#include "classes/DelphesFormula.h"
     20#include "classes/DelphesClasses.h"
    2021
    2122#include "TString.h"
     
    6364  buffer.ReplaceAll("dz", "[1]");
    6465  buffer.ReplaceAll("ctgTheta", "[2]");
     66  buffer.ReplaceAll("radius", "[3]");
     67  buffer.ReplaceAll("density", "[4]");
    6568
    6669#if ROOT_VERSION_CODE < ROOT_VERSION(6, 3, 0)
     
    7780//------------------------------------------------------------------------------
    7881
    79 Double_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)
     82Double_t DelphesFormula::Eval(Double_t pt, Double_t eta, Double_t phi, Double_t energy, Candidate *candidate)
    8283{
     84
     85  Double_t d0 = 0., dz = 0., ctgTheta = 0., radius = 0., density = 0.;
     86  if (candidate) {
     87    d0 = candidate->D0;
     88    dz = candidate->DZ;
     89    ctgTheta = candidate->CtgTheta;
     90    radius = candidate->Position.Pt();
     91    density = candidate->ParticleDensity;
     92  }
     93   
    8394  Double_t x[4] = {pt, eta, phi, energy};
    84   Double_t params[3] = {d0, dz, ctgTheta};
     95  Double_t params[5] = {d0, dz, ctgTheta, radius, density};
    8596  return EvalPar(x, params);
    8697}
Note: See TracChangeset for help on using the changeset viewer.