17#ifndef ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_TPCFASTTRANSFORM_H
18#define ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_TPCFASTTRANSFORM_H
28#if !defined(GPUCA_GPUCODE)
44#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
49 void getCorrections(
const float gx,
const float gy,
const float gz,
const int32_t sector,
float& gdxC,
float& gdyC,
float& gdzC)
const;
120#if !defined(GPUCA_GPUCODE)
123 delete mCorrectionSlow;
188 GPUd()
void Transform(
int32_t sector,
int32_t row,
float pad,
float time,
float&
x,
float&
y,
float&
z,
float vertexTime = 0,
const TPCFastTransform*
ref =
nullptr,
const TPCFastTransform*
ref2 =
nullptr,
float scale = 0.
f,
float scale2 = 0.
f,
int32_t scaleMode = 0)
const;
203 GPUd()
void InverseTransformYZtoNominalYZ(
int32_t sector,
int32_t row,
float y,
float z,
float&
ny,
float&
nz,
const TPCFastTransform*
ref =
nullptr,
const TPCFastTransform*
ref2 =
nullptr,
float scale = 0.
f,
float scale2 = 0.
f,
int32_t scaleMode = 0)
const;
206 GPUd()
void InverseTransformXYZtoNominalXYZ(
int32_t sector,
int32_t row,
float x,
float y,
float z,
float&
nx,
float&
ny,
float&
nz,
const TPCFastTransform*
ref =
nullptr,
const TPCFastTransform*
ref2 =
nullptr,
float scale = 0.
f,
float scale2 = 0.
f,
int32_t scaleMode = 0)
const;
222 GPUd()
float convDeltaZtoDeltaTimeInTimeFrameAbs(
float deltaZ)
const;
255 GPUdi()
bool isIDCSet()
const {
return mIDC != DEFIDC; }
260 GPUdi()
float getCTP2IDCFallBackThreshold()
const {
return mCTP2IDCFallBackThreshold; }
263 GPUdi()
float getLumiScaleFactor()
const {
return mLumiScaleFactor; }
274#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
297 enum ConstructionExtraState :
uint32_t {
298 CalibrationIsSet = 0x4
316 bool mApplyCorrection;
329 float mLumiScaleFactor;
333 float mCTP2IDCFallBackThreshold;
352 getGeometry().convPadDriftLengthToLocal(
sector,
row,
pad, l,
y,
z);
357 float l = getGeometry().getTPCzLength() + (
time - mT0 - maxTimeBin) * mVdrift;
358 getGeometry().convPadDriftLengthToLocal(
sector,
row,
pad, l,
y,
z);
365 if (
sector < getGeometry().getNumberOfSectorsA()) {
366 return maxTimeBin - (getGeometry().getTPCzLength() +
zOffset) / mVdrift;
368 return maxTimeBin - (getGeometry().getTPCzLength() -
zOffset) / mVdrift;
374 if (
sector < getGeometry().getNumberOfSectorsA()) {
375 return (maxTimeBin -
vertexTime) * mVdrift - getGeometry().getTPCzLength();
377 return -((maxTimeBin -
vertexTime) * mVdrift - getGeometry().getTPCzLength());
383 return (mT0 +
vertexTime + driftLength / mVdrift);
391 getGeometry().convLocalToPadDriftLength(
sector,
row,
y,
z,
pad, l);
398 getGeometry().convLocalToPadDriftLength(
sector,
row,
y,
z,
pad, l);
399 time = convDriftLengthToTime(l, maxTimeBin);
408 if (!mApplyCorrection) {
412 float dx = 0.f, dy = 0.f, dz = 0.f;
416 if (mCorrectionSlow) {
418 getGeometry().convLocalToGlobal(
sector,
x,
y,
z, gx, gy, gz);
419 float gdxC, gdyC, gdzC;
421 getGeometry().convGlobalToLocal(
sector, gdxC, gdyC, gdzC, dx, dy, dz);
425 mCorrection.getCorrectionLocal(
sector,
row,
y,
z, dx, dy, dz);
429 ref->mCorrection.getCorrectionLocal(
sector,
row,
y,
z, dx1, dy1, dz1);
432 dz = (dz - dz1) *
scale + dz1;
435 ref->mCorrection.getCorrectionLocal(
sector,
row,
y,
z, dx1, dy1, dz1);
438 dz = dz1 *
scale + dz;
443 ref2->mCorrection.getCorrectionLocal(
sector,
row,
y,
z, dx1, dy1, dz1);
452 float lx =
x, ly =
y, lz =
z;
455 getGeometry().convLocalToGlobal(
sector, lx, ly, lz, gx, gy, gz);
461 float invYZtoXScaled;
465 InverseTransformYZtoX(
sector,
row, lyT, lzT, invYZtoX);
469 InverseTransformYZtoNominalYZ(
sector,
row, lyT, lzT, YZtoNominalY, YZtoNominalZ);
471 float YZtoNominalYScaled;
472 float YZtoNominalZScaled;
473 InverseTransformYZtoNominalYZ(
sector,
row, lyT, lzT, YZtoNominalYScaled, YZtoNominalZScaled,
ref,
ref2,
scale,
scale2,
scaleMode);
475 float dxRef = 0.f, dyRef = 0.f, dzRef = 0.f;
477 ref->mCorrection.getCorrectionLocal(
sector,
row,
y,
z, dxRef, dyRef, dzRef);
480 float dxRef2 = 0.f, dyRef2 = 0.f, dzRef2 = 0.f;
482 ref2->mCorrection.getCorrectionLocal(
sector,
row,
y,
z, dxRef2, dyRef2, dzRef2);
485 float dxOrig, dyOrig, dzOrig;
486 mCorrection.getCorrectionLocal(
sector,
row,
y,
z, dxOrig, dyOrig, dzOrig);
488 o2::utils::DebugStreamer::instance()->getStreamer(
"debug_fasttransform",
"UPDATE") << o2::utils::DebugStreamer::instance()->getUniqueTreeName(
"tree_Transform").data()
490 <<
"dxOrig=" << dxOrig
491 <<
"dyOrig=" << dyOrig
492 <<
"dzOrig=" << dzOrig
496 <<
"dxRef2=" << dxRef2
497 <<
"dyRef2=" << dyRef2
498 <<
"dzRef2=" << dzRef2
519 <<
"invYZtoX=" << invYZtoX
520 <<
"invYZtoXScaled=" << invYZtoXScaled
521 <<
"YZtoNominalY=" << YZtoNominalY
522 <<
"YZtoNominalYScaled=" << YZtoNominalYScaled
523 <<
"YZtoNominalZ=" << YZtoNominalZ
524 <<
"YZtoNominalZScaled=" << YZtoNominalZScaled
540GPUdi()
void TPCFastTransform::Transform(
int32_t sector,
int32_t row,
float pad,
float time,
float&
x,
float&
y,
float&
z,
float vertexTime,
const TPCFastTransform*
ref,
const TPCFastTransform*
ref2,
float scale,
float scale2,
int32_t scaleMode)
const
548 const TPCFastTransformGeo::RowInfo& rowInfo = getGeometry().getRowInfo(
row);
557 float l = (
time - mT0 - maxTimeBin) * mVdrift;
558 z = getGeometry().convDriftLengthToZ(
sector, l);
569 const TPCFastTransformGeo::RowInfo& rowInfo = getGeometry().getRowInfo(
row);
583 InverseTransformInTimeFrame(
sector, 0, 0, 0,
z,
pad,
time, maxTimeBin);
597 z = getGeometry().convDriftLengthToZ(
sector, l);
609 x = getGeometry().getRowInfo(
row).x;
611 getGeometry().convPadDriftLengthToLocal(
sector,
row,
pad, driftLength,
y,
z);
623 float v = (
time - mT0 - maxTimeBin) * mVdrift;
624 float z = (
sector < getGeometry().getNumberOfSectorsA()) ? -
v :
v;
631 float v = (
sector < getGeometry().getNumberOfSectorsA()) ? -
z :
z;
632 return mT0 + maxTimeBin +
v / mVdrift;
637 float deltaZ = deltaTime * mVdrift;
638 return sector < getGeometry().getNumberOfSectorsA() ? -deltaZ : deltaZ;
643 return deltaZ / mVdrift;
648 float deltaT = deltaZ / mVdrift;
649 return sector < getGeometry().getNumberOfSectorsA() ? -deltaT : deltaT;
655 return convDriftLengthToTime(getGeometry().getTPCzLength(), 0.f);
661 return convDriftLengthToTime(getGeometry().getTPCzLength(), 0.f);
667 return convDriftLengthToTime(getGeometry().getTPCzLength(), 0.f);
678 dx = mCorrection.getCorrectionXatRealYZ(
sector,
row, realY, realZ);
681 float dxref =
ref->mCorrection.getCorrectionXatRealYZ(
sector,
row, realY, realZ);
682 dx = (dx - dxref) *
scale + dxref;
684 float dxref =
ref->mCorrection.getCorrectionXatRealYZ(
sector,
row, realY, realZ);
685 dx = dxref *
scale + dx;
689 float dxref =
ref2->mCorrection.getCorrectionXatRealYZ(
sector,
row, realY, realZ);
694 realX = mCorrection.getGeometry().getRowInfo(
row).x + dx;
697 o2::utils::DebugStreamer::instance()->getStreamer(
"debug_fasttransform",
"UPDATE") << o2::utils::DebugStreamer::instance()->getUniqueTreeName(
"tree_InverseTransformYZtoX").data()
708GPUdi()
void TPCFastTransform::InverseTransformYZtoNominalYZ(
int32_t sector,
int32_t row,
float realY,
float realZ,
float& measuredY,
float& measuredZ,
const TPCFastTransform*
ref,
const TPCFastTransform*
ref2,
float scale,
float scale2,
int32_t scaleMode)
const
718 mCorrection.getCorrectionYZatRealYZ(
sector,
row, realY, realZ, dy, dz);
723 ref->mCorrection.getCorrectionYZatRealYZ(
sector,
row, realY, realZ, dy1, dz1);
725 dz = (dz - dz1) *
scale + dz1;
728 ref->mCorrection.getCorrectionYZatRealYZ(
sector,
row, realY, realZ, dy1, dz1);
730 dz = dz1 *
scale + dz;
734 ref2->mCorrection.getCorrectionYZatRealYZ(
sector,
row, realY, realZ, dy1, dz1);
741 measuredY = realY - dy;
742 measuredZ = realZ - dz;
745 o2::utils::DebugStreamer::instance()->getStreamer(
"debug_fasttransform",
"UPDATE") << o2::utils::DebugStreamer::instance()->getUniqueTreeName(
"tree_InverseTransformYZtoNominalYZ").data()
749 <<
"real y=" << realY
750 <<
"real z=" << realZ
751 <<
"measured y=" << measuredY
752 <<
"measured z=" << measuredZ
757GPUdi()
void TPCFastTransform::InverseTransformXYZtoNominalXYZ(
int32_t sector,
int32_t row,
float x,
float y,
float z,
float&
nx,
float&
ny,
float&
nz,
const TPCFastTransform*
ref,
const TPCFastTransform*
ref2,
float scale,
float scale2,
int32_t scaleMode)
const
761 if (row2 >= getGeometry().getNumberOfRows()) {
766 nx1 = getGeometry().getRowInfo(
row).x;
767 nx2 = getGeometry().getRowInfo(row2).x;
768 InverseTransformYZtoNominalYZ(
sector,
row,
y,
z, ny1, nz1,
ref,
ref2,
scale,
scale2,
scaleMode);
769 InverseTransformYZtoNominalYZ(
sector, row2,
y,
z, ny2, nz2,
ref,
ref2,
scale,
scale2,
scaleMode);
770 float c1 = (nx2 -
nx) / (nx2 - nx1);
771 float c2 = (
nx - nx1) / (nx2 - nx1);
773 ny = (ny1 * c1 + ny2 * c2);
774 nz = (nz1 * c1 + nz2 * c2);
Definition of FlatObject class.
#define GPUCA_DEBUG_STREAMER_CHECK(...)
#define GPUCA_RTC_SPECIAL_CODE(...)
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual sector
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char e
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
Definition of TPCFastSpaceChargeCorrection class.
char * releaseInternalBuffer()
_____________ Methods for making the data buffer external __________________________
void destroy()
_______________ Utilities _______________________________________________
void startConstruction()
_____________ Construction _________
static constexpr size_t getBufferAlignmentBytes()
_____________ FlatObject functionality, see FlatObject class for description ____________
static constexpr size_t getClassAlignmentBytes()
GPUCA_GPUCODE.
GLuint const GLchar * name
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
GLdouble GLdouble GLdouble z
Global TPC definitions and constants.
@ streamFastTransform
stream tpc fast transform
simple struct to hold the space charge object which can be used for CPU reconstruction only
~TPCSlowSpaceChargeCorrection()
destructor
ClassDefNV(TPCSlowSpaceChargeCorrection, 2)
void getCorrections(const float gx, const float gy, const float gz, const int32_t sector, float &gdxC, float &gdyC, float &gdzC) const
getting the corrections for global coordinates
o2::tpc::SpaceCharge< float > * mCorr
reference space charge corrections