Skip to content

Commit 5cc77ff

Browse files
martenolenoferini
authored andcommitted
TRD shift tracklet position by one pad
1 parent a42b89c commit 5cc77ff

File tree

3 files changed

+5
-25
lines changed

3 files changed

+5
-25
lines changed

DataFormats/Detectors/TRD/include/DataFormatsTRD/Tracklet64.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,14 @@ class Tracklet64
138138
GPUd() float getPadWidth() const { return 0.635f + 0.03f * (getDetector() % constants::NLAYER); }
139139

140140
// pad column number inside pad row as float
141-
GPUd() float getPadColFloat() const { return getPositionFloat() + getMCMCol() * constants::NCOLMCM + constants::NADCMCM / 2.f; }
141+
// FIXME: understand why the offset seems to be 8 pads and not nChannels / 2 = 10.5
142+
GPUd() float getPadColFloat() const { return getPositionFloat() + getMCMCol() * constants::NCOLMCM + 8; }
142143

143144
// pad column number inside pad row as int can be off by +-1 pad (same function name as for TRD digit)
144-
// FIXME: understand why the offset seems to be 8 pads and not nChannels / 2 = 10.5
145-
GPUd() int getPadCol() const { return GPUCA_NAMESPACE::gpu::CAMath::Nint(getPadColFloat() - 2); }
145+
GPUd() int getPadCol() const { return GPUCA_NAMESPACE::gpu::CAMath::Nint(getPadColFloat()); }
146146

147147
// translate local position into global y (in cm) not taking into account calibrations (ExB, vDrift, t0)
148-
GPUd() float getUncalibratedY() const
149-
{
150-
// one pad column has 144 pads, the offset of -63 is the center of the first MCM in that column
151-
// which is connected to the pads -63 - 9 = -72 to -63 + 9 = -54
152-
int offsetInNumberOfPads = -63 + constants::NCOLMCM * getMCMCol();
153-
return (offsetInNumberOfPads + getPositionFloat()) * getPadWidth();
154-
}
148+
GPUd() float getUncalibratedY() const { return (getPadColFloat() - (constants::NCOLUMN / 2.f)) * getPadWidth(); }
155149

156150
// translate local slope into dy/dx with dx=3m (drift length) and default drift time in time bins (19.4 timebins / 3cm)
157151
GPUd() float getUncalibratedDy(float nTbDrift = 19.4f) const { return getSlopeFloat() * getPadWidth() * nTbDrift; }

Detectors/TRD/base/include/TRDBase/TrackletTransformer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class TrackletTransformer
3333
void setCalVdriftExB(const CalVdriftExB* cal) { mCalVdriftExB = cal; };
3434
void setApplyXOR() { mApplyXOR = true; }
3535

36-
float calculateY(int hcid, int column, int position, const PadPlane* padPlane) const;
37-
3836
float calculateZ(int padrow, const PadPlane* padPlane) const;
3937

4038
float calculateDy(int hcid, int slope, const PadPlane* padPlane) const;

Detectors/TRD/base/src/TrackletTransformer.cxx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ void TrackletTransformer::init()
2727
mXAnode = mGeo->cdrHght() + mGeo->camHght() / 2;
2828
}
2929

30-
float TrackletTransformer::calculateY(int hcid, int column, int position, const PadPlane* padPlane) const
31-
{
32-
double padWidth = padPlane->getWidthIPad();
33-
int side = hcid % 2;
34-
position += 1 << (NBITSTRKLPOS - 1); // shift such that position = 1 << (NBITSTRKLPOS - 1) corresponds to the MCM center
35-
// slightly modified TDP eq 16.1 (appended -1 to the end to account for MCM shared pads)
36-
double pad = float(position - (1 << (NBITSTRKLPOS - 1))) * GRANULARITYTRKLPOS + NCOLMCM * (4 * side + column) + 10. - 1.;
37-
float y = padWidth * (pad - 72);
38-
39-
return y;
40-
}
41-
4230
float TrackletTransformer::calculateZ(int padrow, const PadPlane* padPlane) const
4331
{
4432
double rowPos = padPlane->getRowPos(padrow);
@@ -114,7 +102,7 @@ CalibratedTracklet TrackletTransformer::transformTracklet(Tracklet64 tracklet, b
114102

115103
// 5mm below cathode plane to reduce error propogation from tracklet fit and driftV
116104
float x = mGeo->cdrHght() - 0.5;
117-
float y = calculateY(hcid, column, position, padPlane);
105+
float y = tracklet.getUncalibratedY();
118106
float z = calculateZ(padrow, padPlane);
119107

120108
float dy = calculateDy(detector, slope, padPlane);

0 commit comments

Comments
 (0)