diff --git a/Detectors/GlobalTracking/src/MatchTOF.cxx b/Detectors/GlobalTracking/src/MatchTOF.cxx index d67708608df55..f930f45c0a8f0 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& tofcl = TOFClusWork[matchingPair.getTOFClIndex()]; + if (tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUp) || tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpLeft) || tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpRight) || + tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDown) || tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownLeft) || tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownRight)) { // has an additional hit Up or Down (Z-dir) + chi2 += 20; + } + if (tofcl.isAdditionalChannelSet(o2::tof::Cluster::kLeft) || tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownLeft) || tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpLeft) || + tofcl.isAdditionalChannelSet(o2::tof::Cluster::kRight) || tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownRight) || tofcl.isAdditionalChannelSet(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