Fork me on GitHub

Changeset f298e48 in git for classes/DelphesFormula.cc


Ignore:
Timestamp:
Mar 22, 2020, 6:39:09 PM (5 years ago)
Author:
Roberto Preghenella <preghenella@…>
Branches:
ImprovedOutputFile, master
Children:
7e83689
Parents:
288a5fc
git-author:
Roberto Preghenella <preghenella@…> (03/22/20 16:32:29)
git-committer:
Roberto Preghenella <preghenella@…> (03/22/20 18:39:09)
Message:

Add radius (distance from beam line) to formula parameterisations

also redefines the DelphesFormula::Eval function to allow one to
include future parameters for parameterisations that can be
taken from Candidates in a generalised way.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesFormula.cc

    r288a5fc rf298e48  
    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]");
    6567
    6668#if ROOT_VERSION_CODE < ROOT_VERSION(6, 3, 0)
     
    7779//------------------------------------------------------------------------------
    7880
    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)
     81Double_t DelphesFormula::Eval(Double_t pt, Double_t eta, Double_t phi, Double_t energy, Candidate *candidate)
    8282{
     83
     84  Double_t d0 = 0., dz = 0., ctgTheta = 0., radius = 0.;
     85  if (candidate) {
     86    d0 = candidate->D0;
     87    dz = candidate->DZ;
     88    ctgTheta = candidate->CtgTheta;
     89    radius = candidate->Position.Pt();
     90  }
     91   
    8392  Double_t x[4] = {pt, eta, phi, energy};
    84   Double_t params[3] = {d0, dz, ctgTheta};
     93  Double_t params[4] = {d0, dz, ctgTheta, radius};
    8594  return EvalPar(x, params);
    8695}
Note: See TracChangeset for help on using the changeset viewer.