40 return mComplete ? gsl::span<const uint8_t>{mSharedClusterFlags} : gsl::span<const uint8_t>{};
49 if (!stageSharedClusterFlags(trackIndices,
params, frame)) {
58 mSharedClusterFlags.clear();
76 struct SharedClusterTrackInfo {
78 uint32_t clusterId{std::numeric_limits<uint32_t>::max()};
90 if (
layer < 0 || !isValidTrackRange(track,
static_cast<uint32_t
>(references.size())) ||
91 track.firstClusterRef ==
track.clusterRefEnd ||
100 if (!
state.hasRecognizedKind() || !o2::gpu::GPUCommonMath::Finite(
state.parameters[3]) ||
101 !o2::gpu::GPUCommonMath::Finite(
state.parameters[4])) {
105 const float eta = std::asinh(
state.parameters[3]);
106 if (!o2::gpu::GPUCommonMath::Finite(phi) || !o2::gpu::GPUCommonMath::Finite(eta)) {
110 phi, eta,
state.parameters[4] < 0.f ? -1 : 1};
113 bool stageSharedClusterFlags(gsl::span<const uint32_t> trackIndices,
117 auto nextIndex = mSharedClusterFlags.size();
118 for (
const auto index : trackIndices) {
122 nextIndex =
static_cast<std::size_t
>(
index) + 1;
126 mSharedClusterFlags.resize(nextIndex, std::numeric_limits<uint8_t>::max());
127 for (
const auto index : trackIndices) {
128 mSharedClusterFlags[
index] = 0;
130 if (!
params.AllowSharingFirstCluster) {
133 std::vector<SharedClusterTrackInfo> trackInfo;
134 trackInfo.reserve(trackIndices.size());
135 for (
const auto index : trackIndices) {
140 trackInfo.push_back(*info);
143 for (
size_t second =
first + 1; second < trackInfo.size(); ++second) {
144 if (trackInfo[second].
layer != trackInfo[
first].
layer || trackInfo[second].clusterId != trackInfo[
first].clusterId) {
147 if (trackInfo[
first].rof != trackInfo[second].rof) {
150 if (!o2::its::math_utils::isPhiDifferenceBelow(trackInfo[
first].phi, trackInfo[second].phi,
params.SharedClusterMaxDeltaPhi)) {
153 if (std::abs(trackInfo[
first].eta - trackInfo[second].eta) >
params.SharedClusterMaxDeltaEta) {
156 if (
params.SharedClusterOppositeSign && trackInfo[
first].charge == trackInfo[second].charge) {
159 mSharedClusterFlags[trackIndices[
first]] = 1;
160 mSharedClusterFlags[trackIndices[second]] = 1;
166 std::vector<uint8_t> mSharedClusterFlags;
167 bool mComplete =
false;