ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_PAI_utils.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRT_PAI_utils_h
6#define TRT_PAI_utils_h
7
8#include <vector>
9
13namespace TRT_PAI_utils {
23 float Interpolate(const float& xval,
24 const std::vector<float>& xtabulated,
25 const std::vector<float>& ytabulated);
26 inline float calculate_interpolation(const float& xval, const float& x1, const float& x2, const float& y1, const float& y2)
27 {
28 return y1+(y2-y1)*(xval-x1)/(x2-x1);
29 }
30}
31#endif
Utilities.
float calculate_interpolation(const float &xval, const float &x1, const float &x2, const float &y1, const float &y2)
float Interpolate(const float &xval, const std::vector< float > &xtabulated, const std::vector< float > &ytabulated)
Interpolation function.