![]() |
Project
|
#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) |
char * | releaseInternalBuffer () |
_____________ Methods for making the data buffer external __________________________ | |
![]() | |
FlatObject ()=default | |
_____________ Constructors / destructors __________________________ | |
~FlatObject () | |
FlatObject (const FlatObject &)=delete | |
FlatObject & | operator= (const FlatObject &)=delete |
void | destroy () |
_______________ Utilities _______________________________________________ | |
size_t | getFlatBufferSize () const |
Gives size of the flat buffer. | |
const char * | getFlatBufferPtr () 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 Spline2DContainer * | readFromFile (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 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 | |
![]() | |
void | startConstruction () |
_____________ Construction _________ | |
void | finishConstruction (int32_t flatBufferSize) |
void | cloneFromObject (const FlatObject &obj, char *newFlatBufferPtr) |
char * | releaseInternalBuffer () |
_____________ 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 |
![]() | |
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 | |
char * | mFlatBufferContainer = nullptr |
char * | mFlatBufferPtr = nullptr |
Additional Inherited Members | |
![]() | |
enum | ConstructionState : uint32_t { NotConstructed = 0x0 , Constructed = 0x1 , InProgress = 0x2 } |
GPUCA_GPUCODE. More... | |
![]() | |
static constexpr size_t | getClassAlignmentBytes () |
_____________ Memory alignment __________________________ | |
static constexpr size_t | getBufferAlignmentBytes () |
Gives minimal alignment in bytes required for the flat buffer. | |
================================================================================================== 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.
typedef Spline1D<DataT>::Knot o2::gpu::Spline2DContainer< DataT >::Knot |
Definition at line 51 of file Spline2DSpec.h.
typedef Spline1D<DataT>::SafetyLevel o2::gpu::Spline2DContainer< DataT >::SafetyLevel |
Definition at line 50 of file Spline2DSpec.h.
|
default |
_____________ C++ constructors / destructors __________________________
Default constructor
|
delete |
Disable all other constructors.
|
default |
Destructor.
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.
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.
|
protected |
(transient!!) F-dependent parameters of the spline
void Spline2DContainer::cloneFromObject | ( | const Spline2DContainer< DataT > & | obj, |
char * | newFlatBufferPtr | ||
) |
See FlatObject for description
Definition at line 101 of file Spline2DSpec.cxx.
void Spline2DContainer::destroy | ( | ) |
See FlatObject for description
Definition at line 46 of file Spline2DSpec.cxx.
|
inlinestaticconstexpr |
_____________ FlatObject functionality, see FlatObject class for description ____________
Definition at line 197 of file FlatObject.h.
|
inlinestaticconstexpr |
_____________ Memory alignment __________________________
Gives minimal alignment in bytes required for the class object
Definition at line 194 of file FlatObject.h.
|
inline |
Get spline parameters const.
Definition at line 135 of file Spline2DSpec.h.
|
inline |
Get 1-D grid for X1 or X2 coordinate.
Definition at line 116 of file Spline2DSpec.h.
|
inline |
Get 1-D grid for the X1 coordinate.
Definition at line 110 of file Spline2DSpec.h.
|
inline |
Get 1-D grid for the X2 coordinate.
Definition at line 113 of file Spline2DSpec.h.
|
inline |
Get spline parameters.
Definition at line 132 of file Spline2DSpec.h.
|
inline |
_______________ Expert tools _______________
Number of parameters for given Y dimensions
Definition at line 158 of file Spline2DSpec.h.
o2::gpu::Spline2DContainer< DataT >::GPUd | ( | ) |
Get index of a knot (iKnotX1,iKnotX2)
|
inline |
Get a number of knots.
Definition at line 107 of file Spline2DSpec.h.
|
inline |
Number of parameters.
Definition at line 101 of file Spline2DSpec.h.
|
inline |
_______________ Getters ________________________
Get number of Y dimensions
Definition at line 95 of file Spline2DSpec.h.
|
inline |
_______________ Technical stuff ________________________
Get offset of GridX1 flat data in the flat buffer
Definition at line 140 of file Spline2DSpec.h.
|
inline |
Get offset of GridX2 flat data in the flat buffer.
Definition at line 143 of file Spline2DSpec.h.
|
inline |
Size of the parameter array in bytes.
Definition at line 104 of file Spline2DSpec.h.
|
inline |
_____________ Version control __________________________
Version control
Definition at line 56 of file Spline2DSpec.h.
|
inline |
Get minimal required alignment for the spline parameters.
Definition at line 98 of file Spline2DSpec.h.
o2::gpu::Spline2DContainer< DataT >::GPUd | ( | ) |
Get (u1,u2) of i-th knot.
o2::gpu::Spline2DContainer< DataT >::GPUd | ( | ) |
Set X range.
See FlatObject for description
Definition at line 119 of file Spline2DSpec.cxx.
void Spline2DContainer::print | ( | ) | const |
Print method.
Definition at line 89 of file Spline2DSpec.cxx.
|
static |
read a class object from the file
read a class object from the file
Definition at line 226 of file Spline2DSpec.cxx.
|
protected |
Constructor for an irregular spline.
Constructor for an irregular spline
Definition at line 130 of file Spline2DSpec.cxx.
|
protected |
Constructor for a regular spline.
Constructor for a regular spline
Definition at line 162 of file Spline2DSpec.cxx.
|
inline |
_____________ Methods for making the data buffer external __________________________
Definition at line 220 of file FlatObject.h.
void Spline2DContainer::setActualBufferAddress | ( | char * | actualFlatBufferPtr | ) |
See FlatObject for description
Definition at line 57 of file Spline2DSpec.cxx.
void Spline2DContainer::setFutureBufferAddress | ( | char * | futureFlatBufferPtr | ) |
See FlatObject for description
Definition at line 77 of file Spline2DSpec.cxx.
mGridX2 o2::gpu::Spline2DContainer< DataT >::setXrange | ( | x2Min | , |
x2Max | |||
) |
|
static |
_______________ Test tools _______________
Test the class functionality
Definition at line 234 of file Spline2DSpec.cxx.
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.
int32_t int32_t& u2 o2::gpu::Spline2DContainer< DataT >::const |
Definition at line 119 of file Spline2DSpec.h.
int32_t iKnotX2 o2::gpu::Spline2DContainer< DataT >::const |
Definition at line 126 of file Spline2DSpec.h.
|
protected |
grid for U axis
Definition at line 195 of file Spline2DSpec.h.
|
protected |
grid for V axis
Definition at line 196 of file Spline2DSpec.h.
|
protected |
Definition at line 197 of file Spline2DSpec.h.
|
protected |
_____________ Data members ____________
dimentionality of F
Definition at line 194 of file Spline2DSpec.h.
int32_t& o2::gpu::Spline2DContainer< DataT >::u1 |
Definition at line 119 of file Spline2DSpec.h.
o2::gpu::Spline2DContainer< DataT >::u2 = mGridX2.getKnot(iKnot / mGridX1.getNumberOfKnots()).getU() |
Definition at line 122 of file Spline2DSpec.h.
DataT o2::gpu::Spline2DContainer< DataT >::x1Max |
Definition at line 146 of file Spline2DSpec.h.
DataT DataT DataT o2::gpu::Spline2DContainer< DataT >::x2Max |
Definition at line 146 of file Spline2DSpec.h.
DataT DataT o2::gpu::Spline2DContainer< DataT >::x2Min |
Definition at line 146 of file Spline2DSpec.h.