Project
Loading...
Searching...
No Matches
o2::tpc::CalibdEdxTrackTopologySpline Class Reference

#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.
 
CalibdEdxTrackTopologySplineoperator= (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)
 
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 CalibdEdxTrackTopologySplinereadFromFile (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 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

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

- 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 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.

Member Typedef Documentation

◆ SplineType

Constructor & Destructor Documentation

◆ CalibdEdxTrackTopologySpline() [1/3]

o2::tpc::CalibdEdxTrackTopologySpline::CalibdEdxTrackTopologySpline ( )
default

_____________ Constructors / destructors __________________________

Default constructor

◆ CalibdEdxTrackTopologySpline() [2/3]

CalibdEdxTrackTopologySpline::CalibdEdxTrackTopologySpline ( const char dEdxSplinesFile,
const char name = "CalibdEdxTrackTopologySpline" 
)

constructor with initialization of the splines from file

Parameters
dEdxSplinesFilepath to root file containing the splines

Definition at line 26 of file CalibdEdxTrackTopologySpline.cxx.

◆ CalibdEdxTrackTopologySpline() [3/3]

CalibdEdxTrackTopologySpline::CalibdEdxTrackTopologySpline ( const CalibdEdxTrackTopologySpline obj)

Copy constructor.

Copy constructor

Definition at line 34 of file CalibdEdxTrackTopologySpline.cxx.

◆ ~CalibdEdxTrackTopologySpline()

o2::tpc::CalibdEdxTrackTopologySpline::~CalibdEdxTrackTopologySpline ( )
default

Destructor.

Member Function Documentation

◆ cloneFromObject()

void CalibdEdxTrackTopologySpline::cloneFromObject ( const CalibdEdxTrackTopologySpline obj,
char newFlatBufferPtr 
)

See FlatObject for description

Definition at line 79 of file CalibdEdxTrackTopologySpline.cxx.

◆ destroy()

void CalibdEdxTrackTopologySpline::destroy ( )

See FlatObject for description

Definition at line 114 of file CalibdEdxTrackTopologySpline.cxx.

◆ getBufferAlignmentBytes()

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()

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.

◆ getSplineName()

std::string CalibdEdxTrackTopologySpline::getSplineName ( const int32_t  region,
const ChargeType  charge 
)
static
Returns
returns the name of the spline object which are read in in the setSplinesFromFile() function
Parameters
regionregion of the TPC
chargecorrection for maximum or total charge

Definition at line 245 of file CalibdEdxTrackTopologySpline.cxx.

◆ GPUd() [1/11]

o2::tpc::CalibdEdxTrackTopologySpline::GPUd ( ) const
Returns
returns the track topology correction
Parameters
regionregion of the TPC
chargecorrection for maximum or total charge
tanThetalocal dip angle: z angle - dz/dx
sinPhitrack parameter sinphi
zdrift length

◆ GPUd() [2/11]

o2::tpc::CalibdEdxTrackTopologySpline::GPUd ( ) const
Returns
returns the track topology correction
Parameters
regionregion of the TPC
chargecorrection for maximum or total charge
xcoordinates where the correction is evaluated

◆ GPUd() [3/11]

o2::tpc::CalibdEdxTrackTopologySpline::GPUd ( ) const
inline

returns the maximum SinPhi for which the splines are valid

Definition at line 154 of file CalibdEdxTrackTopologySpline.h.

◆ GPUd() [4/11]

o2::tpc::CalibdEdxTrackTopologySpline::GPUd ( ) const
inline

returns the maximum TanTheta for which the splines are valid

Definition at line 151 of file CalibdEdxTrackTopologySpline.h.

◆ GPUd() [5/11]

o2::tpc::CalibdEdxTrackTopologySpline::GPUd ( ) const
inline
Returns
returns the the scaling factors for the splines for qMax
Parameters
regionregion of the scaling factor

Definition at line 162 of file CalibdEdxTrackTopologySpline.h.

◆ GPUd() [6/11]

o2::tpc::CalibdEdxTrackTopologySpline::GPUd ( ) const
inline
Returns
returns the the scaling factors for the splines for qTot
Parameters
regionregion of the scaling factor

Definition at line 158 of file CalibdEdxTrackTopologySpline.h.

◆ GPUd() [7/11]

o2::tpc::CalibdEdxTrackTopologySpline::GPUd ( ) const
Parameters
regionindex of the spline (region)
tanThetalocal dip angle: z angle - dz/dx
sinPhitrack parameter sinphi
zdrift length
Returns
returns the spline (correction) value for qMax

◆ GPUd() [8/11]

o2::tpc::CalibdEdxTrackTopologySpline::GPUd ( ) const
Parameters
regionindex of the spline (region)
tanThetalocal dip angle: z angle - dz/dx
sinPhitrack parameter sinphi
zdrift length
Returns
returns the spline (correction) value for qMax

◆ GPUd() [9/11]

o2::tpc::CalibdEdxTrackTopologySpline::GPUd ( ) const &
inline
Parameters
regionindex of the spline (region)
Returns
returns the spline for qMax

Definition at line 202 of file CalibdEdxTrackTopologySpline.h.

◆ GPUd() [10/11]

o2::tpc::CalibdEdxTrackTopologySpline::GPUd ( ) const &
inline
Parameters
regionindex of the spline (region)
Returns
returns the spline for qTot

Definition at line 206 of file CalibdEdxTrackTopologySpline.h.

◆ GPUd() [11/11]

o2::tpc::CalibdEdxTrackTopologySpline::GPUd ( ) const
inline

returns the number of splines stored in the calibration object

Definition at line 148 of file CalibdEdxTrackTopologySpline.h.

◆ interpolate() [1/2]

return mScalingFactorsqMax *[region] mCalibSplinesqMax[region] o2::tpc::CalibdEdxTrackTopologySpline::interpolate ( x  )

◆ interpolate() [2/2]

return mScalingFactorsqTot *[region] mCalibSplinesqTot[region] o2::tpc::CalibdEdxTrackTopologySpline::interpolate ( x  )

◆ moveBufferTo()

void CalibdEdxTrackTopologySpline::moveBufferTo ( char newBufferPtr)

See FlatObject for description

Definition at line 104 of file CalibdEdxTrackTopologySpline.cxx.

◆ operator=()

CalibdEdxTrackTopologySpline & CalibdEdxTrackTopologySpline::operator= ( const CalibdEdxTrackTopologySpline obj)

Assignment operator.

Assignment operator

Definition at line 41 of file CalibdEdxTrackTopologySpline.cxx.

◆ readFromFile()

CalibdEdxTrackTopologySpline * CalibdEdxTrackTopologySpline::readFromFile ( TFile &  inpf,
const char name 
)
static

read a class object from the file

read a class object from the file

Definition at line 159 of file CalibdEdxTrackTopologySpline.cxx.

◆ recreate()

void CalibdEdxTrackTopologySpline::recreate ( const int32_t  nKnots[])

Default constructor

Definition at line 48 of file CalibdEdxTrackTopologySpline.cxx.

◆ releaseInternalBuffer()

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

_____________ Methods for making the data buffer external __________________________

Definition at line 220 of file FlatObject.h.

◆ setActualBufferAddress()

void CalibdEdxTrackTopologySpline::setActualBufferAddress ( char actualFlatBufferPtr)

See FlatObject for description

Definition at line 124 of file CalibdEdxTrackTopologySpline.cxx.

◆ setDefaultSplines()

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.

◆ setFromFile()

void CalibdEdxTrackTopologySpline::setFromFile ( TFile &  inpf,
const char name 
)

set a class object from the file

Parameters
inpfinput file containing the object which was stored using writeTofile
namename of the object

Definition at line 166 of file CalibdEdxTrackTopologySpline.cxx.

◆ setFutureBufferAddress()

void CalibdEdxTrackTopologySpline::setFutureBufferAddress ( char futureFlatBufferPtr)

See FlatObject for description

Definition at line 142 of file CalibdEdxTrackTopologySpline.cxx.

◆ setMaxSinPhi()

void o2::tpc::CalibdEdxTrackTopologySpline::setMaxSinPhi ( const float  maxSinPhi)
inline

set the maximum sinPhi for which the splines are valid

Parameters
maxSinPhimaximum sinPhi

Definition at line 144 of file CalibdEdxTrackTopologySpline.h.

◆ setMaxTanTheta()

void o2::tpc::CalibdEdxTrackTopologySpline::setMaxTanTheta ( const float  maxTanTheta)
inline

set the maximum tanTheta for which the splines are valid

Parameters
maxTanThetamaximum tanTheta

Definition at line 140 of file CalibdEdxTrackTopologySpline.h.

◆ setRangesFromFile()

void CalibdEdxTrackTopologySpline::setRangesFromFile ( TFile &  inpf)
inline

sets maximum TanTheta and maximum snp from file

Definition at line 229 of file CalibdEdxTrackTopologySpline.cxx.

◆ setScalingFactorqMax()

void o2::tpc::CalibdEdxTrackTopologySpline::setScalingFactorqMax ( const float  factor,
const int32_t  region 
)
inline

set the the scaling factors for the splines for qMax

Parameters
factorscaling factor
regionregion of the scaling factor

Definition at line 136 of file CalibdEdxTrackTopologySpline.h.

◆ setScalingFactorqTot()

void o2::tpc::CalibdEdxTrackTopologySpline::setScalingFactorqTot ( const float  factor,
const int32_t  region 
)
inline

set the the scaling factors for the splines for qTot

Parameters
factorscaling factor
regionregion of the scaling factor

Definition at line 131 of file CalibdEdxTrackTopologySpline.h.

◆ setSplinesFromFile()

void o2::tpc::CalibdEdxTrackTopologySpline::setSplinesFromFile ( TFile &  inpf)
inline

sets the splines from an input file


Definition at line 242 of file CalibdEdxTrackTopologySpline.h.

◆ writeToFile()

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.

Member Data Documentation

◆ charge

const ChargeType o2::tpc::CalibdEdxTrackTopologySpline::charge

Definition at line 192 of file CalibdEdxTrackTopologySpline.h.

◆ const [1/3]

const float const float const float z o2::tpc::CalibdEdxTrackTopologySpline::const
Initial value:
{
const float x[FDimX] = {z, tanTheta, sinPhi}
GLint GLenum GLint x
Definition glcorearb.h:403
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843

Definition at line 169 of file CalibdEdxTrackTopologySpline.h.

◆ const [2/3]

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 [3/3]

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.

◆ sinPhi [1/2]

const float const float o2::tpc::CalibdEdxTrackTopologySpline::sinPhi

Definition at line 169 of file CalibdEdxTrackTopologySpline.h.

◆ sinPhi [2/2]

const ChargeType const float const float o2::tpc::CalibdEdxTrackTopologySpline::sinPhi

Definition at line 192 of file CalibdEdxTrackTopologySpline.h.

◆ tanTheta [1/2]

const float o2::tpc::CalibdEdxTrackTopologySpline::tanTheta

Definition at line 169 of file CalibdEdxTrackTopologySpline.h.

◆ tanTheta [2/2]

const ChargeType const float o2::tpc::CalibdEdxTrackTopologySpline::tanTheta

Definition at line 192 of file CalibdEdxTrackTopologySpline.h.


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