ATLAS Offline Software
ArrayFunction.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "ArrayFunction.h"
6 
7 namespace GeoGenfun {
8 
9 FUNCTION_OBJECT_IMP(ArrayFunction)
10 
11 // Constructor
13  m_values(begin,end) {}
14 
15 // Destructor
17 
18 // Copy constructor
20  GeoGenfun::AbsFunction(), m_values(right.m_values) {}
21 
22  // Retrieve function value
23 double ArrayFunction::operator ()(double argument) const {
24  int i = int (argument+0.5);
25  if (i<0 || i>=int(m_values.size())) return 0;
26  else return m_values[i];
27 }
28 
29 }
GeoGenfun::ArrayFunction::~ArrayFunction
virtual ~ArrayFunction()
Definition: ArrayFunction.cxx:16
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:12
lumiFormat.i
int i
Definition: lumiFormat.py:85
GeoGenfun::ArrayFunction::operator()
virtual double operator()(double argument) const override
Definition: ArrayFunction.cxx:23
ArrayFunction.h
GeoGenfun
Definition: ArrayFunction.cxx:7