Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ class TrackITSExt : public TrackITS

GPUhdi() const int& getClusterIndex(int lr) const { return mIndex[lr]; }

GPUh() const int& getFirstLayerClusterIndex() const
{
int firstLayer = getFirstClusterLayer();
return getClusterIndex(firstLayer);
}
Comment thread
f3sch marked this conversation as resolved.
Outdated

GPUhdi() void setExternalClusterIndex(int layer, int idx, bool newCluster = false)
{
if (newCluster) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ struct TrackingParameters {
bool PrintMemory = false; // print allocator usage in epilog report
size_t MaxMemory = std::numeric_limits<size_t>::max();
bool DropTFUponFailure = false;

// Selections on tracks sharing clusters
float SharedClusterMaxDeltaPhi = 0.05f; // For tracks sharing clusters, maximum allowed delta phi at the cluster position
float SharedClusterMaxDeltaEta = 0.03f; // For tracks sharing clusters, maximum allowed delta eta at the cluster position
bool SharedClusterOppositeSign = false; // For tracks sharing clusters, require opposite sign of the tracklets
};

struct VertexingParameters {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class TrackerTraits
void acceptTracks(int iteration, bounded_vector<TrackITSExt>& tracks, bounded_vector<bounded_vector<int>>& firstClusters, bounded_vector<bounded_vector<int>>& sharedFirstClusters);
void markTracks(int iteration, bounded_vector<bounded_vector<int>>& sharedFirstClusters);

bool areTracksSelected(int iteration, const TrackITSExt& t1, const TrackITSExt& t2);

void updateTrackingParameters(const std::vector<TrackingParameters>& trkPars)
{
mTrkParams = trkPars;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ struct TrackerParamConfig : public o2::conf::ConfigurableParamHelper<TrackerPara
bool fataliseUponFailure = true; // granular management of the fatalisation in async mode
bool allowSharingFirstCluster = false; // allow first cluster sharing among tracks

// Selections on tracks sharing clusters
Comment thread
f3sch marked this conversation as resolved.
float sharedClusterMaxDeltaPhi = 0.05f; // Maximum allowed delta phi at the cluster position
float sharedClusterMaxDeltaEta = 0.03f; // Maximum allowed delta eta at the cluster position
bool sharedClusterOppositeSign = false; // Require opposite sign of the tracklets

O2ParamDef(TrackerParamConfig, "ITSCATrackerParam");
};

Expand Down
3 changes: 3 additions & 0 deletions Detectors/ITSMFT/ITS/tracking/src/Configuration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ std::vector<TrackingParameters> TrackingMode::getTrackingParameters(TrackingMode
p.SaveTimeBenchmarks = tc.saveTimeBenchmarks;
p.FataliseUponFailure = tc.fataliseUponFailure;
p.AllowSharingFirstCluster = tc.allowSharingFirstCluster;
p.SharedClusterMaxDeltaPhi = tc.sharedClusterMaxDeltaPhi;
p.SharedClusterMaxDeltaEta = tc.sharedClusterMaxDeltaEta;
p.SharedClusterOppositeSign = tc.sharedClusterOppositeSign;
const auto iter = &p - trackParams.data();
if (iter < constants::MaxIter) {
p.MaxHoles = tc.maxHolesIter[iter];
Expand Down
51 changes: 40 additions & 11 deletions Detectors/ITSMFT/ITS/tracking/src/TrackerTraits.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -876,23 +876,52 @@ void TrackerTraits<NLayers>::markTracks(int iteration, bounded_vector<bounded_ve
std::sort(sharedFirstClusters[iLayer].begin(), sharedFirstClusters[iLayer].end());
}

for (auto& track : mTimeFrame->getTracks()) {
int firstLayer{mTrkParams[iteration].NLayers}, firstCluster{constants::UnusedIndex};
for (int iLayer{0}; iLayer < mTrkParams[iteration].NLayers; ++iLayer) {
if (track.getClusterIndex(iLayer) == constants::UnusedIndex) {
continue;
}
firstLayer = iLayer;
firstCluster = track.getClusterIndex(iLayer);
break;
}
auto& tracks = mTimeFrame->getTracks();
std::sort(tracks.begin(), tracks.end(), [](const auto& t1, const auto& t2) {
return t1.getFirstLayerClusterIndex() < t2.getFirstLayerClusterIndex();
});
Comment thread
f3sch marked this conversation as resolved.

for (int i{0}; i < static_cast<int>(tracks.size()); ++i) {
auto& track = tracks[i];
int firstLayer{track.getFirstClusterLayer()}, firstCluster{track.getFirstLayerClusterIndex()};
if (std::binary_search(sharedFirstClusters[firstLayer].begin(), sharedFirstClusters[firstLayer].end(), firstCluster)) {
Comment thread
f3sch marked this conversation as resolved.
Outdated
track.setSharedClusters();
int j = i + 1;
while (j < static_cast<int>(tracks.size()) && tracks[j].getFirstLayerClusterIndex() == firstCluster) {
auto& track2 = tracks[j];
if (areTracksSelected(iteration, track, track2)) {
for (int iLayer{track.getFirstClusterLayer()}; iLayer < track.getFirstClusterLayer() + track.getNClusters(); ++iLayer) {
}
for (int iLayer{track2.getFirstClusterLayer()}; iLayer < track2.getFirstClusterLayer() + track2.getNClusters(); ++iLayer) {
}
Comment thread
f3sch marked this conversation as resolved.
Outdated
track.setSharedClusters();
track2.setSharedClusters();
Comment thread
f3sch marked this conversation as resolved.
Outdated
}
++j;
}
}
}
}
}

template <int NLayers>
bool TrackerTraits<NLayers>::areTracksSelected(int iteration, const TrackITSExt& t1, const TrackITSExt& t2)
Comment thread
f3sch marked this conversation as resolved.
Outdated
{
const auto t1FirstLayer{t1.getFirstClusterLayer()}, t2FirstLayer{t2.getFirstClusterLayer()};
if (mTimeFrame->getClusterROF(t1FirstLayer, t1.getClusterIndex(t1FirstLayer)) != mTimeFrame->getClusterROF(t2FirstLayer, t2.getClusterIndex(t2FirstLayer))) {
return false;
}
Comment thread
f3sch marked this conversation as resolved.
Outdated
if (o2::math_utils::detail::deltaPhiSmall(t1.getPhi(), t2.getPhi()) > mTrkParams[iteration].SharedClusterMaxDeltaPhi) {
return false;
}
if (std::abs(t1.getEta() - t2.getEta()) > mTrkParams[iteration].SharedClusterMaxDeltaEta) {
return false;
}
if (mTrkParams[iteration].SharedClusterOppositeSign && t1.getSign() == t2.getSign()) {
return false;
}
return true;
}

template <int NLayers>
void TrackerTraits<NLayers>::setBz(float bz)
{
Expand Down