Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<float, 2>* trkltTRDYZ = nullptr, std::array<float, 3>* trkltTRDCov = nullptr);
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);

// --------------------------------- output ---------------------------------------------
std::vector<UnbinnedResid>& getClusterResiduals() { return mClRes; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ void TrackInterpolation::interpolateTrack(int iSeed)
const auto& trkTRD = mRecoCont->getITSTPCTRDTrack<o2::trd::TrackTRD>(gidTable[GTrackID::ITSTPCTRD]);
for (int iLayer = 0; iLayer < o2::trd::constants::NLAYER; iLayer++) {
std::array<float, 2> 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;
}
Expand Down Expand Up @@ -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<float, 2>* trkltTRDYZ, std::array<float, 3>* trkltTRDCov)
std::array<float, 2>* trkltTRDYZ, std::array<float, 3>* 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);
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -915,9 +921,10 @@ void TrackInterpolation::extrapolateTrack(int iSeed)
const auto& gidTableFull = mGIDtables[iSeedFull];
if (gidTableFull[GTrackID::TRD].isIndexSet()) {
const auto& trkTRD = mRecoCont->getITSTPCTRDTrack<o2::trd::TrackTRD>(gidTableFull[GTrackID::ITSTPCTRD]);
trackData.nTrkltsTRD = trkTRD.getNtracklets();
for (int iLayer = 0; iLayer < o2::trd::constants::NLAYER; iLayer++) {
std::array<float, 2> 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;
}
Expand All @@ -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++;
}
}
Expand Down