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
15 changes: 15 additions & 0 deletions PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@
double centrality, int datatype)
{

auto particle1Dummy = ROOT::Math::PxPyPzMVector(particle1.Px(), particle1.Py(), particle1.Pz(), 1.115683);

Check failure on line 240 in PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
auto particle2Dummy = ROOT::Math::PxPyPzMVector(particle2.Px(), particle2.Py(), particle2.Pz(), 1.115683);

Check failure on line 241 in PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
auto pairDummy = particle1Dummy + particle2Dummy;

// auto pairParticle = particle1 + particle2;
Expand All @@ -261,7 +261,7 @@
auto proton2LambdaRF = boostLambda2ToCM(proton2pairCM);

double cosThetaDiff = proton1LambdaRF.Vect().Unit().Dot(proton2LambdaRF.Vect().Unit());
double deltaR = TMath::Sqrt(TMath::Power(particle1.Eta() - particle2.Eta(), 2.0) + TMath::Power(particle1.Phi() - particle2.Phi(), 2.0));

Check failure on line 264 in PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (datatype == 0) {
if (tag1 && tag3) {
histos.fill(HIST("hSparseLambdaLambda"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR);
Expand Down Expand Up @@ -292,7 +292,7 @@
}
}

if (datatype == 2) {

Check failure on line 295 in PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (tag1 && tag3) {
histos.fill(HIST("hSparseLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR);
}
Expand Down Expand Up @@ -480,7 +480,7 @@
Preslice<aod::V0Datas> tracksPerCollisionV0 = aod::v0data::collisionId;
void processME(EventCandidates const& collisions, AllTrackCandidates const&, ResoV0s const& V0s)
{
for (auto& [collision1, collision2] : selfCombinations(colBinning, nMix, -1, collisions, collisions)) {

Check failure on line 483 in PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.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());

if (collision1.index() == collision2.index()) {
Expand Down Expand Up @@ -512,7 +512,7 @@
continue;
}
bool pairStatus[1150][1150] = {{false}};
for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(groupV01, groupV02))) {

Check failure on line 515 in PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.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.
bool pairfound = false;
if (t2.index() <= t1.index()) {
continue;
Expand All @@ -535,6 +535,13 @@
if (lambdaTag2 && aLambdaTag2) {
continue;
}
auto postrack1 = t1.template posTrack_as<AllTrackCandidates>();
auto negtrack1 = t1.template negTrack_as<AllTrackCandidates>();
auto postrack2 = t2.template posTrack_as<AllTrackCandidates>();
auto negtrack2 = t2.template negTrack_as<AllTrackCandidates>();
if (postrack1.globalIndex() == postrack2.globalIndex() || negtrack1.globalIndex() == negtrack2.globalIndex()) {
continue;
}
for (const auto& t3 : groupV03) {
if (pairStatus[t3.index()][t2.index()]) {
// LOGF(info, "repeat match found v0 id: (%d, %d)", t3.index(), t2.index());
Expand Down Expand Up @@ -610,6 +617,7 @@
using CollisionMCRecTableCentFT0C = soa::Join<aod::Collisions, aod::CentFT0Cs, aod::EvSels>;
using TrackMCRecTable = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTPCFullPr>;
using V0TrackCandidatesMC = soa::Join<aod::V0Datas, aod::McV0Labels>;

void processMC(CollisionMCRecTableCentFT0C::iterator const& collision, TrackMCRecTable const& /*tracks*/, V0TrackCandidatesMC const& V0s)
{

Expand Down Expand Up @@ -689,7 +697,7 @@
// Processing Event Mixing MC
void processMEMC(CollisionMCRecTableCentFT0C const& collisions, TrackMCRecTable const&, V0TrackCandidatesMC const& V0s)
{
for (auto& [collision1, collision2] : selfCombinations(colBinning, nMix, -1, collisions, collisions)) {

Check failure on line 700 in PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.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());

if (collision1.index() == collision2.index()) {
Expand All @@ -716,7 +724,7 @@
continue;
}
bool pairStatus[1150][1150] = {{false}};
for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(groupV01, groupV02))) {

Check failure on line 727 in PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.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.
bool pairfound = false;
if (t2.index() <= t1.index()) {
continue;
Expand All @@ -738,6 +746,13 @@
if (lambdaTag2 && aLambdaTag2) {
continue;
}
auto postrack1 = t1.template posTrack_as<AllTrackCandidates>();
auto negtrack1 = t1.template negTrack_as<AllTrackCandidates>();
auto postrack2 = t2.template posTrack_as<AllTrackCandidates>();
auto negtrack2 = t2.template negTrack_as<AllTrackCandidates>();
if (postrack1.globalIndex() == postrack2.globalIndex() || negtrack1.globalIndex() == negtrack2.globalIndex()) {
continue;
}
for (const auto& t3 : groupV03) {
if (pairStatus[t3.index()][t2.index()]) {
// LOGF(info, "repeat match found v0 id: (%d, %d)", t3.index(), t2.index());
Expand Down
Loading