Skip to content

Commit 5307e53

Browse files
authored
[PWGJE] fixing bug in V0 jet finder (#17882)
1 parent ad06b2a commit 5307e53

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

PWGJE/Core/JetFindingUtilities.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,19 @@ template <typename T, typename U>
137137
void analyseTracksMultipleCandidates(std::vector<fastjet::PseudoJet>& inputParticles, T const& tracks, int trackSelection, U const& candidates)
138138
{
139139
for (auto& track : tracks) {
140+
bool isSelected = true;
140141
if (!jetderiveddatautilities::selectTrack(track, trackSelection)) {
141142
continue;
142143
}
143144
for (auto& candidate : candidates) {
144145
if (jetcandidateutilities::isDaughterTrack(track, candidate)) {
145-
continue;
146+
isSelected = false;
147+
break;
146148
}
147149
}
150+
if (!isSelected) {
151+
continue;
152+
}
148153
fastjetutilities::fillTracks(track, inputParticles, track.globalIndex());
149154
}
150155
}
@@ -376,19 +381,25 @@ void analyseParticles(std::vector<fastjet::PseudoJet>& inputParticles, const std
376381
}
377382
}
378383
}
384+
bool isSelected = true;
379385
if constexpr (jetv0utilities::isV0McTable<U>()) { // note that for V0s the candidate table is given to this function, not a single candidate
380386
if (candidate != nullptr) {
381387
for (auto const& cand : (*candidate)) {
382388
if (cand.mcParticleId() == particle.globalIndex()) {
383-
continue;
389+
isSelected = false;
390+
break;
384391
}
385392
auto v0Particle = cand.template mcParticle_as<T>();
386393
if (jetcandidateutilities::isDaughterParticle(v0Particle, particle.globalIndex())) {
387-
continue;
394+
isSelected = false;
395+
break;
388396
}
389397
}
390398
}
391399
}
400+
if (!isSelected) {
401+
continue;
402+
}
392403
fastjetutilities::fillTracks(particle, inputParticles, particle.globalIndex(), JetConstituentStatus::track, pdgParticle->Mass());
393404
}
394405
}

0 commit comments

Comments
 (0)