From 03a5d0d288b8eea73020f64e268fef1e8ce0952f Mon Sep 17 00:00:00 2001 From: noferini <9963644+noferini@users.noreply.github.com> Date: Mon, 26 Aug 2024 19:09:47 +0200 Subject: [PATCH] add cluster pattern to chi2 --- Detectors/GlobalTracking/src/MatchTOF.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Detectors/GlobalTracking/src/MatchTOF.cxx b/Detectors/GlobalTracking/src/MatchTOF.cxx index d67708608df55..bb9778396ded8 100644 --- a/Detectors/GlobalTracking/src/MatchTOF.cxx +++ b/Detectors/GlobalTracking/src/MatchTOF.cxx @@ -1555,7 +1555,7 @@ void MatchTOF::BestMatches(std::vector& match int i = 0; // then we take discard the pairs if their track or cluster was already matched (since they are ordered in chi2, we will take the best matching) - for (const o2::dataformats::MatchInfoTOFReco& matchingPair : matchedTracksPairs) { + for (o2::dataformats::MatchInfoTOFReco& matchingPair : matchedTracksPairs) { int trkType = (int)matchingPair.getTrackType(); int itrk = matchingPair.getIdLocal(); @@ -1606,9 +1606,23 @@ void MatchTOF::BestMatches(std::vector& match continue; } + matchedTracksIndex[trkType][itrk] = matchedTracks[trkTypeSplitted].size(); // index of the MatchInfoTOF correspoding to this track matchedClustersIndex[matchingPair.getTOFClIndex()] = matchedTracksIndex[trkType][itrk]; // index of the track that was matched to this cluster - + // let's check if cluster has multiple-hits (noferini) + if (TOFClusWork[matchingPair.getTOFClIndex()].getNumOfContributingChannels() > 1) { + float chi2 = matchingPair.getChi2(); + const auto& bits = TOFClusWork[matchingPair.getTOFClIndex()].getAdditionalContributingChannels(); + if (bits & o2::tof::Cluster::kUp || bits & o2::tof::Cluster::kUpLeft || bits & o2::tof::Cluster::kUpRight || + bits & o2::tof::Cluster::kDown || bits & o2::tof::Cluster::kDownLeft || bits & o2::tof::Cluster::kDownRight) { // has an additional hit Up or Down (Z-dir) + chi2 += 20; + } + if (bits & o2::tof::Cluster::kLeft || bits & o2::tof::Cluster::kDownLeft || bits & o2::tof::Cluster::kUpLeft || + bits & o2::tof::Cluster::kRight || bits & o2::tof::Cluster::kDownRight || bits & o2::tof::Cluster::kUpRight) { // has an additional hit Left or Right (X-dir) + chi2 += 40; + } + matchingPair.setChi2(chi2); + } matchedTracks[trkTypeSplitted].push_back(matchingPair); // array of MatchInfoTOF // get fit info