Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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);
}

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 @@ -79,6 +79,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 @@ -59,6 +59,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 @@ -102,6 +102,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
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 @@ -196,6 +196,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;

if (tc.useMatCorrTGeo) {
p.CorrType = o2::base::PropagatorImpl<float>::MatCorrType::USEMatCorrTGeo;
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 @@ -856,23 +856,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();
});

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)) {
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) {
}
track.setSharedClusters();
track2.setSharedClusters();
}
++j;
}
}
}
}
}

template <int NLayers>
bool TrackerTraits<NLayers>::areTracksSelected(int iteration, const TrackITSExt& t1, const TrackITSExt& t2)
{
const auto t1FirstLayer{t1.getFirstClusterLayer()}, t2FirstLayer{t2.getFirstClusterLayer()};
if (mTimeFrame->getClusterROF(t1FirstLayer, t1.getClusterIndex(t1FirstLayer)) != mTimeFrame->getClusterROF(t2FirstLayer, t2.getClusterIndex(t2FirstLayer))) {
return false;
}
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
Loading