ATLAS Offline Software
ArrayFunction.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "ArrayFunction.h"
6 
7 namespace GeoGenfun {
8 
9 // cppcheck-suppress unknownMacro
10 FUNCTION_OBJECT_IMP(ArrayFunction)
11 
12 // Constructor
14  m_values(begin,end) {}
15 
16 // Destructor
18 
19 // Copy constructor
21  GeoGenfun::AbsFunction(), m_values(right.m_values) {}
22 
23  // Retrieve function value
24 double ArrayFunction::operator ()(double argument) const {
25  int i = int (argument+0.5);
26  if (i<0 || i>=int(m_values.size())) return 0;
27  else return m_values[i];
28 }
29 
30 }
GeoGenfun::ArrayFunction::~ArrayFunction
virtual ~ArrayFunction()
Definition: ArrayFunction.cxx:17
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
GeoGenfun::ArrayFunction::m_values
std::vector< double > m_values
Definition: ArrayFunction.h:41
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
python.acmdlib.argument
def argument(*args, **kwargs)
Definition: acmdlib.py:181
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
GeoGenfun::ArrayFunction
Definition: ArrayFunction.h:16
GeoGenfun::ArrayFunction::ArrayFunction
ArrayFunction(const double *begin, const double *end)
Definition: ArrayFunction.cxx:13
lumiFormat.i
int i
Definition: lumiFormat.py:85
GeoGenfun::ArrayFunction::operator()
virtual double operator()(double argument) const override
Definition: ArrayFunction.cxx:24
ArrayFunction.h
GeoGenfun
Definition: ArrayFunction.cxx:7