Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
trk.SinPhi() = inTrack->Param().GetSinPhi();
trk.DzDs() = inTrack->Param().GetDzDs();
trk.QPt() = inTrack->Param().GetQPt();
trk.TOffset() = Param().par.continuousTracking ? GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convZOffsetToVertexTime(inTrack->Param().GetZOffset(), Param().continuousMaxTimeBin) : 0;
trk.TOffset() = Param().par.continuousTracking ? GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convZOffsetToVertexTime(sector, inTrack->Param().GetZOffset(), Param().continuousMaxTimeBin) : 0;
const auto tmp = sectorTrack.ClusterTN() > sectorTrack.ClusterT0() ? std::array<float, 2>{sectorTrack.ClusterTN(), sectorTrack.ClusterT0()} : std::array<float, 2>{sectorTrack.ClusterT0(), sectorTrack.ClusterTN()};
trk.ShiftZ(this, sector, tmp[0], tmp[1], inTrack->Param().GetX()); // We do not store the inner / outer cluster X, so we just use the track X instead
sectorTrack.SetX2(0.f);
Expand Down Expand Up @@ -1950,7 +1950,8 @@ GPUd() void GPUTPCGMMerger::MergeLoopersInit(int32_t nBlocks, int32_t nThreads,
const auto& p = trk.GetParam();
const float qptabs = CAMath::Abs(p.GetQPt());
if (trk.OK() && trk.NClusters() && trk.Leg() == 0 && qptabs * Param().qptB5Scaler > 5.f && qptabs * Param().qptB5Scaler <= lowPtThresh) {
const float refz = p.GetZ() + (Param().par.continuousTracking ? GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(p.GetTOffset(), Param().continuousMaxTimeBin) : 0) + (trk.CSide() ? -100 : 100);
const int32_t sector = mClusters[trk.FirstClusterRef() + trk.NClusters() - 1].sector;
const float refz = p.GetZ() + (Param().par.continuousTracking ? GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(sector, p.GetTOffset(), Param().continuousMaxTimeBin) : 0) + (trk.CSide() ? -100 : 100);
float sinA, cosA;
CAMath::SinCos(trk.GetAlpha(), sinA, cosA);
float gx = cosA * p.GetX() - sinA * p.GetY();
Expand Down
6 changes: 3 additions & 3 deletions GPU/GPUTracking/Merger/GPUTPCGMSectorTrack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ GPUd() void GPUTPCGMSectorTrack::Set(const GPUTPCGMMerger* merger, const GPUTPCT
mParam.mSecPhi = 1.f / mParam.mCosPhi;
mAlpha = alpha;
mSector = sector;
mTOffset = merger->Param().par.continuousTracking ? merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convZOffsetToVertexTime(t.GetZOffset(), merger->Param().continuousMaxTimeBin) : 0;
mTOffset = merger->Param().par.continuousTracking ? merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convZOffsetToVertexTime(mSector, t.GetZOffset(), merger->Param().continuousMaxTimeBin) : 0;
mNClusters = sectorTr->NHits();
}

Expand Down Expand Up @@ -323,7 +323,7 @@ GPUd() bool GPUTPCGMSectorTrack::TransportToX(GPUTPCGMMerger* merger, float x, f
b.SetPar(2, ey1);
b.SetPar(3, param.mDzDs);
b.SetPar(4, param.mQPt);
b.SetZOffsetLinear(merger->Param().par.continuousTracking ? merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(mTOffset, merger->Param().continuousMaxTimeBin) : 0);
b.SetZOffsetLinear(merger->Param().par.continuousTracking ? merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(mSector, mTOffset, merger->Param().continuousMaxTimeBin) : 0);

if (!doCov) {
return (1);
Expand Down Expand Up @@ -478,7 +478,7 @@ GPUd() bool GPUTPCGMSectorTrack::TransportToXAlpha(GPUTPCGMMerger* merger, float
b.SetPar(2, ey1);
b.SetPar(3, dzds);
b.SetPar(4, qpt);
b.SetZOffsetLinear(merger->Param().par.continuousTracking ? merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(mTOffset, merger->Param().continuousMaxTimeBin) : 0);
b.SetZOffsetLinear(merger->Param().par.continuousTracking ? merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(mSector, mTOffset, merger->Param().continuousMaxTimeBin) : 0);

b.SetCov(0, c00 + h2 * h2c22 + h4 * h4c44 + 2.f * (h2 * c20ph4c42 + h4 * c40));
b.SetCov(1, c11 + dS * (c31 + n7));
Expand Down
4 changes: 2 additions & 2 deletions GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ GPUd() float GPUTPCGMTrackParam::AttachClusters(const GPUTPCGMMerger* GPUrestric
return -1e6f;
}

const float zOffset = param.par.continuousTracking ? Merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(mTOffset, param.continuousMaxTimeBin) : 0; // TODO: do some validatiomns for the transform conv functions...
const float zOffset = param.par.continuousTracking ? Merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(sector, mTOffset, param.continuousMaxTimeBin) : 0; // TODO: do some validatiomns for the transform conv functions...
const float y0 = row.Grid().YMin();
const float stepY = row.HstepY();
const float z0 = row.Grid().ZMin() - zOffset; // We can use our own ZOffset, since this is only used temporarily anyway
Expand All @@ -522,7 +522,7 @@ GPUd() float GPUTPCGMTrackParam::AttachClusters(const GPUTPCGMMerger* GPUrestric
const float tubeMinSize2 = protect ? param.rec.tpc.tubeProtectMinSize2 : 0.f;
float tubeSigma2 = protect ? param.rec.tpc.tubeProtectSigma2 : param.rec.tpc.tubeRemoveSigma2;
uint32_t pad = CAMath::Float2UIntRn(GPUTPCGeometry::LinearY2Pad(sector, iRow, uncorrectedY));
float time = Merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->InverseTransformInTimeFrame(sector, uncorrectedZ + (param.par.continuousTracking ? Merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(mTOffset, param.continuousMaxTimeBin) : 0), param.continuousMaxTimeBin); // TODO: Simplify this call in TPCFastTransform
float time = Merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->InverseTransformInTimeFrame(sector, uncorrectedZ + (param.par.continuousTracking ? Merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(sector, mTOffset, param.continuousMaxTimeBin) : 0), param.continuousMaxTimeBin); // TODO: Simplify this call in TPCFastTransform
if (iRow < param.rec.tpc.tubeExtraProtectMinRow ||
pad < param.rec.tpc.tubeExtraProtectEdgePads || pad >= (uint32_t)(GPUTPCGeometry::NPads(iRow) - param.rec.tpc.tubeExtraProtectEdgePads) ||
param.GetUnscaledMult(time) / GPUTPCGeometry::Row2X(iRow) > param.rec.tpc.tubeExtraProtectMinOccupancy) {
Expand Down
6 changes: 3 additions & 3 deletions GPU/GPUTracking/display/render/GPUDisplayDraw.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,12 @@ void GPUDisplay::DrawFinal(int32_t iSector, int32_t /*iCol*/, const GPUTPCGMProp
auto cl = mIOPtrs->mergedTrackHits[track->FirstClusterRef() + lastCluster];
const auto& cln = mIOPtrs->clustersNative->clustersLinear[cl.num];
GPUTPCConvertImpl::convert(*mCalib->fastTransform, *mParam, cl.sector, cl.row, cln.getPad(), cln.getTime(), x, y, z);
ZOffset = mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(track->GetParam().GetTOffset(), mParam->continuousMaxTimeBin);
ZOffset = mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(iSector, track->GetParam().GetTOffset(), mParam->continuousMaxTimeBin);
} else {
uint8_t sector, row;
auto cln = track->getCluster(mIOPtrs->outputClusRefsTPCO2, lastCluster, *mIOPtrs->clustersNative, sector, row);
GPUTPCConvertImpl::convert(*mCalib->fastTransform, *mParam, sector, row, cln.getPad(), cln.getTime(), x, y, z);
ZOffset = mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(track->getTime0(), mParam->continuousMaxTimeBin);
ZOffset = mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(sector, track->getTime0(), mParam->continuousMaxTimeBin);
}
} else {
const GPUTPCMCInfo& mc = mIOPtrs->mcInfosTPC[i];
Expand Down Expand Up @@ -593,7 +593,7 @@ void GPUDisplay::DrawFinal(int32_t iSector, int32_t /*iCol*/, const GPUTPCGMProp
#ifdef GPUCA_TPC_GEOMETRY_O2
trkParam.Set(mclocal[0], mclocal[1], mc.z, mclocal[2], mclocal[3], mc.pZ, -charge); // TODO: DR: unclear to me why we need -charge here
if (mParam->par.continuousTracking) {
ZOffset = fabsf(mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(mc.t0, mParam->continuousMaxTimeBin)) * (mc.z < 0 ? -1 : 1);
ZOffset = fabsf(mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(0, mc.t0, mParam->continuousMaxTimeBin)) * (mc.z < 0 ? -1 : 1);
}
#else
if (fabsf(mc.z) > GPUTPCGeometry::TPCLength()) {
Expand Down
6 changes: 3 additions & 3 deletions GPU/GPUTracking/display/render/GPUDisplayImportEvent.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void GPUDisplay::DrawGLScene_updateEventData()
while (mParam->par.continuousTracking && trdTriggerRecord < (int32_t)mIOPtrs->nTRDTriggerRecords - 1 && mIOPtrs->trdTrackletIdxFirst[trdTriggerRecord + 1] <= i) {
trdTriggerRecord++; // This requires to go through the data in order I believe
float trdTime = mIOPtrs->trdTriggerTimes[trdTriggerRecord] * 1e3 / o2::constants::lhc::LHCBunchSpacingNS / o2::tpc::constants::LHCBCPERTIMEBIN;
trdZoffset = fabsf(mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(trdTime, mParam->continuousMaxTimeBin));
trdZoffset = fabsf(mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(0, trdTime, mParam->continuousMaxTimeBin));
}
const auto& sp = mIOPtrs->trdSpacePoints[i];
int32_t iSec = trdGeometry()->GetSector(mIOPtrs->trdTracklets[i].GetDetector());
Expand Down Expand Up @@ -218,7 +218,7 @@ void GPUDisplay::DrawGLScene_updateEventData()
float ZOffset = 0;
if (mParam->par.continuousTracking) {
float tofTime = mIOPtrs->tofClusters[i].getTime() * 1e-3 / o2::constants::lhc::LHCBunchSpacingNS / o2::tpc::constants::LHCBCPERTIMEBIN;
ZOffset = fabsf(mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(tofTime, mParam->continuousMaxTimeBin));
ZOffset = fabsf(mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(0, tofTime, mParam->continuousMaxTimeBin));
ptr->z += ptr->z > 0 ? ZOffset : -ZOffset;
}
if (fabsf(ptr->z) > maxClusterZ) {
Expand Down Expand Up @@ -249,7 +249,7 @@ void GPUDisplay::DrawGLScene_updateEventData()
if (mParam->par.continuousTracking) {
o2::InteractionRecord startIR = o2::InteractionRecord(0, mIOPtrs->settingsTF && mIOPtrs->settingsTF->hasTfStartOrbit ? mIOPtrs->settingsTF->tfStartOrbit : 0);
float itsROFtime = mIOPtrs->itsClusterROF[j].getBCData().differenceInBC(startIR) / (float)o2::tpc::constants::LHCBCPERTIMEBIN;
ZOffset = fabsf(mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(itsROFtime + itsROFhalfLen, mParam->continuousMaxTimeBin));
ZOffset = fabsf(mCalib->fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(0, itsROFtime + itsROFhalfLen, mParam->continuousMaxTimeBin));
}
if (i != mIOPtrs->itsClusterROF[j].getFirstEntry()) {
throw std::runtime_error("Inconsistent ITS data, number of clusters does not match ROF content");
Expand Down
22 changes: 15 additions & 7 deletions GPU/TPCFastTransformation/TPCFastTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class TPCFastTransform : public FlatObject

/// Inverse transformation
GPUd() void InverseTransformInTimeFrame(int32_t sector, int32_t row, float /*x*/, float y, float z, float& pad, float& time, float maxTimeBin) const;
GPUd() float InverseTransformInTimeFrame(int32_t roc, float z, float maxTimeBin) const;
GPUd() float InverseTransformInTimeFrame(int32_t sector, float z, float maxTimeBin) const;

/// Inverse transformation: Transformed Y and Z -> transformed X
GPUd() void InverseTransformYZtoX(int32_t sector, int32_t row, float y, float z, float& x, const TPCFastTransform* ref = nullptr, const TPCFastTransform* ref2 = nullptr, float scale = 0.f, float scale2 = 0.f, int32_t scaleMode = 0) const;
Expand All @@ -220,8 +220,8 @@ class TPCFastTransform : public FlatObject
GPUd() float convDeltaTimeToDeltaZinTimeFrame(int32_t sector, float deltaTime) const;
GPUd() float convDeltaZtoDeltaTimeInTimeFrame(int32_t sector, float deltaZ) const;
GPUd() float convDeltaZtoDeltaTimeInTimeFrameAbs(float deltaZ) const;
GPUd() float convZOffsetToVertexTime(float zOffset, float maxTimeBin) const;
GPUd() float convVertexTimeToZOffset(float vertexTime, float maxTimeBin) const;
GPUd() float convZOffsetToVertexTime(int32_t sector, float zOffset, float maxTimeBin) const;
GPUd() float convVertexTimeToZOffset(int32_t sector, float vertexTime, float maxTimeBin) const;

void setApplyCorrectionOn() { mApplyCorrection = 1; }
void setApplyCorrectionOff() { mApplyCorrection = 0; }
Expand Down Expand Up @@ -364,14 +364,22 @@ GPUdi() void TPCFastTransform::convPadTimeToLocalInTimeFrame(int32_t sector, int

// ----------------------------------------------------------------------

GPUdi() float TPCFastTransform::convZOffsetToVertexTime(float zOffset, float maxTimeBin) const
GPUdi() float TPCFastTransform::convZOffsetToVertexTime(int32_t sector, float zOffset, float maxTimeBin) const
{
return maxTimeBin - (getGeometry().getTPCzLength() + zOffset) / mVdrift;
if (sector < getGeometry().getNumberOfSectorsA()) {
return maxTimeBin - (getGeometry().getTPCzLength() + zOffset) / mVdrift;
} else {
return maxTimeBin - (getGeometry().getTPCzLength() - zOffset) / mVdrift;
}
}

GPUdi() float TPCFastTransform::convVertexTimeToZOffset(float vertexTime, float maxTimeBin) const
GPUdi() float TPCFastTransform::convVertexTimeToZOffset(int32_t sector, float vertexTime, float maxTimeBin) const
{
return (maxTimeBin - vertexTime) * mVdrift - getGeometry().getTPCzLength();
if (sector < getGeometry().getNumberOfSectorsA()) {
return (maxTimeBin - vertexTime) * mVdrift - getGeometry().getTPCzLength();
} else {
return -((maxTimeBin - vertexTime) * mVdrift - getGeometry().getTPCzLength());
}
}

GPUdi() float TPCFastTransform::convDriftLengthToTime(float driftLength, float vertexTime) const
Expand Down