![]() |
Project
|
#include <CalibdEdxTrackTopologySpline.h>
Inherits o2::gpu::FlatObject.
Public Types | |
typedef o2::gpu::Spline< float, 3, 1 > | SplineType |
Public Member Functions | |
CalibdEdxTrackTopologySpline ()=default | |
_____________ Constructors / destructors __________________________ | |
CalibdEdxTrackTopologySpline (const char *dEdxSplinesFile, const char *name="CalibdEdxTrackTopologySpline") | |
CalibdEdxTrackTopologySpline (const CalibdEdxTrackTopologySpline &) | |
Copy constructor. | |
CalibdEdxTrackTopologySpline & | operator= (const CalibdEdxTrackTopologySpline &) |
Assignment operator. | |
void | recreate (const int32_t nKnots[]) |
~CalibdEdxTrackTopologySpline ()=default | |
Destructor. | |
void | cloneFromObject (const CalibdEdxTrackTopologySpline &obj, char *newFlatBufferPtr) |
void | moveBufferTo (char *newBufferPtr) |
void | destroy () |
void | setActualBufferAddress (char *actualFlatBufferPtr) |
void | setFutureBufferAddress (char *futureFlatBufferPtr) |
void | setSplinesFromFile (TFile &inpf) |
sets the splines from an input file | |
void | setRangesFromFile (TFile &inpf) |
sets maximum TanTheta and maximum snp from file | |
void | setDefaultSplines () |
set default splines: the return value of the splines will be 1 (no correction will be applied) | |
void | setScalingFactorqTot (const float factor, const int32_t region) |
void | setScalingFactorqMax (const float factor, const int32_t region) |
void | setMaxTanTheta (const float maxTanTheta) |
void | setMaxSinPhi (const float maxSinPhi) |
GPUd () uint32_t getFSplines() const | |
returns the number of splines stored in the calibration object | |
GPUd () float getMaxTanTheta() const | |
returns the maximum TanTheta for which the splines are valid | |
GPUd () float getMaxSinPhi() const | |
returns the maximum SinPhi for which the splines are valid | |
GPUd () float getScalingFactorqTot(const int32_t region) const | |
GPUd () float getScalingFactorqMax(const int32_t region) const | |
GPUd () float interpolateqMax(const int32_t region | |
return mScalingFactorsqMax *[region] mCalibSplinesqMax[region] | interpolate (x) |
GPUd () float interpolateqTot(const int32_t region | |
return mScalingFactorsqTot *[region] mCalibSplinesqTot[region] | interpolate (x) |
GPUd () float getCorrection(const int32_t region | |
GPUd () float getCorrection(const int32_t region | |
GPUd () SplineType &getSplineqMax(const int32_t region) | |
GPUd () SplineType &getSplineqTot(const int32_t region) | |
int32_t | writeToFile (TFile &outf, const char *name="CalibdEdxTrackTopologySpline") |
_______________ IO ________________________ | |
void | setFromFile (TFile &inpf, const char *name) |
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 CalibdEdxTrackTopologySpline * | readFromFile (TFile &inpf, const char *name) |
read a class object from the file | |
static std::string | getSplineName (const int32_t region, const ChargeType charge) |
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 | |
const float | tanTheta |
const float const float | sinPhi |
const float const float const float z | const |
const ChargeType | charge |
const ChargeType const float | tanTheta |
const ChargeType const float const float | sinPhi |
const ChargeType const float const float const float z | const { return (charge == ChargeType::Max) ? interpolateqMax(region, tanTheta, sinPhi, z) : interpolateqTot(region, tanTheta, sinPhi, z) |
const ChargeType const float x[] | const { return (charge == ChargeType::Tot) ? mCalibSplinesqTot[region].interpolate(x) : mCalibSplinesqMax[region].interpolate(x) |
Additional Inherited Members | |
![]() | |
enum | ConstructionState : uint32_t { NotConstructed = 0x0 , Constructed = 0x1 , InProgress = 0x2 } |
GPUCA_GPUCODE. More... | |
![]() | |
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. | |
![]() | |
static constexpr size_t | getClassAlignmentBytes () |
_____________ Memory alignment __________________________ | |
static constexpr size_t | getBufferAlignmentBytes () |
Gives minimal alignment in bytes required for the flat buffer. | |
![]() | |
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 |
The dEdxCalibrationSplines class represents the calibration of the dEdx of mostly geometrical effects
The splines which are used to correct the dE/dx for detector effects like different pad sizes and track topologies (local dip angle: z angle - dz/dx and diffusion from electron drift) are created by the Random Forest ML algorithm. The training data is created by the O2 simulation with artificial tracks (no Landau distribution, constant dE/dx, fixed GEM amplification of 2000). For each region and for qMax/qTot an individual spline is created which leads to a total of 20 splines. After applying the correction with the splines the dE/dx for qMax and qTot should be normalized such that the MIP position is roughly equal for both. The absolute return values of the splines is arbitrary (only the relative differences between the values matter)
It is planned to make further topological corrections also with the splines: relative pad and time position of a track, local inclination angle: y angle = dy/dx (improves dE/dx at low momenta) and threshold effects.
Definitions:
angleZ snp2 = mP[2] * mP[2] tgl2 = mP[3] * mP[3] sec2 = 1.f / (1.f - snp2) angleZ = sqrt(tgl2 * sec2)
angleY angleY = sqrt( snp2 * sec2 )
relative pad position relPadPos = COG_Pad - int32_t(COG_Pad + 0.5f); -0.5f<relPadPos<0.5f
relative time position relTimePos = COG_Time - int32_t(COG_Time + 0.5f); -0.5f<relTimePos<0.5f
Definition at line 68 of file CalibdEdxTrackTopologySpline.h.
typedef o2::gpu::Spline<float, 3, 1> o2::tpc::CalibdEdxTrackTopologySpline::SplineType |
Definition at line 71 of file CalibdEdxTrackTopologySpline.h.
|
default |
_____________ Constructors / destructors __________________________
Default constructor
CalibdEdxTrackTopologySpline::CalibdEdxTrackTopologySpline | ( | const char * | dEdxSplinesFile, |
const char * | name = "CalibdEdxTrackTopologySpline" |
||
) |
constructor with initialization of the splines from file
dEdxSplinesFile | path to root file containing the splines |
Definition at line 26 of file CalibdEdxTrackTopologySpline.cxx.
CalibdEdxTrackTopologySpline::CalibdEdxTrackTopologySpline | ( | const CalibdEdxTrackTopologySpline & | obj | ) |
|
default |
Destructor.
void CalibdEdxTrackTopologySpline::cloneFromObject | ( | const CalibdEdxTrackTopologySpline & | obj, |
char * | newFlatBufferPtr | ||
) |
See FlatObject for description
Definition at line 79 of file CalibdEdxTrackTopologySpline.cxx.
void CalibdEdxTrackTopologySpline::destroy | ( | ) |
See FlatObject for description
Definition at line 114 of file CalibdEdxTrackTopologySpline.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.
|
static |
region | region of the TPC |
charge | correction for maximum or total charge |
Definition at line 245 of file CalibdEdxTrackTopologySpline.cxx.
o2::tpc::CalibdEdxTrackTopologySpline::GPUd | ( | ) | const |
region | region of the TPC |
charge | correction for maximum or total charge |
tanTheta | local dip angle: z angle - dz/dx |
sinPhi | track parameter sinphi |
z | drift length |
o2::tpc::CalibdEdxTrackTopologySpline::GPUd | ( | ) | const |
region | region of the TPC |
charge | correction for maximum or total charge |
x | coordinates where the correction is evaluated |
|
inline |
returns the maximum SinPhi for which the splines are valid
Definition at line 154 of file CalibdEdxTrackTopologySpline.h.
|
inline |
returns the maximum TanTheta for which the splines are valid
Definition at line 151 of file CalibdEdxTrackTopologySpline.h.
|
inline |
region | region of the scaling factor |
Definition at line 162 of file CalibdEdxTrackTopologySpline.h.
|
inline |
region | region of the scaling factor |
Definition at line 158 of file CalibdEdxTrackTopologySpline.h.
o2::tpc::CalibdEdxTrackTopologySpline::GPUd | ( | ) | const |
region | index of the spline (region) |
tanTheta | local dip angle: z angle - dz/dx |
sinPhi | track parameter sinphi |
z | drift length |
o2::tpc::CalibdEdxTrackTopologySpline::GPUd | ( | ) | const |
region | index of the spline (region) |
tanTheta | local dip angle: z angle - dz/dx |
sinPhi | track parameter sinphi |
z | drift length |
|
inline |
region | index of the spline (region) |
Definition at line 202 of file CalibdEdxTrackTopologySpline.h.
|
inline |
region | index of the spline (region) |
Definition at line 206 of file CalibdEdxTrackTopologySpline.h.
|
inline |
returns the number of splines stored in the calibration object
Definition at line 148 of file CalibdEdxTrackTopologySpline.h.
return mScalingFactorsqMax *[region] mCalibSplinesqMax[region] o2::tpc::CalibdEdxTrackTopologySpline::interpolate | ( | x | ) |
return mScalingFactorsqTot *[region] mCalibSplinesqTot[region] o2::tpc::CalibdEdxTrackTopologySpline::interpolate | ( | x | ) |
See FlatObject for description
Definition at line 104 of file CalibdEdxTrackTopologySpline.cxx.
CalibdEdxTrackTopologySpline & CalibdEdxTrackTopologySpline::operator= | ( | const CalibdEdxTrackTopologySpline & | obj | ) |
Assignment operator.
Assignment operator
Definition at line 41 of file CalibdEdxTrackTopologySpline.cxx.
|
static |
read a class object from the file
read a class object from the file
Definition at line 159 of file CalibdEdxTrackTopologySpline.cxx.
Default constructor
Definition at line 48 of file CalibdEdxTrackTopologySpline.cxx.
|
inline |
_____________ Methods for making the data buffer external __________________________
Definition at line 220 of file FlatObject.h.
See FlatObject for description
Definition at line 124 of file CalibdEdxTrackTopologySpline.cxx.
void CalibdEdxTrackTopologySpline::setDefaultSplines | ( | ) |
set default splines: the return value of the splines will be 1 (no correction will be applied)
Definition at line 182 of file CalibdEdxTrackTopologySpline.cxx.
set a class object from the file
inpf | input file containing the object which was stored using writeTofile |
name | name of the object |
Definition at line 166 of file CalibdEdxTrackTopologySpline.cxx.
See FlatObject for description
Definition at line 142 of file CalibdEdxTrackTopologySpline.cxx.
set the maximum sinPhi for which the splines are valid
maxSinPhi | maximum sinPhi |
Definition at line 144 of file CalibdEdxTrackTopologySpline.h.
set the maximum tanTheta for which the splines are valid
maxTanTheta | maximum tanTheta |
Definition at line 140 of file CalibdEdxTrackTopologySpline.h.
|
inline |
sets maximum TanTheta and maximum snp from file
Definition at line 229 of file CalibdEdxTrackTopologySpline.cxx.
|
inline |
set the the scaling factors for the splines for qMax
factor | scaling factor |
region | region of the scaling factor |
Definition at line 136 of file CalibdEdxTrackTopologySpline.h.
|
inline |
set the the scaling factors for the splines for qTot
factor | scaling factor |
region | region of the scaling factor |
Definition at line 131 of file CalibdEdxTrackTopologySpline.h.
|
inline |
int32_t CalibdEdxTrackTopologySpline::writeToFile | ( | TFile & | outf, |
const char * | name = "CalibdEdxTrackTopologySpline" |
||
) |
_______________ IO ________________________
write a class object to the file
write a class object to the file
Definition at line 175 of file CalibdEdxTrackTopologySpline.cxx.
const ChargeType o2::tpc::CalibdEdxTrackTopologySpline::charge |
Definition at line 192 of file CalibdEdxTrackTopologySpline.h.
const float const float const float z o2::tpc::CalibdEdxTrackTopologySpline::const |
Definition at line 169 of file CalibdEdxTrackTopologySpline.h.
const ChargeType const float const float const float z o2::tpc::CalibdEdxTrackTopologySpline::const { return (charge == ChargeType::Max) ? interpolateqMax(region, tanTheta, sinPhi, z) : interpolateqTot(region, tanTheta, sinPhi, z) |
Definition at line 192 of file CalibdEdxTrackTopologySpline.h.
const ChargeType const float x [] o2::tpc::CalibdEdxTrackTopologySpline::const { return (charge == ChargeType::Tot) ? mCalibSplinesqTot[region].interpolate(x) : mCalibSplinesqMax[region].interpolate(x) |
Definition at line 198 of file CalibdEdxTrackTopologySpline.h.
Definition at line 169 of file CalibdEdxTrackTopologySpline.h.
const ChargeType const float const float o2::tpc::CalibdEdxTrackTopologySpline::sinPhi |
Definition at line 192 of file CalibdEdxTrackTopologySpline.h.
const float o2::tpc::CalibdEdxTrackTopologySpline::tanTheta |
Definition at line 169 of file CalibdEdxTrackTopologySpline.h.
const ChargeType const float o2::tpc::CalibdEdxTrackTopologySpline::tanTheta |
Definition at line 192 of file CalibdEdxTrackTopologySpline.h.