Skip to content

Commit afc71d7

Browse files
cbmswdavidrohr
authored andcommitted
TPCFastTransform: cleanup
1 parent afe593a commit afc71d7

File tree

8 files changed

+16
-48
lines changed

8 files changed

+16
-48
lines changed

Detectors/TPC/reconstruction/src/TPCFastTransformHelperO2.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ std::unique_ptr<TPCFastTransform> TPCFastTransformHelperO2::create(int64_t TimeS
9696
const float t0 = 0.;
9797
const float vDrift = 0.f;
9898
const long int initTimeStamp = -1;
99-
fastTransform.setCalibration1(initTimeStamp, t0, vDrift);
99+
fastTransform.setCalibration(initTimeStamp, t0, vDrift);
100100

101101
fastTransform.finishConstruction();
102102
}
@@ -153,7 +153,7 @@ int TPCFastTransformHelperO2::updateCalibrationImpl(T& fastTransform, int64_t Ti
153153

154154
const double t0 = (driftTimeOffset + elParam.getAverageShapingTime()) / elParam.ZbinWidth;
155155

156-
fastTransform.setCalibration1(TimeStamp, t0, vDrift);
156+
fastTransform.setCalibration(TimeStamp, t0, vDrift);
157157

158158
return 0;
159159
}

GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.cxx

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -126,37 +126,6 @@ void TPCFastSpaceChargeCorrection::moveBufferTo(char* newFlatBufferPtr)
126126
relocateBufferPointers(oldFlatBufferPtr, mFlatBufferPtr);
127127
}
128128

129-
void TPCFastSpaceChargeCorrection::setActualBufferAddressOld(char* actualFlatBufferPtr)
130-
{
131-
/// Sets the actual location of the external flat buffer after it has been moved (e.g. to another maschine)
132-
133-
if (mClassVersion != 4) {
134-
LOG(error) << "TPCFastSpaceChargeCorrection::setActualBufferAddress() called with class version " << mClassVersion << ". This is not supported.";
135-
return;
136-
}
137-
138-
FlatObject::setActualBufferAddress(actualFlatBufferPtr);
139-
140-
size_t scSize = sizeof(SplineType) * mNumberOfScenarios;
141-
142-
mScenarioPtr = reinterpret_cast<SplineType*>(mFlatBufferPtr);
143-
144-
size_t scBufferOffset = alignSize(scSize, SplineType::getBufferAlignmentBytes());
145-
size_t scBufferSize = 0;
146-
147-
for (int32_t i = 0; i < mNumberOfScenarios; i++) {
148-
SplineType& sp = mScenarioPtr[i];
149-
sp.setActualBufferAddress(mFlatBufferPtr + scBufferOffset + scBufferSize);
150-
scBufferSize = alignSize(scBufferSize + sp.getFlatBufferSize(), sp.getBufferAlignmentBytes());
151-
}
152-
size_t bufferSize = scBufferOffset + scBufferSize;
153-
for (int32_t is = 0; is < 3; is++) {
154-
size_t correctionDataOffset = alignSize(bufferSize, SplineType::getParameterAlignmentBytes());
155-
mCorrectionData[is] = reinterpret_cast<char*>(mFlatBufferPtr + correctionDataOffset);
156-
bufferSize = correctionDataOffset + mSectorDataSizeBytes[is] * mGeo.getNumberOfSectors();
157-
}
158-
}
159-
160129
void TPCFastSpaceChargeCorrection::setActualBufferAddress(char* actualFlatBufferPtr)
161130
{
162131
/// Sets the actual location of the external flat buffer after it has been moved (e.g. to another maschine)

GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ class TPCFastSpaceChargeCorrection : public FlatObject
156156

157157
/// Moving the class with its external buffer to another location
158158

159-
void setActualBufferAddressOld(char* actualFlatBufferPtr);
160159
void setActualBufferAddress(char* actualFlatBufferPtr);
161160
void setFutureBufferAddress(char* futureFlatBufferPtr);
162161

GPU/TPCFastTransformation/TPCFastTransform.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void TPCFastTransform::startConstruction(const TPCFastSpaceChargeCorrection& cor
113113
mCorrection.cloneFromObject(correction, nullptr);
114114
}
115115

116-
void TPCFastTransform::setCalibration1(int64_t timeStamp, float t0, float vDrift)
116+
void TPCFastTransform::setCalibration(int64_t timeStamp, float t0, float vDrift)
117117
{
118118
/// Sets all drift calibration parameters and the time stamp
119119
///

GPU/TPCFastTransformation/TPCFastTransform.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class TPCFastTransform : public FlatObject
157157
///
158158
/// It must be called once during construction,
159159
/// but also may be called afterwards to reset these parameters.
160-
void setCalibration1(int64_t timeStamp, float t0, float vDrift);
160+
void setCalibration(int64_t timeStamp, float t0, float vDrift);
161161

162162
/// Set Lumi info
163163
void setLumi(float l) { mLumi = l; }
@@ -553,7 +553,7 @@ GPUdi() void TPCFastTransform::Transform(int32_t sector, int32_t row, float pad,
553553
GPUdi() void TPCFastTransform::TransformInTimeFrame(int32_t sector, float time, float& z, float maxTimeBin) const
554554
{
555555
float l = (time - mT0 - maxTimeBin) * mVdrift; // drift length cm
556-
z = getGeometry().convDriftLengthToZ1(sector, l);
556+
z = getGeometry().convDriftLengthToZ(sector, l);
557557
}
558558

559559
GPUdi() void TPCFastTransform::TransformInTimeFrame(int32_t sector, int32_t row, float pad, float time, float& x, float& y, float& z, float maxTimeBin) const
@@ -592,7 +592,7 @@ GPUdi() void TPCFastTransform::TransformIdealZ(int32_t sector, float time, float
592592
///
593593

594594
float l = (time - mT0 - vertexTime) * mVdrift; // drift length cm
595-
z = getGeometry().convDriftLengthToZ1(sector, l);
595+
z = getGeometry().convDriftLengthToZ(sector, l);
596596
}
597597

598598
GPUdi() void TPCFastTransform::TransformIdeal(int32_t sector, int32_t row, float pad, float time, float& x, float& y, float& z, float vertexTime) const

GPU/TPCFastTransformation/TPCFastTransformGeo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ class TPCFastTransformGeo
155155
GPUd() void convPadDriftLengthToLocal(int32_t sector, int32_t row, float pad, float driftLength, float& y, float& z) const;
156156

157157
/// convert DriftLength -> Local c.s.
158-
GPUd() float convDriftLengthToZ1(int32_t sector, float driftLength) const;
158+
GPUd() float convDriftLengthToZ(int32_t sector, float driftLength) const;
159159

160160
/// convert Z to DriftLength
161-
GPUd() float convZtoDriftLength1(int32_t sector, float z) const;
161+
GPUd() float convZtoDriftLength(int32_t sector, float z) const;
162162

163163
/// convert Local c.s. -> Pad, DriftLength
164164
GPUd() void convLocalToPadDriftLength(int32_t sector, int32_t row, float y, float z, float& pad, float& l) const;
@@ -261,13 +261,13 @@ GPUdi() void TPCFastTransformGeo::convPadDriftLengthToLocal(int32_t sector, int3
261261
}
262262
}
263263

264-
GPUdi() float TPCFastTransformGeo::convDriftLengthToZ1(int32_t sector, float driftLength) const
264+
GPUdi() float TPCFastTransformGeo::convDriftLengthToZ(int32_t sector, float driftLength) const
265265
{
266266
/// convert DriftLength -> Local c.s.
267267
return (sector < NumberOfSectorsA) ? (mTPCzLength - driftLength) : (driftLength - mTPCzLength);
268268
}
269269

270-
GPUdi() float TPCFastTransformGeo::convZtoDriftLength1(int32_t sector, float z) const
270+
GPUdi() float TPCFastTransformGeo::convZtoDriftLength(int32_t sector, float z) const
271271
{
272272
/// convert Z to DriftLength
273273
return (sector < NumberOfSectorsA) ? (mTPCzLength - z) : (z + mTPCzLength);

GPU/TPCFastTransformation/TPCFastTransformGeoPOD.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ struct TPCFastTransformGeoPOD {
9191
}
9292

9393
/// convert DriftLength -> Local c.s.
94-
inline static constexpr float convDriftLengthToZ1(uint32_t sector, float driftLength)
94+
inline static constexpr float convDriftLengthToZ(uint32_t sector, float driftLength)
9595
{
9696
return (sector < getNumberOfSectorsA()) ? (getTPCzLength() - driftLength) : (driftLength - getTPCzLength());
9797
}
9898

9999
/// convert Z to DriftLength
100-
inline static constexpr float convZtoDriftLength1(uint32_t sector, float z)
100+
inline static constexpr float convZtoDriftLength(uint32_t sector, float z)
101101
{
102102
return (sector < getNumberOfSectorsA()) ? (getTPCzLength() - z) : (z + getTPCzLength());
103103
}

GPU/TPCFastTransformation/TPCFastTransformPOD.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class TPCFastTransformPOD
159159
/// Sets CTP Lumi estimator
160160
GPUd() void setLumi(float v) { mLumi = v; }
161161

162-
GPUd() void setCalibration1(int64_t timeStamp, float t0, float vDrift);
162+
GPUd() void setCalibration(int64_t timeStamp, float t0, float vDrift);
163163

164164
/// Gives a reference to a spline
165165
GPUd() const SplineType& getSplineForRow(int32_t row) const { return *reinterpret_cast<const SplineType*>(getThis() + getScenarioOffset(getRowInfo(row).splineScenarioID)); }
@@ -501,7 +501,7 @@ GPUdi() void TPCFastTransformPOD::TransformXYZ(int32_t sector, int32_t row, floa
501501
GPUdi() void TPCFastTransformPOD::TransformInTimeFrame(int32_t sector, float time, float& z, float maxTimeBin) const
502502
{
503503
float l = (time - mT0 - maxTimeBin) * mVdrift; // drift length cm
504-
z = getGeometry().convDriftLengthToZ1(sector, l);
504+
z = getGeometry().convDriftLengthToZ(sector, l);
505505
}
506506

507507
GPUdi() void TPCFastTransformPOD::TransformInTimeFrame(int32_t sector, int32_t row, float pad, float time, float& x, float& y, float& z, float maxTimeBin) const
@@ -539,7 +539,7 @@ GPUdi() void TPCFastTransformPOD::TransformIdealZ(int32_t sector, float time, fl
539539
///
540540

541541
float l = (time - mT0 - vertexTime) * mVdrift; // drift length cm
542-
z = getGeometry().convDriftLengthToZ1(sector, l);
542+
z = getGeometry().convDriftLengthToZ(sector, l);
543543
}
544544

545545
GPUdi() void TPCFastTransformPOD::TransformIdeal(int32_t sector, int32_t row, float pad, float time, float& x, float& y, float& z, float vertexTime) const
@@ -693,7 +693,7 @@ GPUdi() float TPCFastTransformPOD::convVertexTimeToZOffset(int32_t sector, float
693693
}
694694

695695
#ifndef GPUCA_GPUCODE_DEVICE // Functions not needed during GPU processing
696-
GPUdi() void TPCFastTransformPOD::setCalibration1(int64_t timeStamp, float t0, float vDrift)
696+
GPUdi() void TPCFastTransformPOD::setCalibration(int64_t timeStamp, float t0, float vDrift)
697697
{
698698
mTimeStamp = timeStamp;
699699
mT0 = t0;

0 commit comments

Comments
 (0)