Skip to content

Commit f2e0f3d

Browse files
authored
Add TRD tracklets slopes to unbinned residuals tree (#14676)
* Add TRD tracklets slopes to unbinned residuals tree * increment TrackData class version
1 parent c2864a0 commit f2e0f3d

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

Detectors/TPC/calibration/SpacePoints/include/SpacePoints/SpacePointsCalibParam.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ static constexpr int NY2XBins = 15; ///< number of bins in y/x
5353
static constexpr int NZ2XBins = 5; ///< number of bins in z/x
5454

5555
// define ranges for compression to shorts in TPCClusterResiduals
56-
static constexpr float MaxResid = 20.f; ///< max residual in y and z
57-
static constexpr float MaxY = 50.f; ///< max value for y position (sector coordinates)
58-
static constexpr float MaxZ = 300.f; ///< max value for z position
59-
static constexpr float MaxTgSlp = 1.f; ///< max value for phi (from snp, converted to tangens)
60-
56+
static constexpr float MaxResid = 20.f; ///< max residual in y and z
57+
static constexpr float MaxY = 50.f; ///< max value for y position (sector coordinates)
58+
static constexpr float MaxZ = 300.f; ///< max value for z position
59+
static constexpr float MaxTgSlp = 1.f; ///< max value for phi (from snp, converted to tangens)
60+
static constexpr float MaxTRDSlope = 5.; ///< max value for the TRD tracklet getDy
6161
// miscellaneous
6262
static constexpr float sEps = 1e-6f; ///< small number for float comparisons
6363

Detectors/TPC/calibration/SpacePoints/include/SpacePoints/TrackInterpolation.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,14 @@ struct TrackData {
146146
unsigned short nClsITS{}; ///< number of attached ITS clusters
147147
unsigned short nTrkltsTRD{}; ///< number of attached TRD tracklets
148148
unsigned short clAvailTOF{}; ///< whether or not track seed has a matched TOF cluster, if so, gives the resolution of the T0 in ps
149+
short TRDTrkltSlope[6] = {}; ///< TRD tracklet slope 0x7fff / param::MaxTRDSlope
149150
uint8_t nExtDetResid = 0; ///< number of external detectors (to TPC) residuals stored, on top of clIdx.getEntries
150151
o2::dataformats::RangeReference<> clIdx{}; ///< index of first cluster residual and total number of TPC cluster residuals of this track
151152

152153
float getT0Error() const { return float(clAvailTOF); }
153154
bool isTOFAvail() const { return clAvailTOF != 0; }
154155

155-
ClassDefNV(TrackData, 8);
156+
ClassDefNV(TrackData, 9);
156157
};
157158

158159
/// \class TrackInterpolation
@@ -293,7 +294,7 @@ class TrackInterpolation
293294

294295
void setExtDetResid(bool v) { mExtDetResid = v; }
295296

296-
int processTRDLayer(const o2::trd::TrackTRD& trkTRD, int iLayer, o2::track::TrackParCov& trkWork, std::array<float, 2>* trkltTRDYZ = nullptr, std::array<float, 3>* trkltTRDCov = nullptr);
297+
int processTRDLayer(const o2::trd::TrackTRD& trkTRD, int iLayer, o2::track::TrackParCov& trkWork, std::array<float, 2>* trkltTRDYZ = nullptr, std::array<float, 3>* trkltTRDCov = nullptr, TrackData* trkData = nullptr);
297298

298299
// --------------------------------- output ---------------------------------------------
299300
std::vector<UnbinnedResid>& getClusterResiduals() { return mClRes; }

Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ void TrackInterpolation::interpolateTrack(int iSeed)
663663
const auto& trkTRD = mRecoCont->getITSTPCTRDTrack<o2::trd::TrackTRD>(gidTable[GTrackID::ITSTPCTRD]);
664664
for (int iLayer = 0; iLayer < o2::trd::constants::NLAYER; iLayer++) {
665665
std::array<float, 2> trkltTRDYZ{};
666-
int res = processTRDLayer(trkTRD, iLayer, trkWork, &trkltTRDYZ);
666+
int res = processTRDLayer(trkTRD, iLayer, trkWork, &trkltTRDYZ, nullptr, &trackData);
667667
if (res == -1) { // no traklet on this layer
668668
continue;
669669
}
@@ -757,7 +757,7 @@ void TrackInterpolation::interpolateTrack(int iSeed)
757757
}
758758

759759
int TrackInterpolation::processTRDLayer(const o2::trd::TrackTRD& trkTRD, int iLayer, o2::track::TrackParCov& trkWork,
760-
std::array<float, 2>* trkltTRDYZ, std::array<float, 3>* trkltTRDCov)
760+
std::array<float, 2>* trkltTRDYZ, std::array<float, 3>* trkltTRDCov, TrackData* trkData)
761761
{
762762
// return chamber ID (0:539) in case of successful processing, -1 if there is no TRD tracklet at given layer, -2 if processing failed
763763
int trkltIdx = trkTRD.getTrackletIndex(iLayer);
@@ -793,6 +793,12 @@ int TrackInterpolation::processTRDLayer(const o2::trd::TrackTRD& trkTRD, int iLa
793793
mRecoParam.recalcTrkltCov(tilt, trkWork.getSnp(), pad->getRowSize(trdTrklt.getPadRow()), *trkltTRDCov);
794794
}
795795
}
796+
if (trkData) {
797+
auto slope = trdSP.getDy();
798+
if (std::abs(slope) < param::MaxTRDSlope) {
799+
trkData->TRDTrkltSlope[iLayer] = slope * 0x7fff / param::MaxTRDSlope;
800+
}
801+
}
796802
return trkltDet;
797803
}
798804

@@ -915,9 +921,10 @@ void TrackInterpolation::extrapolateTrack(int iSeed)
915921
const auto& gidTableFull = mGIDtables[iSeedFull];
916922
if (gidTableFull[GTrackID::TRD].isIndexSet()) {
917923
const auto& trkTRD = mRecoCont->getITSTPCTRDTrack<o2::trd::TrackTRD>(gidTableFull[GTrackID::ITSTPCTRD]);
924+
trackData.nTrkltsTRD = trkTRD.getNtracklets();
918925
for (int iLayer = 0; iLayer < o2::trd::constants::NLAYER; iLayer++) {
919926
std::array<float, 2> trkltTRDYZ{};
920-
int res = processTRDLayer(trkTRD, iLayer, trkWork, &trkltTRDYZ);
927+
int res = processTRDLayer(trkTRD, iLayer, trkWork, &trkltTRDYZ, nullptr, &trackData);
921928
if (res == -1) { // no traklet on this layer
922929
continue;
923930
}
@@ -932,7 +939,6 @@ void TrackInterpolation::extrapolateTrack(int iSeed)
932939
const auto sec = clusterResiduals[iCl].sec;
933940
if ((std::abs(dy) < param::MaxResid) && (std::abs(dz) < param::MaxResid) && (std::abs(trkWork.getY()) < param::MaxY) && (std::abs(trkWork.getZ()) < param::MaxZ) && (std::abs(tgPhi) < param::MaxTgSlp)) {
934941
mClRes.emplace_back(dy, dz, tgPhi, trkWork.getY(), trkWork.getZ(), 160 + iLayer, o2::math_utils::angle2Sector(trkWork.getAlpha()), (short)res);
935-
trackData.nTrkltsTRD++;
936942
trackData.nExtDetResid++;
937943
}
938944
}

0 commit comments

Comments
 (0)