Skip to content

Commit

Permalink
TRD shift tracklet position by one pad
Browse files Browse the repository at this point in the history
  • Loading branch information
martenole authored and chiarazampolli committed Feb 29, 2024
1 parent bab05ed commit 015bb0c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
14 changes: 4 additions & 10 deletions DataFormats/Detectors/TRD/include/DataFormatsTRD/Tracklet64.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,14 @@ class Tracklet64
GPUd() float getPadWidth() const { return 0.635f + 0.03f * (getDetector() % constants::NLAYER); }

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

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

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

// translate local slope into dy/dx with dx=3m (drift length) and default drift time in time bins (19.4 timebins / 3cm)
GPUd() float getUncalibratedDy(float nTbDrift = 19.4f) const { return getSlopeFloat() * getPadWidth() * nTbDrift; }
Expand Down
2 changes: 0 additions & 2 deletions Detectors/TRD/base/include/TRDBase/TrackletTransformer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class TrackletTransformer
void setCalVdriftExB(const CalVdriftExB* cal) { mCalVdriftExB = cal; };
void setApplyXOR() { mApplyXOR = true; }

float calculateY(int hcid, int column, int position, const PadPlane* padPlane) const;

float calculateZ(int padrow, const PadPlane* padPlane) const;

float calculateDy(int hcid, int slope, const PadPlane* padPlane) const;
Expand Down
14 changes: 1 addition & 13 deletions Detectors/TRD/base/src/TrackletTransformer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ void TrackletTransformer::init()
mXAnode = mGeo->cdrHght() + mGeo->camHght() / 2;
}

float TrackletTransformer::calculateY(int hcid, int column, int position, const PadPlane* padPlane) const
{
double padWidth = padPlane->getWidthIPad();
int side = hcid % 2;
position += 1 << (NBITSTRKLPOS - 1); // shift such that position = 1 << (NBITSTRKLPOS - 1) corresponds to the MCM center
// slightly modified TDP eq 16.1 (appended -1 to the end to account for MCM shared pads)
double pad = float(position - (1 << (NBITSTRKLPOS - 1))) * GRANULARITYTRKLPOS + NCOLMCM * (4 * side + column) + 10. - 1.;
float y = padWidth * (pad - 72);

return y;
}

float TrackletTransformer::calculateZ(int padrow, const PadPlane* padPlane) const
{
double rowPos = padPlane->getRowPos(padrow);
Expand Down Expand Up @@ -114,7 +102,7 @@ CalibratedTracklet TrackletTransformer::transformTracklet(Tracklet64 tracklet, b

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

float dy = calculateDy(detector, slope, padPlane);
Expand Down

0 comments on commit 015bb0c

Please sign in to comment.