ATLAS Offline Software
Loading...
Searching...
No Matches
ZdcSincInterp.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "TMath.h"
7#include <cmath>
8
9namespace ZDC
10{
11double SincInterp(const double* xvec, const double* pvec)
12{
13 // pvec are the sample values
14 double ret = 0;
15 double T = pvec[0]; // deltaT
16 double t = xvec[0];
17 for (int isamp = 0; isamp < 7; isamp++)
18 {
19 double arg = (t - isamp * T) / T;
20 if (arg != 0.0)
21 {
22 ret += pvec[isamp + 1] * std::sin(TMath::Pi() * arg) / (TMath::Pi() * arg);
23 }
24 }
25 return ret;
26}
27}
std::array< fp_t, 2 > pvec
double SincInterp(const double *xvec, const double *pvec)