Skip to content
Merged
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
4 changes: 2 additions & 2 deletions PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <Math/GenVector/Boost.h>
#include <Math/Vector3D.h>
#include <Math/Vector4D.h>
#include <TLorentzVector.h>

Check failure on line 33 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TMath.h>
#include <TRandom3.h>

Expand All @@ -40,7 +40,7 @@
#include <cmath> // for std::fabs
#include <cstdint>
#include <deque>
#include <iostream>

Check failure on line 43 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <iterator>
#include <limits>
#include <random>
Expand Down Expand Up @@ -257,10 +257,10 @@
if (candidate.dcaBetweenDaughter() > dcaDaughters) {
return false;
}
if (candidate.v0Status() == 0 && std::abs(candidate.dcaPositive()) < dcaProton && std::abs(candidate.dcaNegative()) < dcaPion) {
if (candidate.v0Status() == 0 && (std::abs(candidate.dcaPositive()) < dcaProton || std::abs(candidate.dcaNegative()) < dcaPion)) {
return false;
}
if (candidate.v0Status() == 1 && std::abs(candidate.dcaPositive()) < dcaPion && std::abs(candidate.dcaNegative()) < dcaProton) {
if (candidate.v0Status() == 1 && (std::abs(candidate.dcaPositive()) < dcaPion || std::abs(candidate.dcaNegative()) < dcaProton)) {
return false;
}
if (candidate.lambdaPt() < ptMin) {
Expand Down Expand Up @@ -563,7 +563,7 @@
{
auto collOldIndex = -999;
std::vector<bool> t1Used;
for (auto& [collision1, collision2] : selfCombinations(colBinning, nEvtMixing, -1, collisions, collisions)) {

Check failure on line 566 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
// LOGF(info, "Mixed event collisions: (%d, %d)", collision1.index(), collision2.index());
// auto centrality = collision1.cent();
auto groupV01 = V0s.sliceBy(tracksPerCollisionV0, collision1.index());
Expand All @@ -577,7 +577,7 @@
// std::vector<bool> t1Used(groupV01.size(), false); // <-- reset here
collOldIndex = collNewIndex;
}
for (auto& [t1, t3] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(groupV01, groupV03))) {

Check failure on line 580 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (t1Used[t1.index()]) {
continue;
}
Expand Down Expand Up @@ -632,7 +632,7 @@
auto nBins = colBinning.getAllBinsCount();
std::vector<std::deque<std::pair<int, AllTrackCandidates>>> eventPools(nBins);

for (auto& collision1 : collisions) {

Check failure on line 635 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
int bin = colBinning.getBin(std::make_tuple(collision1.posz(), collision1.cent()));
auto poolA = V0s.sliceBy(tracksPerCollisionV0, collision1.index());
// float centrality = collision1.cent();
Expand All @@ -640,7 +640,7 @@
// <<< CHANGED: map old collision index → set of (t2.idx, t3.idx) we've already filled
std::unordered_map<int, std::set<std::pair<int, int>>> seenMap;

for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(poolA, poolA))) {

Check failure on line 643 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!selectionV0(t1) || !selectionV0(t2))
continue;
if (t2.index() <= t1.index())
Expand All @@ -656,7 +656,7 @@
AllTrackCandidates& poolB = it->second;

int nRepl = 0;
for (auto& t3 : poolB) {

Check failure on line 659 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (selectionV0(t3) && checkKinematics(t1, t3)) {
++nRepl;
}
Expand All @@ -665,7 +665,7 @@
continue;
float invN = 1.0f / static_cast<float>(nRepl);

for (auto& t3 : poolB) {

Check failure on line 668 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!(selectionV0(t3) && checkKinematics(t1, t3))) {
continue;
}
Expand Down Expand Up @@ -719,7 +719,7 @@
auto nBins = colBinning.getAllBinsCount();
std::vector<std::deque<std::pair<int, AllTrackCandidates>>> eventPools(nBins);

for (auto& collision1 : collisions) {

Check failure on line 722 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
const int bin = colBinning.getBin(std::make_tuple(collision1.posz(), collision1.cent()));

// if pool empty, push and continue
Expand All @@ -735,7 +735,7 @@
auto poolA = V0s.sliceBy(tracksPerCollisionV0, collision1.index());

// loop over SE unordered pairs (t1,t2)
for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(poolA, poolA))) {

Check failure on line 738 in PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!selectionV0(t1) || !selectionV0(t2))
continue;
if (t2.index() <= t1.index())
Expand Down
Loading