diff --git a/Detectors/TPC/calibration/SpacePoints/include/SpacePoints/SpacePointsCalibParam.h b/Detectors/TPC/calibration/SpacePoints/include/SpacePoints/SpacePointsCalibParam.h index 90b693820d0fa..535dd23d7a8ae 100644 --- a/Detectors/TPC/calibration/SpacePoints/include/SpacePoints/SpacePointsCalibParam.h +++ b/Detectors/TPC/calibration/SpacePoints/include/SpacePoints/SpacePointsCalibParam.h @@ -53,11 +53,11 @@ static constexpr int NY2XBins = 15; ///< number of bins in y/x static constexpr int NZ2XBins = 5; ///< number of bins in z/x // define ranges for compression to shorts in TPCClusterResiduals -static constexpr float MaxResid = 20.f; ///< max residual in y and z -static constexpr float MaxY = 50.f; ///< max value for y position (sector coordinates) -static constexpr float MaxZ = 300.f; ///< max value for z position -static constexpr float MaxTgSlp = 1.f; ///< max value for phi (from snp, converted to tangens) - +static constexpr float MaxResid = 20.f; ///< max residual in y and z +static constexpr float MaxY = 50.f; ///< max value for y position (sector coordinates) +static constexpr float MaxZ = 300.f; ///< max value for z position +static constexpr float MaxTgSlp = 1.f; ///< max value for phi (from snp, converted to tangens) +static constexpr float MaxTRDSlope = 5.; ///< max value for the TRD tracklet getDy // miscellaneous static constexpr float sEps = 1e-6f; ///< small number for float comparisons diff --git a/Detectors/TPC/calibration/SpacePoints/include/SpacePoints/TrackInterpolation.h b/Detectors/TPC/calibration/SpacePoints/include/SpacePoints/TrackInterpolation.h index 3b9e4021f443a..eaaea3f26b995 100644 --- a/Detectors/TPC/calibration/SpacePoints/include/SpacePoints/TrackInterpolation.h +++ b/Detectors/TPC/calibration/SpacePoints/include/SpacePoints/TrackInterpolation.h @@ -146,13 +146,14 @@ struct TrackData { unsigned short nClsITS{}; ///< number of attached ITS clusters unsigned short nTrkltsTRD{}; ///< number of attached TRD tracklets unsigned short clAvailTOF{}; ///< whether or not track seed has a matched TOF cluster, if so, gives the resolution of the T0 in ps + short TRDTrkltSlope[6] = {}; ///< TRD tracklet slope 0x7fff / param::MaxTRDSlope uint8_t nExtDetResid = 0; ///< number of external detectors (to TPC) residuals stored, on top of clIdx.getEntries o2::dataformats::RangeReference<> clIdx{}; ///< index of first cluster residual and total number of TPC cluster residuals of this track float getT0Error() const { return float(clAvailTOF); } bool isTOFAvail() const { return clAvailTOF != 0; } - ClassDefNV(TrackData, 8); + ClassDefNV(TrackData, 9); }; /// \class TrackInterpolation @@ -293,7 +294,7 @@ class TrackInterpolation void setExtDetResid(bool v) { mExtDetResid = v; } - int processTRDLayer(const o2::trd::TrackTRD& trkTRD, int iLayer, o2::track::TrackParCov& trkWork, std::array* trkltTRDYZ = nullptr, std::array* trkltTRDCov = nullptr); + int processTRDLayer(const o2::trd::TrackTRD& trkTRD, int iLayer, o2::track::TrackParCov& trkWork, std::array* trkltTRDYZ = nullptr, std::array* trkltTRDCov = nullptr, TrackData* trkData = nullptr); // --------------------------------- output --------------------------------------------- std::vector& getClusterResiduals() { return mClRes; } diff --git a/Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx b/Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx index 00d689326de73..d89b3c28f1a0d 100644 --- a/Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx +++ b/Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx @@ -663,7 +663,7 @@ void TrackInterpolation::interpolateTrack(int iSeed) const auto& trkTRD = mRecoCont->getITSTPCTRDTrack(gidTable[GTrackID::ITSTPCTRD]); for (int iLayer = 0; iLayer < o2::trd::constants::NLAYER; iLayer++) { std::array trkltTRDYZ{}; - int res = processTRDLayer(trkTRD, iLayer, trkWork, &trkltTRDYZ); + int res = processTRDLayer(trkTRD, iLayer, trkWork, &trkltTRDYZ, nullptr, &trackData); if (res == -1) { // no traklet on this layer continue; } @@ -757,7 +757,7 @@ void TrackInterpolation::interpolateTrack(int iSeed) } int TrackInterpolation::processTRDLayer(const o2::trd::TrackTRD& trkTRD, int iLayer, o2::track::TrackParCov& trkWork, - std::array* trkltTRDYZ, std::array* trkltTRDCov) + std::array* trkltTRDYZ, std::array* trkltTRDCov, TrackData* trkData) { // return chamber ID (0:539) in case of successful processing, -1 if there is no TRD tracklet at given layer, -2 if processing failed int trkltIdx = trkTRD.getTrackletIndex(iLayer); @@ -793,6 +793,12 @@ int TrackInterpolation::processTRDLayer(const o2::trd::TrackTRD& trkTRD, int iLa mRecoParam.recalcTrkltCov(tilt, trkWork.getSnp(), pad->getRowSize(trdTrklt.getPadRow()), *trkltTRDCov); } } + if (trkData) { + auto slope = trdSP.getDy(); + if (std::abs(slope) < param::MaxTRDSlope) { + trkData->TRDTrkltSlope[iLayer] = slope * 0x7fff / param::MaxTRDSlope; + } + } return trkltDet; } @@ -915,9 +921,10 @@ void TrackInterpolation::extrapolateTrack(int iSeed) const auto& gidTableFull = mGIDtables[iSeedFull]; if (gidTableFull[GTrackID::TRD].isIndexSet()) { const auto& trkTRD = mRecoCont->getITSTPCTRDTrack(gidTableFull[GTrackID::ITSTPCTRD]); + trackData.nTrkltsTRD = trkTRD.getNtracklets(); for (int iLayer = 0; iLayer < o2::trd::constants::NLAYER; iLayer++) { std::array trkltTRDYZ{}; - int res = processTRDLayer(trkTRD, iLayer, trkWork, &trkltTRDYZ); + int res = processTRDLayer(trkTRD, iLayer, trkWork, &trkltTRDYZ, nullptr, &trackData); if (res == -1) { // no traklet on this layer continue; } @@ -932,7 +939,6 @@ void TrackInterpolation::extrapolateTrack(int iSeed) const auto sec = clusterResiduals[iCl].sec; 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)) { mClRes.emplace_back(dy, dz, tgPhi, trkWork.getY(), trkWork.getZ(), 160 + iLayer, o2::math_utils::angle2Sector(trkWork.getAlpha()), (short)res); - trackData.nTrkltsTRD++; trackData.nExtDetResid++; } }