![]() |
Project
|
#include <Spline1DSpec.h>
Inherits o2::gpu::FlatObject.
Inherited by o2::gpu::Spline1DSpec< DataT, YdimT, 0 >.
Classes | |
struct | Knot |
Public Types | |
enum | SafetyLevel { kNotSafe , kSafe } |
Named enumeration for the safety level used by some methods. More... | |
Public Member Functions | |
GPUd () static const expr int32_t getVersion() | |
_____________ Version control __________________________ | |
Spline1DContainer ()=default | |
_____________ C++ constructors / destructors __________________________ | |
Spline1DContainer (const Spline1DContainer &)=delete | |
Disable all other constructors. | |
~Spline1DContainer ()=default | |
Destructor. | |
void | approximateFunction (double xMin, double xMax, std::function< void(double x, double f[])> F, int32_t nAuxiliaryDataPoints=4) |
_______________ Construction interface ________________________ | |
int32_t | writeToFile (TFile &outf, const char *name) |
_______________ IO ________________________ | |
GPUd () int32_t getUmax() const | |
_______________ Getters ________________________ | |
GPUd () int32_t getYdimensions() const | |
Get number of Y dimensions. | |
GPUd () size_t getParameterAlignmentBytes() const | |
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 Knot *getKnots() const | |
Get the array of knots. | |
template<SafetyLevel SafeT = SafetyLevel::kSafe> | |
GPUd () const Knot &getKnot(int32_t i) const | |
Get i-th knot. | |
template<SafetyLevel SafeT = SafetyLevel::kSafe> | |
GPUd () int32_t getLeftKnotIndexForU(DataT u) const | |
Get index of an associated knot for a given U coordinate. Performs a boundary check. | |
GPUd () DataT *getParameters() | |
Get spline parameters. | |
GPUd () const DataT *getParameters() const | |
Get spline parameters const. | |
GPUd () const int32_t *getUtoKnotMap() const | |
_______________ Technical stuff ________________________ | |
GPUd () DataT convXtoU(DataT x) const | |
Convert X coordinate to U. | |
GPUd () DataT convUtoX(DataT u) const | |
Convert U coordinate to X. | |
GPUd () DataT getXmin() const | |
Get Xmin. | |
GPUd () DataT getXmax() const | |
Get Xmax. | |
GPUd () DataT getXtoUscale() const | |
Get XtoUscale. | |
GPUd () void setXrange(DataT xMin | |
Set X range. | |
void | print () const |
Print method. | |
GPUd () int32_t calcNumberOfParameters(int32_t nYdim) const | |
_______________ Expert tools _______________ | |
void | cloneFromObject (const Spline1DContainer &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 Spline1DContainer * | 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 | |
DataT | xMax |
Protected Member Functions | |
Knot * | getKnots () |
Non-const accessor to the knots array. | |
int32_t * | getUtoKnotMap () |
Non-const accessor to U->knots map. | |
void | recreate (int32_t nYdim, int32_t numberOfKnots) |
Constructor for a regular spline. | |
void | recreate (int32_t nYdim, int32_t numberOfKnots, const int32_t knotU[]) |
Constructor for an irregular spline. | |
ClassDefNV (Spline1DContainer, 1) | |
(transient!!) pointer to F-dependent parameters inside the mFlatBufferPtr array | |
![]() | |
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 ____________ | |
int32_t | mNumberOfKnots = 0 |
n knots on the grid | |
int32_t | mUmax = 0 |
U of the last knot. | |
DataT | mXmin = 0 |
X of the first knot. | |
DataT | mXtoUscale = 0 |
a scaling factor to convert X to U | |
int32_t * | mUtoKnotMap = nullptr |
DataT * | mParameters = nullptr |
(transient!!) pointer to (integer U -> knot index) map inside the mFlatBufferPtr array | |
![]() | |
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 Spline1DContainer is a base class of Spline1D. 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 Spline1DSpec.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 Spline1DSpec.cxx file
Definition at line 45 of file Spline1DSpec.h.
enum o2::gpu::Spline1DContainer::SafetyLevel |
Named enumeration for the safety level used by some methods.
Enumerator | |
---|---|
kNotSafe | |
kSafe |
Definition at line 49 of file Spline1DSpec.h.
|
default |
_____________ C++ constructors / destructors __________________________
Default constructor, required by the Root IO
|
delete |
Disable all other constructors.
|
default |
Destructor.
void Spline1DContainer::approximateFunction | ( | double | xMin, |
double | xMax, | ||
std::function< void(double x, double f[])> | F, | ||
int32_t | nAuxiliaryDataPoints = 4 |
||
) |
_______________ Construction interface ________________________
approximate a function F with this spline
approximate a function F with this spline
Definition at line 166 of file Spline1DSpec.cxx.
|
protected |
(transient!!) pointer to F-dependent parameters inside the mFlatBufferPtr array
void Spline1DContainer::cloneFromObject | ( | const Spline1DContainer< DataT > & | obj, |
char * | newFlatBufferPtr | ||
) |
See FlatObject for description
Definition at line 196 of file Spline1DSpec.cxx.
void Spline1DContainer::destroy | ( | ) |
See FlatObject for description
Definition at line 224 of file Spline1DSpec.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.
|
inlineprotected |
Non-const accessor to the knots array.
Definition at line 199 of file Spline1DSpec.h.
|
inlineprotected |
Non-const accessor to U->knots map.
Definition at line 202 of file Spline1DSpec.h.
|
inline |
Get spline parameters const.
Definition at line 141 of file Spline1DSpec.h.
|
inline |
_______________ Technical stuff ________________________
Get a map (integer U -> corresponding knot index)
Definition at line 146 of file Spline1DSpec.h.
|
inline |
Get i-th knot.
Definition at line 125 of file Spline1DSpec.h.
|
inline |
Get the array of knots.
Definition at line 121 of file Spline1DSpec.h.
|
inline |
Get spline parameters.
Definition at line 138 of file Spline1DSpec.h.
|
inline |
Convert U coordinate to X.
Definition at line 152 of file Spline1DSpec.h.
|
inline |
Convert X coordinate to U.
Definition at line 149 of file Spline1DSpec.h.
|
inline |
Get Xmax.
Definition at line 158 of file Spline1DSpec.h.
|
inline |
Get Xmin.
Definition at line 155 of file Spline1DSpec.h.
|
inline |
Get XtoUscale.
Definition at line 161 of file Spline1DSpec.h.
|
inline |
_______________ Expert tools _______________
Number of parameters for given Y dimensions
Definition at line 172 of file Spline1DSpec.h.
o2::gpu::Spline1DContainer< DataT >::GPUd | ( | ) | const |
Get index of an associated knot for a given U coordinate. Performs a boundary check.
|
inline |
Get a number of knots.
Definition at line 118 of file Spline1DSpec.h.
|
inline |
Number of parameters.
Definition at line 112 of file Spline1DSpec.h.
|
inline |
_______________ Getters ________________________
Get U coordinate of the last knot
Definition at line 99 of file Spline1DSpec.h.
|
inline |
Get number of Y dimensions.
Definition at line 102 of file Spline1DSpec.h.
|
inline |
Get minimal required alignment for the spline parameters.
Definition at line 105 of file Spline1DSpec.h.
|
inline |
Size of the parameter array in bytes.
Definition at line 115 of file Spline1DSpec.h.
|
inline |
_____________ Version control __________________________
Version control
Definition at line 64 of file Spline1DSpec.h.
o2::gpu::Spline1DContainer< DataT >::GPUd | ( | ) |
Set X range.
See FlatObject for description
Definition at line 212 of file Spline1DSpec.cxx.
void Spline1DContainer::print | ( | ) | const |
Print method.
Definition at line 150 of file Spline1DSpec.cxx.
|
static |
read a class object from the file
read a class object from the file
Definition at line 184 of file Spline1DSpec.cxx.
|
protected |
Constructor for a regular spline.
Constructor for a regular spline
numberOfKnots | Number of knots |
Definition at line 38 of file Spline1DSpec.cxx.
|
protected |
Constructor for an irregular spline.
Main constructor for an irregular spline
Number of created knots may differ from the input values:
numberOfKnots | Number of knots in knots[] array |
knots | Array of relative knot positions (integer values) |
Definition at line 55 of file Spline1DSpec.cxx.
|
inline |
_____________ Methods for making the data buffer external __________________________
Definition at line 220 of file FlatObject.h.
See FlatObject for description
Definition at line 238 of file Spline1DSpec.cxx.
See FlatObject for description
Definition at line 254 of file Spline1DSpec.cxx.
|
static |
_______________ Test tools _______________
Test the class functionality
Definition at line 264 of file Spline1DSpec.cxx.
int32_t Spline1DContainer::writeToFile | ( | TFile & | outf, |
const char * | name | ||
) |
_______________ IO ________________________
write a class object to the file
write a class object to the file
Definition at line 177 of file Spline1DSpec.cxx.
|
protected |
n knots on the grid
Definition at line 215 of file Spline1DSpec.h.
|
protected |
(transient!!) pointer to (integer U -> knot index) map inside the mFlatBufferPtr array
Definition at line 220 of file Spline1DSpec.h.
|
protected |
U of the last knot.
Definition at line 216 of file Spline1DSpec.h.
|
protected |
Definition at line 219 of file Spline1DSpec.h.
|
protected |
X of the first knot.
Definition at line 217 of file Spline1DSpec.h.
|
protected |
a scaling factor to convert X to U
Definition at line 218 of file Spline1DSpec.h.
|
protected |
_____________ Data members ____________
dimentionality of F
Definition at line 214 of file Spline1DSpec.h.
DataT o2::gpu::Spline1DContainer< DataT >::xMax |
Definition at line 164 of file Spline1DSpec.h.