Skip to content

Commit

Permalink
add cluster pattern to chi2
Browse files Browse the repository at this point in the history
  • Loading branch information
noferini committed Aug 26, 2024
1 parent ba9e426 commit 03a5d0d
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Detectors/GlobalTracking/src/MatchTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& 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();
Expand Down Expand Up @@ -1606,9 +1606,23 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& 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
Expand Down

0 comments on commit 03a5d0d

Please sign in to comment.