Project
Loading...
Searching...
No Matches
o2::gpu::Spline2DContainer< DataT > Class Template Reference

#include <Spline2DSpec.h>

Inherits o2::gpu::FlatObject.

Inherited by o2::gpu::Spline2DSpec< DataT, YdimT, 0 >.

Public Types

typedef Spline1D< DataT >::SafetyLevel SafetyLevel
 
typedef Spline1D< DataT >::Knot Knot
 

Public Member Functions

 GPUd () static const expr int32_t getVersion()
 _____________ Version control __________________________
 
 Spline2DContainer ()=default
 _____________ C++ constructors / destructors __________________________
 
 Spline2DContainer (const Spline2DContainer &)=delete
 Disable all other constructors.
 
 ~Spline2DContainer ()=default
 Destructor.
 
void approximateFunction (double x1Min, double x1Max, double x2Min, double x2Max, std::function< void(double x1, double x2, double f[])> F, int32_t nAuxiliaryDataPointsU1=4, int32_t nAuxiliaryDataPointsU2=4)
 _______________ Construction interface ________________________
 
void approximateFunctionViaDataPoints (double x1Min, double x1Max, double x2Min, double x2Max, std::function< void(double x1, double x2, double f[])> F, int32_t nAuxiliaryDataPointsX1, int32_t nAuxiliaryDataPointsX2)
 
int32_t writeToFile (TFile &outf, const char *name)
 _______________ IO ________________________
 
 GPUd () int32_t getYdimensions() const
 _______________ Getters ________________________
 
 GPUd () static const expr size_t getParameterAlignmentBytes()
 Get minimal required alignment for the spline parameters.
 
 GPUd () int32_t getNumberOfParameters() const
 Number of parameters.
 
 GPUd () size_t getSizeOfParameters() const
 Size of the parameter array in bytes.
 
 GPUd () int32_t getNumberOfKnots() const
 Get a number of knots.
 
 GPUd () const Spline1D< DataT > &getGridX1() const
 Get 1-D grid for the X1 coordinate.
 
 GPUd () const Spline1D< DataT > &getGridX2() const
 Get 1-D grid for the X2 coordinate.
 
 GPUd () const Spline1D< DataT > &getGrid(int32_t ix) const
 Get 1-D grid for X1 or X2 coordinate.
 
 GPUd () void getKnotU(int32_t iKnot
 Get (u1,u2) of i-th knot.
 
 GPUd () int32_t getKnotIndex(int32_t iKnotX1
 Get index of a knot (iKnotX1,iKnotX2)
 
 GPUd () DataT *getParameters()
 Get spline parameters.
 
 GPUd () const DataT *getParameters() const
 Get spline parameters const.
 
 GPUd () size_t getGridX1Offset() const
 _______________ Technical stuff ________________________
 
 GPUd () size_t getGridX2Offset() const
 Get offset of GridX2 flat data in the flat buffer.
 
 GPUd () void setXrange(DataT x1Min
 Set X range.
 
mGridX2 setXrange (x2Min, x2Max)
 
void print () const
 Print method.
 
 GPUd () int32_t calcNumberOfParameters(int32_t nYdim) const
 _______________ Expert tools _______________
 
void cloneFromObject (const Spline2DContainer &obj, char *newFlatBufferPtr)
 
void moveBufferTo (char *newBufferPtr)
 
void destroy ()
 
void setActualBufferAddress (char *actualFlatBufferPtr)
 
void setFutureBufferAddress (char *futureFlatBufferPtr)
 
charreleaseInternalBuffer ()
 _____________ Methods for making the data buffer external __________________________
 
- Public Member Functions inherited from o2::gpu::FlatObject
 FlatObject ()=default
 _____________ Constructors / destructors __________________________
 
 ~FlatObject ()
 
 FlatObject (const FlatObject &)=delete
 
FlatObjectoperator= (const FlatObject &)=delete
 
void destroy ()
 _______________ Utilities _______________________________________________
 
size_t getFlatBufferSize () const
 Gives size of the flat buffer.
 
const chargetFlatBufferPtr () const
 Gives pointer to the flat buffer.
 
bool isConstructed () const
 Tells if the object is constructed.
 
bool isBufferInternal () const
 Tells if the buffer is internal.
 
void adoptInternalBuffer (char *buf)
 
void clearInternalBufferPtr ()
 
void printC () const
 Print the content of the flat buffer.
 

Static Public Member Functions

static Spline2DContainerreadFromFile (TFile &inpf, const char *name)
 read a class object from the file
 
static int32_t test (const bool draw=0, const bool drawDataPoints=1)
 _______________ Test tools _______________
 
static constexpr size_t getBufferAlignmentBytes ()
 _____________ FlatObject functionality, see FlatObject class for description ____________
 
static constexpr size_t getClassAlignmentBytes ()
 _____________ Memory alignment __________________________
 
- Static Public Member Functions inherited from o2::gpu::FlatObject
static size_t alignSize (size_t sizeBytes, size_t alignmentBytes)
 _______________ Generic utilities _______________________________________________
 
template<class T >
static T * relocatePointer (const char *oldBase, char *newBase, const T *ptr)
 Relocates a pointer inside a buffer to the new buffer address.
 
template<class T , class TFile >
static int32_t writeToFile (T &obj, TFile &outf, const char *name)
 write a child class object to the file
 
template<class T , class TFile >
static T * readFromFile (TFile &inpf, const char *name)
 read a child class object from the file
 
template<class T >
static std::string stressTest (T &obj)
 Test the flat object functionality for a child class T.
 

Public Attributes

int32_t & u1
 
int32_t int32_t &u2 const
 
 u2 = mGridX2.getKnot(iKnot / mGridX1.getNumberOfKnots()).getU()
 
int32_t iKnotX2 const
 
DataT x1Max
 
DataT DataT x2Min
 
DataT DataT DataT x2Max
 

Protected Member Functions

void recreate (int32_t nYdim, int32_t nKnotsX1, int32_t nKnotsX2)
 Constructor for a regular spline.
 
void recreate (int32_t nYdim, int32_t nKnotsX1, const int32_t knotU1[], int32_t nKnotsX2, const int32_t knotU2[])
 Constructor for an irregular spline.
 
 ClassDefNV (Spline2DContainer, 1)
 (transient!!) F-dependent parameters of the spline
 
- Protected Member Functions inherited from o2::gpu::FlatObject
void startConstruction ()
 _____________ Construction _________
 
void finishConstruction (int32_t flatBufferSize)
 
void cloneFromObject (const FlatObject &obj, char *newFlatBufferPtr)
 
charreleaseInternalBuffer ()
 _____________ Methods for making the data buffer external __________________________
 
void moveBufferTo (char *newBufferPtr)
 
void setActualBufferAddress (char *actualFlatBufferPtr)
 _____________ Methods for moving the class with its external buffer to another location __________________________
 
void setFutureBufferAddress (char *futureFlatBufferPtr)
 
 ClassDefNV (FlatObject, 1)
 Pointer to the flat buffer.
 

Protected Attributes

int32_t mYdim = 0
 _____________ Data members ____________
 
Spline1D< DataT > mGridX1
 grid for U axis
 
Spline1D< DataT > mGridX2
 grid for V axis
 
DataT * mParameters = nullptr
 
- Protected Attributes inherited from o2::gpu::FlatObject
int32_t mFlatBufferSize = 0
 size of the flat buffer
 
uint32_t mConstructionMask = ConstructionState::NotConstructed
 mask for constructed object members, first two bytes are used by this class
 
charmFlatBufferContainer = nullptr
 
charmFlatBufferPtr = nullptr
 

Additional Inherited Members

- Protected Types inherited from o2::gpu::FlatObject
enum  ConstructionState : uint32_t { NotConstructed = 0x0 , Constructed = 0x1 , InProgress = 0x2 }
 GPUCA_GPUCODE. More...
 
- Static Protected Member Functions inherited from o2::gpu::FlatObject
static constexpr size_t getClassAlignmentBytes ()
 _____________ Memory alignment __________________________
 
static constexpr size_t getBufferAlignmentBytes ()
 Gives minimal alignment in bytes required for the flat buffer.
 

Detailed Description

template<typename DataT>
class o2::gpu::Spline2DContainer< DataT >

================================================================================================== The class Spline2DContainer is a base Spline2D class. It contains all the class members and those methods which only depends on the DataT data type. It also contains all non-inlined methods with the implementation in SplineSpec.cxx file.

DataT is a data type, which is supposed to be either double or float. For other possible data types one has to add the corresponding instantiation line at the end of the Spline2DSpec.cxx file

Definition at line 47 of file Spline2DSpec.h.

Member Typedef Documentation

◆ Knot

template<typename DataT >
typedef Spline1D<DataT>::Knot o2::gpu::Spline2DContainer< DataT >::Knot

Definition at line 51 of file Spline2DSpec.h.

◆ SafetyLevel

template<typename DataT >
typedef Spline1D<DataT>::SafetyLevel o2::gpu::Spline2DContainer< DataT >::SafetyLevel

Definition at line 50 of file Spline2DSpec.h.

Constructor & Destructor Documentation

◆ Spline2DContainer() [1/2]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::Spline2DContainer ( )
default

_____________ C++ constructors / destructors __________________________

Default constructor

◆ Spline2DContainer() [2/2]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::Spline2DContainer ( const Spline2DContainer< DataT > &  )
delete

Disable all other constructors.

◆ ~Spline2DContainer()

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::~Spline2DContainer ( )
default

Destructor.

Member Function Documentation

◆ approximateFunction()

template<typename DataT >
void Spline2DContainer::approximateFunction ( double  x1Min,
double  x1Max,
double  x2Min,
double  x2Max,
std::function< void(double x1, double x2, double f[])>  F,
int32_t  nAuxiliaryDataPointsU1 = 4,
int32_t  nAuxiliaryDataPointsU2 = 4 
)

_______________ Construction interface ________________________

approximate a function F with this spline

approximate a function F with this spline

Definition at line 197 of file Spline2DSpec.cxx.

◆ approximateFunctionViaDataPoints()

template<typename DataT >
void Spline2DContainer::approximateFunctionViaDataPoints ( double  x1Min,
double  x1Max,
double  x2Min,
double  x2Max,
std::function< void(double x1, double x2, double f[])>  F,
int32_t  nAuxiliaryDataPointsX1,
int32_t  nAuxiliaryDataPointsX2 
)

approximate a function F with this spline

Definition at line 208 of file Spline2DSpec.cxx.

◆ ClassDefNV()

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::ClassDefNV ( Spline2DContainer< DataT >  ,
 
)
protected

(transient!!) F-dependent parameters of the spline

◆ cloneFromObject()

template<typename DataT >
void Spline2DContainer::cloneFromObject ( const Spline2DContainer< DataT > &  obj,
char newFlatBufferPtr 
)

See FlatObject for description

Definition at line 101 of file Spline2DSpec.cxx.

◆ destroy()

template<typename DataT >
void Spline2DContainer::destroy ( )

See FlatObject for description

Definition at line 46 of file Spline2DSpec.cxx.

◆ getBufferAlignmentBytes()

template<typename DataT >
static constexpr size_t o2::gpu::FlatObject::getBufferAlignmentBytes ( )
inlinestaticconstexpr

_____________ FlatObject functionality, see FlatObject class for description ____________

Definition at line 197 of file FlatObject.h.

◆ getClassAlignmentBytes()

template<typename DataT >
static constexpr size_t o2::gpu::FlatObject::getClassAlignmentBytes ( )
inlinestaticconstexpr

_____________ Memory alignment __________________________

Gives minimal alignment in bytes required for the class object

Definition at line 194 of file FlatObject.h.

◆ GPUd() [1/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const
inline

Get spline parameters const.

Definition at line 135 of file Spline2DSpec.h.

◆ GPUd() [2/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const &
inline

Get 1-D grid for X1 or X2 coordinate.

Definition at line 116 of file Spline2DSpec.h.

◆ GPUd() [3/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const &
inline

Get 1-D grid for the X1 coordinate.

Definition at line 110 of file Spline2DSpec.h.

◆ GPUd() [4/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const &
inline

Get 1-D grid for the X2 coordinate.

Definition at line 113 of file Spline2DSpec.h.

◆ GPUd() [5/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( )
inline

Get spline parameters.

Definition at line 132 of file Spline2DSpec.h.

◆ GPUd() [6/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const
inline

_______________ Expert tools _______________

Number of parameters for given Y dimensions

Definition at line 158 of file Spline2DSpec.h.

◆ GPUd() [7/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( )

Get index of a knot (iKnotX1,iKnotX2)

◆ GPUd() [8/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const
inline

Get a number of knots.

Definition at line 107 of file Spline2DSpec.h.

◆ GPUd() [9/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const
inline

Number of parameters.

Definition at line 101 of file Spline2DSpec.h.

◆ GPUd() [10/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const
inline

_______________ Getters ________________________

Get number of Y dimensions

Definition at line 95 of file Spline2DSpec.h.

◆ GPUd() [11/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const
inline

_______________ Technical stuff ________________________

Get offset of GridX1 flat data in the flat buffer

Definition at line 140 of file Spline2DSpec.h.

◆ GPUd() [12/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const
inline

Get offset of GridX2 flat data in the flat buffer.

Definition at line 143 of file Spline2DSpec.h.

◆ GPUd() [13/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const
inline

Size of the parameter array in bytes.

Definition at line 104 of file Spline2DSpec.h.

◆ GPUd() [14/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const
inline

_____________ Version control __________________________

Version control

Definition at line 56 of file Spline2DSpec.h.

◆ GPUd() [15/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( ) const
inline

Get minimal required alignment for the spline parameters.

Definition at line 98 of file Spline2DSpec.h.

◆ GPUd() [16/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( )

Get (u1,u2) of i-th knot.

◆ GPUd() [17/17]

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::GPUd ( )

Set X range.

◆ moveBufferTo()

template<typename DataT >
void Spline2DContainer::moveBufferTo ( char newBufferPtr)

See FlatObject for description

Definition at line 119 of file Spline2DSpec.cxx.

◆ print()

template<typename DataT >
void Spline2DContainer::print ( ) const

Print method.

Definition at line 89 of file Spline2DSpec.cxx.

◆ readFromFile()

template<typename DataT >
Spline2DContainer< DataT > * Spline2DContainer::readFromFile ( TFile &  inpf,
const char name 
)
static

read a class object from the file

read a class object from the file

Definition at line 226 of file Spline2DSpec.cxx.

◆ recreate() [1/2]

template<typename DataT >
void Spline2DContainer::recreate ( int32_t  nYdim,
int32_t  nKnotsX1,
const int32_t  knotU1[],
int32_t  nKnotsX2,
const int32_t  knotU2[] 
)
protected

Constructor for an irregular spline.

Constructor for an irregular spline

Definition at line 130 of file Spline2DSpec.cxx.

◆ recreate() [2/2]

template<typename DataT >
void Spline2DContainer::recreate ( int32_t  nYdim,
int32_t  nKnotsX1,
int32_t  nKnotsX2 
)
protected

Constructor for a regular spline.

Constructor for a regular spline

Definition at line 162 of file Spline2DSpec.cxx.

◆ releaseInternalBuffer()

template<typename DataT >
char * o2::gpu::FlatObject::releaseInternalBuffer ( )
inline

_____________ Methods for making the data buffer external __________________________

Definition at line 220 of file FlatObject.h.

◆ setActualBufferAddress()

template<typename DataT >
void Spline2DContainer::setActualBufferAddress ( char actualFlatBufferPtr)

See FlatObject for description

Definition at line 57 of file Spline2DSpec.cxx.

◆ setFutureBufferAddress()

template<typename DataT >
void Spline2DContainer::setFutureBufferAddress ( char futureFlatBufferPtr)

See FlatObject for description

Definition at line 77 of file Spline2DSpec.cxx.

◆ setXrange()

template<typename DataT >
mGridX2 o2::gpu::Spline2DContainer< DataT >::setXrange ( x2Min  ,
x2Max   
)

◆ test()

template<typename DataT >
int32_t Spline2DContainer::test ( const bool  draw = 0,
const bool  drawDataPoints = 1 
)
static

_______________ Test tools _______________

Test the class functionality

Definition at line 234 of file Spline2DSpec.cxx.

◆ writeToFile()

template<typename DataT >
int32_t Spline2DContainer::writeToFile ( TFile &  outf,
const char name 
)

_______________ IO ________________________

write a class object to the file

write a class object to the file

Definition at line 219 of file Spline2DSpec.cxx.

Member Data Documentation

◆ const [1/2]

template<typename DataT >
int32_t int32_t& u2 o2::gpu::Spline2DContainer< DataT >::const
Initial value:
{
u1 = mGridX1.getKnot(iKnot % mGridX1.getNumberOfKnots()).getU()
Spline1D< DataT > mGridX1
grid for U axis

Definition at line 119 of file Spline2DSpec.h.

◆ const [2/2]

template<typename DataT >
int32_t iKnotX2 o2::gpu::Spline2DContainer< DataT >::const
Initial value:
{
return mGridX1.getNumberOfKnots() * iKnotX2 + iKnotX1

Definition at line 126 of file Spline2DSpec.h.

◆ mGridX1

template<typename DataT >
Spline1D<DataT> o2::gpu::Spline2DContainer< DataT >::mGridX1
protected

grid for U axis

Definition at line 195 of file Spline2DSpec.h.

◆ mGridX2

template<typename DataT >
Spline1D<DataT> o2::gpu::Spline2DContainer< DataT >::mGridX2
protected

grid for V axis

Definition at line 196 of file Spline2DSpec.h.

◆ mParameters

template<typename DataT >
DataT* o2::gpu::Spline2DContainer< DataT >::mParameters = nullptr
protected

Definition at line 197 of file Spline2DSpec.h.

◆ mYdim

template<typename DataT >
int32_t o2::gpu::Spline2DContainer< DataT >::mYdim = 0
protected

_____________ Data members ____________

dimentionality of F

Definition at line 194 of file Spline2DSpec.h.

◆ u1

template<typename DataT >
int32_t& o2::gpu::Spline2DContainer< DataT >::u1

Definition at line 119 of file Spline2DSpec.h.

◆ u2

template<typename DataT >
o2::gpu::Spline2DContainer< DataT >::u2 = mGridX2.getKnot(iKnot / mGridX1.getNumberOfKnots()).getU()

Definition at line 122 of file Spline2DSpec.h.

◆ x1Max

template<typename DataT >
DataT o2::gpu::Spline2DContainer< DataT >::x1Max

Definition at line 146 of file Spline2DSpec.h.

◆ x2Max

template<typename DataT >
DataT DataT DataT o2::gpu::Spline2DContainer< DataT >::x2Max
Initial value:
{
mGridX1.setXrange(x1Min, x1Max)

Definition at line 146 of file Spline2DSpec.h.

◆ x2Min

template<typename DataT >
DataT DataT o2::gpu::Spline2DContainer< DataT >::x2Min

Definition at line 146 of file Spline2DSpec.h.


The documentation for this class was generated from the following files: