15#ifndef ALICEO2_MATLAYERCYL_H
16#define ALICEO2_MATLAYERCYL_H
18#ifndef GPUCA_GPUCODE_DEVICE
63#ifndef GPUCA_ALIGPUCODE
64 MatLayerCyl(
float rMin,
float rMax,
float zHalfSpan,
float dzMin,
float drphiMin);
66 void initSegmentation(
float rMin,
float rMax,
float zHalfSpan,
int nz,
int nphi);
67 void initSegmentation(
float rMin,
float rMax,
float zHalfSpan,
float dzMin,
float drphiMin);
73 GPUd() float getRMin()
const
75 return o2::gpu::CAMath::Sqrt(getRMin2());
77 GPUd() float getRMax()
const {
return o2::gpu::CAMath::Sqrt(getRMax2()); }
88 GPUd() float getDZ()
const {
return mDZ; }
95#ifndef GPUCA_ALIGPUCODE
98 return mCells[getCellIDPhiBin(iphi,
iz)];
107 int idz =
int((
z - getZMin()) * getDZInv());
108 return idz < getNZBins() ? idz : getNZBins() - 1;
112 GPUd() float getZBinMin(
int id)
const {
return getZMin() +
id * getDZ(); }
115 GPUd() float getZBinMax(
int id)
const {
return getZMin() + (
id + 1) * getDZ(); }
119 GPUd()
int getPhiSliceID(
float phi)
const {
return phiBin2Slice(getPhiBinID(phi)); }
122 GPUd() float getPhiBinMin(
int id)
const {
return id * getDPhi(); }
125 GPUd() float getPhiBinMax(
int id)
const {
return (
id + 1) * getDPhi(); }
131#ifndef GPUCA_ALIGPUCODE
169 GPUd()
int getCellIDPhiBin(
int iphi,
int iz)
const {
return getCellID(phiBin2Slice(iphi),
iz); }
172 GPUd()
int getNCells()
const {
return getNZBins() * getNPhiSlices(); }
177 GPUd()
int getCellID(
int iphi,
int iz)
const {
return iphi * getNZBins() +
iz; }
182 auto idphi =
int(phi * getDPhiInv());
183 return idphi < getNPhiBins() ? idphi : getNPhiBins() - 1;
190 auto slice = phiBin2Slice(phiBin);
191 while (slice == phiBin2Slice((phiBin +=
dir))) {
Definition of FlatObject class.
Declarations for material properties of the cell (voxel)
short mNPhiSlices
actual number of phi slices
MatCell * mCells
cached sin each phi slice
short mNPhiBins
number of phi bins (logical)
GPUd() float getSliceCos(int i) const
void optimizePhiSlices(float maxRelDiff=0.05)
float mRMin2
squared min r
std::size_t estimateFlatBufferSize() const
GPUd() int getNPhiBins() const
GPUd() float getRMax() const
GPUd() float getPhiBinMax(int id) const
float mDZ
Z slice thickness.
static constexpr size_t getClassAlignmentBytes()
Gives minimal alignment in bytes required for the class object.
GPUd() float getSliceSin(int i) const
GPUd() float getDPhi() const
GPUd() int getNPhiSlices() const
GPUd() float getDZInv() const
ClassDefNV(MatLayerCyl, 1)
mat.budget per cell
float mDPhi
phi slice thickness
static constexpr size_t getBufferAlignmentBytes()
Gives minimal alignment in bytes required for the flat buffer.
MatLayerCyl(const MatLayerCyl &src)=delete
GPUd() int getNZBins() const
float * mSliceSin
cached cos each phi slice
GPUd() float getZBinMin(int id) const
void initSegmentation(float rMin, float rMax, float zHalfSpan, int nz, int nphi)
bool cellsDiffer(const MatCell &cellA, const MatCell &cellB, float maxRelDiff) const
float mDZInv
Z slice thickness inverse.
void getMeanRMS(MatCell &mean, MatCell &rms) const
GPUd() int getPhiSliceID(float phi) const
GPUd() float getDPhiInv() const
GPUd() float getZMin() const
GPUd() float getPhiBinMin(int id) const
float * mSliceCos
mapping from analytical phi bin ID to real slice ID
GPUd() int getNCells() const
void flatten(char *newPtr)
GPUd() float getZBinMax(int id) const
GPUd() int getPhiBinID(float phi) const
GPUd() int getCellID(int iphi
GPUd() float getRMax2() const
GPUd() RangeStatus isZOutside(float z) const
GPUd() int phiBin2Slice(int i) const
short mNZBins
number of Z bins
float mRMax2
squared max r
void fixPointers(char *oldPtr, char *newPtr)
static std::size_t estimateFlatBufferSize(int nPhiBins, int nPhiSlices, int nZBins)
GPUd() float getZMax() const
GPUd() MatCell &getCellPhiBin(int iphi
void setFlatPointer(char *ptr)
GPUd() int getZBinID(float z) const
GPUd() float getRMin() const
GPUd() float getDZ() const
GPUd() int getCellIDPhiBin(int iphi
GPUd() const MatCell &getCell(int iphiSlice
float mDPhiInv
phi slice thickness inverse
void populateFromTGeo(int ntrPerCell=10)
bool canMergePhiSlices(int i, int j, float maxRelDiff=0.05, int maxDifferent=1) const
char * mFlatBufferContainer
static size_t alignSize(size_t sizeBytes, size_t alignmentBytes)
_______________ Generic utilities _______________________________________________
GLdouble GLdouble GLdouble z
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...