Project
Loading...
Searching...
No Matches
o2::gpu::SemiregularSpline2D3D Class Reference

#include <SemiregularSpline2D3D.h>

Inherits o2::gpu::FlatObject.

Public Member Functions

 SemiregularSpline2D3D ()
 _____________ Constructors / destructors __________________________
 
 SemiregularSpline2D3D (const SemiregularSpline2D3D &)=delete
 Copy constructor: disabled to avoid ambiguity. Use cloneFromObject() instead.
 
SemiregularSpline2D3Doperator= (const SemiregularSpline2D3D &)=delete
 Assignment operator: disabled to avoid ambiguity. Use cloneFromObject() instead.
 
 ~SemiregularSpline2D3D ()=default
 Destructor.
 
void cloneFromObject (const SemiregularSpline2D3D &obj, char *newFlatBufferPtr)
 Construction interface.
 
void destroy ()
 
void moveBufferTo (char *newBufferPtr)
 
void setActualBufferAddress (char *actualFlatBufferPtr)
 Moving the class with its external buffer to another location.
 
void setFutureBufferAddress (char *futureFlatBufferPtr)
 
void construct (const int32_t numberOfRows, const int32_t numbersOfKnots[])
 _______________ Construction interface ________________________
 
template<typename T >
void correctEdges (T *data) const
 _______________ Main functionality ________________________
 
template<typename T >
void getSpline (const T *correctedData, float u, float v, T &x, T &y, T &z) const
 Get interpolated value for f(u,v) using data array correctedData[getNumberOfKnots()] with corrected edges.
 
void getSplineVec (const float *correctedData, float u, float v, float &x, float &y, float &z) const
 
int32_t getNumberOfKnots () const
 Get number total of knots: UxV.
 
int32_t getNumberOfRows () const
 Get number of rows. Always the same as gridV's number of knots.
 
const RegularSpline1DgetGridV () const
 Get 1-D grid for U coordinate.
 
const RegularSpline1DgetGridU (const int32_t i) const
 Get 1-D grid for V coordinate.
 
void getKnotUV (int32_t iKnot, float &u, float &v) const
 Get u,v of i-th knot.
 
size_t getFlatBufferSize () const
 Get size of the mFlatBuffer data.
 
int32_t getDataIndex (int32_t i, int32_t j) const
 Gets the knot index which is the i-th knot in v-space and the j-th knot in u-space.
 
int32_t getDataIndex0 (int32_t i, int32_t j) const
 
int32_t getDataIndexMapOffset () const
 Gets the offset for the data index map inside the flat buffer.
 
const chargetFlatBufferPtr () const
 Get pointer to the flat buffer.
 
const RegularSpline1DgetSplineArray () const
 
const int32_t * getDataIndexMap () const
 
charreleaseInternalBuffer ()
 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 constexpr size_t getClassAlignmentBytes ()
 Get minimal required alignment for the class.
 
static constexpr size_t getBufferAlignmentBytes ()
 Get minimal required alignment for the flat buffer.
 
static constexpr size_t getDataAlignmentBytes ()
 Get minimal required alignment for the spline data.
 
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.
 

Additional Inherited Members

- Protected Types inherited from o2::gpu::FlatObject
enum  ConstructionState : uint32_t { NotConstructed = 0x0 , Constructed = 0x1 , InProgress = 0x2 }
 GPUCA_GPUCODE. More...
 
- 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.
 
- 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.
 
- 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
 

Detailed Description

The SemiregularSpline2D3D class represents twoo-dimensional spline interpolation on a semi-unifom grid.

The class is flat C structure. No virtual methods, no ROOT types are used. It is designed for spline parameterisation of TPC transformation.


The spline interpolates a generic function F:[u,v)->(x,y,z), where u,v belong to [0,1]x[0,1]

It is a variation of IrregularSpline2D3D class, see IrregularSpline2D3D.h for more details.

Important: – The number of knots may change during initialisation – Don't forget to call correctEdges() for the array of F values (see IrregularSpline2D3D.h )

Definition at line 52 of file SemiregularSpline2D3D.h.

Constructor & Destructor Documentation

◆ SemiregularSpline2D3D() [1/2]

o2::gpu::SemiregularSpline2D3D::SemiregularSpline2D3D ( )

_____________ Constructors / destructors __________________________

Default constructor. Creates an empty uninitialised object

Default constructor. Creates an empty uninitialised object

Definition at line 25 of file SemiregularSpline2D3D.cxx.

◆ SemiregularSpline2D3D() [2/2]

o2::gpu::SemiregularSpline2D3D::SemiregularSpline2D3D ( const SemiregularSpline2D3D )
delete

Copy constructor: disabled to avoid ambiguity. Use cloneFromObject() instead.

◆ ~SemiregularSpline2D3D()

o2::gpu::SemiregularSpline2D3D::~SemiregularSpline2D3D ( )
default

Destructor.

Member Function Documentation

◆ cloneFromObject()

void o2::gpu::SemiregularSpline2D3D::cloneFromObject ( const SemiregularSpline2D3D obj,
char newFlatBufferPtr 
)

Construction interface.

See FlatObject for description

Definition at line 56 of file SemiregularSpline2D3D.cxx.

◆ construct()

void o2::gpu::SemiregularSpline2D3D::construct ( const int32_t  numberOfRows,
const int32_t  numbersOfKnots[] 
)

_______________ Construction interface ________________________

Constructor

Constructor

When the number of rows / knots is less than 5 it will be set to 5

Definition at line 99 of file SemiregularSpline2D3D.cxx.

◆ correctEdges()

template<typename T >
void o2::gpu::SemiregularSpline2D3D::correctEdges ( T *  data) const
inline

_______________ Main functionality ________________________

Correction of data values at edge knots.

It is needed for the fast spline mathematics to work correctly. See explanation in IrregularSpline1D.h header

Parameters
dataarray of function values. It has the size of getNumberOfKnots()

Definition at line 230 of file SemiregularSpline2D3D.h.

◆ destroy()

void o2::gpu::SemiregularSpline2D3D::destroy ( )

Definition at line 35 of file SemiregularSpline2D3D.cxx.

◆ getBufferAlignmentBytes() [1/2]

static constexpr size_t o2::gpu::FlatObject::getBufferAlignmentBytes ( )
inlinestaticconstexpr

_____________ FlatObject functionality, see FlatObject class for description ____________

Memory alignment

Definition at line 197 of file FlatObject.h.

◆ getBufferAlignmentBytes() [2/2]

static constexpr size_t o2::gpu::SemiregularSpline2D3D::getBufferAlignmentBytes ( )
inlinestaticconstexpr

Get minimal required alignment for the flat buffer.

Definition at line 148 of file SemiregularSpline2D3D.h.

◆ getClassAlignmentBytes() [1/2]

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.

◆ getClassAlignmentBytes() [2/2]

static constexpr size_t o2::gpu::SemiregularSpline2D3D::getClassAlignmentBytes ( )
inlinestaticconstexpr

Get minimal required alignment for the class.

Definition at line 145 of file SemiregularSpline2D3D.h.

◆ getDataAlignmentBytes()

static constexpr size_t o2::gpu::SemiregularSpline2D3D::getDataAlignmentBytes ( )
inlinestaticconstexpr

Get minimal required alignment for the spline data.

Definition at line 151 of file SemiregularSpline2D3D.h.

◆ getDataIndex()

int32_t o2::gpu::SemiregularSpline2D3D::getDataIndex ( int32_t  u,
int32_t  v 
) const
inline

Gets the knot index which is the i-th knot in v-space and the j-th knot in u-space.

====================================================

Inline implementations of some methods

Definition at line 193 of file SemiregularSpline2D3D.h.

◆ getDataIndex0()

int32_t o2::gpu::SemiregularSpline2D3D::getDataIndex0 ( int32_t  i,
int32_t  j 
) const
inline

Definition at line 198 of file SemiregularSpline2D3D.h.

◆ getDataIndexMap()

const int32_t * o2::gpu::SemiregularSpline2D3D::getDataIndexMap ( ) const
inline

Definition at line 159 of file SemiregularSpline2D3D.h.

◆ getDataIndexMapOffset()

int32_t o2::gpu::SemiregularSpline2D3D::getDataIndexMapOffset ( ) const
inline

Gets the offset for the data index map inside the flat buffer.

Definition at line 139 of file SemiregularSpline2D3D.h.

◆ getFlatBufferPtr()

const char * o2::gpu::SemiregularSpline2D3D::getFlatBufferPtr ( ) const
inline

Get pointer to the flat buffer.

Definition at line 142 of file SemiregularSpline2D3D.h.

◆ getFlatBufferSize()

size_t o2::gpu::SemiregularSpline2D3D::getFlatBufferSize ( ) const
inline

Get size of the mFlatBuffer data.

Definition at line 132 of file SemiregularSpline2D3D.h.

◆ getGridU()

const RegularSpline1D & o2::gpu::SemiregularSpline2D3D::getGridU ( const int32_t  i) const
inline

Get 1-D grid for V coordinate.

Definition at line 126 of file SemiregularSpline2D3D.h.

◆ getGridV()

const RegularSpline1D & o2::gpu::SemiregularSpline2D3D::getGridV ( ) const
inline

Get 1-D grid for U coordinate.

Definition at line 122 of file SemiregularSpline2D3D.h.

◆ getKnotUV()

void o2::gpu::SemiregularSpline2D3D::getKnotUV ( int32_t  iKnot,
float &  u,
float &  v 
) const
inline

Get u,v of i-th knot.

Definition at line 203 of file SemiregularSpline2D3D.h.

◆ getNumberOfKnots()

int32_t o2::gpu::SemiregularSpline2D3D::getNumberOfKnots ( ) const
inline

Get number total of knots: UxV.

Definition at line 116 of file SemiregularSpline2D3D.h.

◆ getNumberOfRows()

int32_t o2::gpu::SemiregularSpline2D3D::getNumberOfRows ( ) const
inline

Get number of rows. Always the same as gridV's number of knots.

Definition at line 119 of file SemiregularSpline2D3D.h.

◆ getSpline()

template<typename T >
void o2::gpu::SemiregularSpline2D3D::getSpline ( const T *  correctedData,
float  u,
float  v,
T &  x,
T &  y,
T &  z 
) const
inline

Get interpolated value for f(u,v) using data array correctedData[getNumberOfKnots()] with corrected edges.

Definition at line 363 of file SemiregularSpline2D3D.h.

◆ getSplineArray()

const RegularSpline1D * o2::gpu::SemiregularSpline2D3D::getSplineArray ( ) const
inline

Definition at line 154 of file SemiregularSpline2D3D.h.

◆ getSplineVec()

void o2::gpu::SemiregularSpline2D3D::getSplineVec ( const float *  correctedData,
float  u,
float  v,
float &  x,
float &  y,
float &  z 
) const
inline

Same as getSpline, but using vectorized calculation.

Parameters
correctedDatashould be at least 128-bit aligned

Definition at line 396 of file SemiregularSpline2D3D.h.

◆ moveBufferTo()

void o2::gpu::SemiregularSpline2D3D::moveBufferTo ( char newBufferPtr)

See FlatObject for description

Definition at line 67 of file SemiregularSpline2D3D.cxx.

◆ operator=()

SemiregularSpline2D3D & o2::gpu::SemiregularSpline2D3D::operator= ( const SemiregularSpline2D3D )
delete

Assignment operator: disabled to avoid ambiguity. Use cloneFromObject() instead.

◆ releaseInternalBuffer()

char * o2::gpu::FlatObject::releaseInternalBuffer ( )
inline

Making the data buffer external.

Definition at line 220 of file FlatObject.h.

◆ setActualBufferAddress()

void o2::gpu::SemiregularSpline2D3D::setActualBufferAddress ( char actualFlatBufferPtr)

Moving the class with its external buffer to another location.

See FlatObject for description

Definition at line 75 of file SemiregularSpline2D3D.cxx.

◆ setFutureBufferAddress()

void o2::gpu::SemiregularSpline2D3D::setFutureBufferAddress ( char futureFlatBufferPtr)

See FlatObject for description

Definition at line 83 of file SemiregularSpline2D3D.cxx.


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