17#ifndef ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_TPCFASTTRANSFORMGEO_H
18#define ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_TPCFASTTRANSFORMGEO_H
23#ifndef GPUCA_GPUCODE_DEVICE
60#ifndef GPUCA_GPUCODE_DEVICE
61 GPUd()
std::
array<
float, 2> getYrange()
const {
return {getYmin(), getYmax()}; }
65 GPUdi() float getYwidth()
const {
return -2.f *
yMin; }
95 void setTPCrow(int32_t iRow,
float x, int32_t nPads,
float padWidth);
106 bool isConstructed()
const {
return (mConstructionMask == (uint32_t)ConstructionState::Constructed); }
117 GPUdi() int32_t getNumberOfRows()
const {
return mNumberOfRows; }
129 GPUdi()
float getTPCzLength()
const {
return mTPCzLength; }
132#ifndef GPUCA_GPUCODE_DEVICE
136 if (sector < NumberOfSectorsA) {
137 return {0.f, mTPCzLength};
139 return {-mTPCzLength, 0.f};
143 GPUd() float getZmin(int32_t sector)
const;
161 GPUd()
float convZtoDriftLength(int32_t sector,
float z)
const;
164 GPUd()
void convLocalToPadDriftLength(int32_t sector, int32_t
row,
float y,
float z,
float&
pad,
float& l)
const;
178 static constexpr int32_t NumberOfSectors =
o2::tpc::constants::MAXSECTOR;
179 static constexpr int32_t NumberOfSectorsA = NumberOfSectors / 2;
180 static constexpr int32_t MaxNumberOfRows = 160;
185 enum ConstructionState : uint32_t {
186 NotConstructed = 0x0,
192 uint32_t mConstructionMask = ConstructionState::NotConstructed;
196 int32_t mNumberOfRows = 0;
197 float mTPCzLength = 0.f;
199 SectorInfo mSectorInfos[NumberOfSectors + 1];
200 RowInfo mRowInfos[MaxNumberOfRows + 1];
217 if (sector < 0 || sector >= NumberOfSectors) {
218 sector = NumberOfSectors;
220 return mSectorInfos[sector];
223GPUdi() const TPCFastTransformGeo::RowInfo& TPCFastTransformGeo::getRowInfo(int32_t
row)
const
226 if (row < 0 || row >= mNumberOfRows) {
227 row = MaxNumberOfRows;
229 return mRowInfos[
row];
232GPUdi()
void TPCFastTransformGeo::convLocalToGlobal(int32_t sector,
float lx,
float ly,
float lz,
float& gx,
float& gy,
float& gz)
const
235 const SectorInfo& sectorInfo = getSectorInfo(sector);
236 gx = lx * sectorInfo.cosAlpha - ly * sectorInfo.sinAlpha;
237 gy = lx * sectorInfo.sinAlpha + ly * sectorInfo.cosAlpha;
241GPUdi()
void TPCFastTransformGeo::convGlobalToLocal(int32_t sector,
float gx,
float gy,
float gz,
float& lx,
float& ly,
float& lz)
const
244 const SectorInfo& sectorInfo = getSectorInfo(sector);
245 lx = gx * sectorInfo.cosAlpha + gy * sectorInfo.sinAlpha;
246 ly = -gx * sectorInfo.sinAlpha + gy * sectorInfo.cosAlpha;
250GPUdi()
void TPCFastTransformGeo::convPadDriftLengthToLocal(int32_t sector, int32_t
row,
float pad,
float driftLength,
float&
y,
float&
z)
const
253 const RowInfo& rowInfo = getRowInfo(
row);
254 float u = (pad - 0.5f * rowInfo.maxPad) * rowInfo.padWidth;
255 if (sector < NumberOfSectorsA) {
257 z = mTPCzLength - driftLength;
260 z = driftLength - mTPCzLength;
264GPUdi() float TPCFastTransformGeo::convDriftLengthToZ(int32_t sector,
float driftLength)
const
267 return (sector < NumberOfSectorsA) ? (mTPCzLength - driftLength) : (driftLength - mTPCzLength);
270GPUdi() float TPCFastTransformGeo::convZtoDriftLength(int32_t sector,
float z)
const
273 return (sector < NumberOfSectorsA) ? (mTPCzLength -
z) : (
z + mTPCzLength);
276GPUdi() float TPCFastTransformGeo::getZmin(int32_t sector)
const
279 if (sector < NumberOfSectorsA) {
286GPUdi() float TPCFastTransformGeo::getZmax(int32_t sector)
const
289 if (sector < NumberOfSectorsA) {
296GPUdi()
void TPCFastTransformGeo::convLocalToPadDriftLength(int32_t sector, int32_t
row,
float y,
float z,
float& pad,
float& l)
const
300 if (sector < NumberOfSectorsA) {
307 const TPCFastTransformGeo::RowInfo& rowInfo = getRowInfo(
row);
308 pad = u / rowInfo.padWidth + 0.5f * rowInfo.maxPad;
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLdouble GLdouble GLdouble z
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
FIXME: do not use data model tables.