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 27, 2024
1 parent ba9e426 commit 4d2626d
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& 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
Expand Down

0 comments on commit 4d2626d

Please sign in to comment.