Skip to content

Commit 8fd6c98

Browse files
committed
U
1 parent bfde008 commit 8fd6c98

2 files changed

Lines changed: 1 addition & 59 deletions

File tree

‎Detectors/Upgrades/ALICE3/GlobalReconstruction/reconstruction/include/ALICE3GlobalReconstruction/TrackerACTS.h‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,11 @@ class TrackerACTS
139139
/// Run track finding from seeds
140140
void findTracks();
141141

142-
/// Convert fitted ACTS states to a TrackITSExt and publish it in the TimeFrame.
142+
/// Convert fitted ACTS states to a TrackITSExt and publish it in the TimeFrame. Also adds the corresponding MC labels if available.
143143
bool acceptTrack(const Acts::BoundTrackParameters& inner,
144144
const Acts::BoundTrackParameters& outer,
145145
const SeedACTS& seed, float chi2);
146146

147-
/// Assign MC labels to tracks
148-
void computeTracksMClabels();
149-
150147
/// Helper: time a task
151148
template <typename Func>
152149
float evaluateTask(Func&& task, std::string_view taskName);

‎Detectors/Upgrades/ALICE3/GlobalReconstruction/reconstruction/src/TrackerACTS.cxx‎

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -677,57 +677,6 @@ void TrackerACTS<nLayers>::findTracks()
677677
<< nInvalid << " invalid from " << mSeeds.size() << " seeds";
678678
}
679679

680-
template <int nLayers>
681-
void TrackerACTS<nLayers>::computeTracksMClabels()
682-
{
683-
684-
return; // For now we skip MC labeling, will be implemented in the next iterations once we have track candidates to label
685-
686-
if (!mTimeFrame || !mTimeFrame->hasMCinformation()) {
687-
688-
return;
689-
}
690-
691-
// MC labeling using majority voting on cluster labels
692-
693-
for (int iROF = 0; iROF < mTimeFrame->getNrof(0); ++iROF) {
694-
695-
for (auto& track : mTimeFrame->getTracks()) {
696-
std::vector<std::pair<MCCompLabel, size_t>> labelCounts;
697-
698-
for (int iCluster = 0; iCluster < o2::its::TrackITSExt::MaxClusters; ++iCluster) {
699-
const int clusterIdx = track.getClusterIndex(iCluster);
700-
if (clusterIdx == o2::its::constants::UnusedIndex) {
701-
continue;
702-
}
703-
704-
auto clusterLabels = mTimeFrame->getClusterLabels(iCluster, clusterIdx);
705-
for (const auto& label : clusterLabels) {
706-
auto it = std::find_if(labelCounts.begin(), labelCounts.end(),
707-
[&label](const auto& p) { return p.first == label; });
708-
if (it != labelCounts.end()) {
709-
++(it->second);
710-
} else {
711-
labelCounts.emplace_back(label, 1);
712-
}
713-
}
714-
}
715-
716-
if (!labelCounts.empty()) {
717-
// Find label with most occurrences
718-
auto maxIt = std::max_element(labelCounts.begin(), labelCounts.end(),
719-
[](const auto& a, const auto& b) { return a.second < b.second; });
720-
721-
MCCompLabel trackLabel = maxIt->first;
722-
if (maxIt->second < static_cast<size_t>(track.getNumberOfClusters())) {
723-
trackLabel.setFakeFlag();
724-
}
725-
mTimeFrame->getTracksLabel().emplace_back(trackLabel);
726-
}
727-
}
728-
}
729-
}
730-
731680
template <int nLayers>
732681
bool TrackerACTS<nLayers>::acceptTrack(const Acts::BoundTrackParameters& inner,
733682
const Acts::BoundTrackParameters& outer,
@@ -893,10 +842,6 @@ void TrackerACTS<nLayers>::clustersToTracks()
893842
totalTime += evaluateTask([this]() { findTracks(); }, StateNames[mCurState]);
894843
}
895844

896-
if (mTimeFrame->hasMCinformation()) {
897-
computeTracksMClabels();
898-
}
899-
900845
LOG(info) << "=== TimeFrame " << mTimeFrameCounter << " completed in: " << totalTime << " ms ===";
901846
++mTimeFrameCounter;
902847
mTotalTime += totalTime;

0 commit comments

Comments
 (0)