Fork me on GitHub

Changeset f298e48 in git


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.

Files:
6 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}
  • classes/DelphesFormula.h

    r288a5fc rf298e48  
    2222#include "TFormula.h"
    2323
     24class Candidate;
     25
    2426class DelphesFormula: public TFormula
    2527{
     
    3335  Int_t Compile(const char *expression);
    3436
    35   Double_t Eval(Double_t pt, Double_t eta = 0, Double_t phi = 0,
    36     Double_t energy = 0, Double_t d0 = 0, Double_t dz = 0,
    37     Double_t ctgTheta = 0);
     37  Double_t Eval(Double_t pt, Double_t eta = 0, Double_t phi = 0, Double_t energy = 0, Candidate *candidate = nullptr);
    3838};
    3939
  • modules/AngularSmearing.cc

    r288a5fc rf298e48  
    112112    // apply smearing formula for eta,phi
    113113
    114     eta = gRandom->Gaus(eta, fFormulaEta->Eval(pt, eta, phi, e));
    115     phi = gRandom->Gaus(phi, fFormulaPhi->Eval(pt, eta, phi, e));
     114    eta = gRandom->Gaus(eta, fFormulaEta->Eval(pt, eta, phi, e, candidate));
     115    phi = gRandom->Gaus(phi, fFormulaPhi->Eval(pt, eta, phi, e, candidate));
    116116
    117117    if(pt <= 0.0) continue;
  • modules/Efficiency.cc

    r288a5fc rf298e48  
    9595{
    9696  Candidate *candidate;
    97   Double_t pt, eta, phi, e, d0, dz, ctgTheta;
     97  Double_t pt, eta, phi, e;
    9898
    9999  fItInputArray->Reset();
     
    106106    pt = candidateMomentum.Pt();
    107107    e = candidateMomentum.E();
    108     d0 = candidate->D0;
    109     dz = candidate->DZ;
    110     ctgTheta = candidate->CtgTheta;
    111 
     108   
    112109    // apply an efficency formula
    113     if(gRandom->Uniform() > fFormula->Eval(pt, eta, phi, e, d0, dz, ctgTheta)) continue;
     110    if(gRandom->Uniform() > fFormula->Eval(pt, eta, phi, e, candidate)) continue;
    114111
    115112    fOutputArray->Add(candidate);
  • modules/MomentumSmearing.cc

    r288a5fc rf298e48  
    106106    pt = candidateMomentum.Pt();
    107107    e = candidateMomentum.E();
    108     res = fFormula->Eval(pt, eta, phi, e);
     108    res = fFormula->Eval(pt, eta, phi, e, candidate);
    109109
    110110    // apply smearing formula
  • modules/TrackSmearing.cc

    r288a5fc rf298e48  
    158158  TLorentzVector beamSpotPosition;
    159159  Candidate *candidate, *mother;
    160   Double_t pt, eta, d0, d0Error, trueD0, dz, dzError, trueDZ, p, pError, trueP, ctgTheta, ctgThetaError, trueCtgTheta, phi, phiError, truePhi;
     160  Double_t pt, eta, e, d0, d0Error, trueD0, dz, dzError, trueDZ, p, pError, trueP, ctgTheta, ctgThetaError, trueCtgTheta, phi, phiError, truePhi;
    161161  Double_t x, y, z, t, px, py, pz, theta;
    162162  Double_t q, r;
     
    223223    pt = momentum.Pt();
    224224    eta = momentum.Eta();
    225 
     225    e = momentum.E();
     226   
    226227    d0 = trueD0 = candidate->D0;
    227228    dz = trueDZ = candidate->DZ;
     
    232233
    233234    if(fUseD0Formula)
    234       d0Error = fD0Formula->Eval(pt, eta);
     235      d0Error = fD0Formula->Eval(pt, eta, phi, e, candidate);
    235236    else
    236237    {
     
    247248
    248249    if(fUseDZFormula)
    249       dzError = fDZFormula->Eval(pt, eta);
     250      dzError = fDZFormula->Eval(pt, eta, phi, e, candidate);
    250251    else
    251252    {
     
    262263
    263264    if(fUsePFormula)
    264       pError = fPFormula->Eval(pt, eta) * p;
     265      pError = fPFormula->Eval(pt, eta, phi, e, candidate) * p;
    265266    else
    266267    {
     
    277278
    278279    if(fUseCtgThetaFormula)
    279       ctgThetaError = fCtgThetaFormula->Eval(pt, eta);
     280      ctgThetaError = fCtgThetaFormula->Eval(pt, eta, phi, e, candidate);
    280281    else
    281282    {
     
    292293
    293294    if(fUsePhiFormula)
    294       phiError = fPhiFormula->Eval(pt, eta);
     295      phiError = fPhiFormula->Eval(pt, eta, phi, e, candidate);
    295296    else
    296297    {
Note: See TracChangeset for help on using the changeset viewer.