Skip to content
37 changes: 31 additions & 6 deletions PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
#include <Math/GenVector/Boost.h>
#include <Math/Vector3D.h>
#include <Math/Vector4D.h>
#include <TLorentzVector.h>

Check failure on line 32 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 <fairlogger/Logger.h>

#include <iostream>

Check failure on line 37 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 <string>
#include <vector>
Expand Down Expand Up @@ -81,6 +81,18 @@
void init(o2::framework::InitContext&)
{
histos.add("hCentrality", "Centrality distribution", kTH1F, {{configThnAxisCentrality}});
histos.add("deltaPhiSame", "deltaPhiSame", HistType::kTH1D, {{72, 0.0, 2.0 * TMath::Pi()}}, true);

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

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
histos.add("deltaPhiMix", "deltaPhiMix", HistType::kTH1D, {{72, 0.0, 2.0 * TMath::Pi()}}, true);

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

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
histos.add("ptCent", "ptCent", HistType::kTH2D, {{100, 0.0, 10.0}, {8, 0.0, 80.0}}, true);
histos.add("etaCent", "etaCent", HistType::kTH2D, {{32, -0.8, 0.8}, {8, 0.0, 80.0}}, true);

histos.add("hLambdaSameForLL", "hLambdaSameForLL", HistType::kTH3D, {{50, 0.0, 5.0}, {32, -0.8, 0.8}, {72, 0.0, 2.0 * TMath::Pi()}}, true);

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

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
histos.add("hLambdaSameForLAL", "hLambdaSameForLAL", HistType::kTH3D, {{50, 0.0, 5.0}, {32, -0.8, 0.8}, {72, 0.0, 2.0 * TMath::Pi()}}, true);

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

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
histos.add("hAntiLambdaSameForALAL", "hAntiLambdaSameForALAL", HistType::kTH3D, {{50, 0.0, 5.0}, {32, -0.8, 0.8}, {72, 0.0, 2.0 * TMath::Pi()}}, true);

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

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.

histos.add("hLambdaMixForLL", "hLambdaMixForLL", HistType::kTH3D, {{50, 0.0, 5.0}, {32, -0.8, 0.8}, {72, 0.0, 2.0 * TMath::Pi()}}, true);

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

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
histos.add("hLambdaMixForLAL", "hLambdaMixForLAL", HistType::kTH3D, {{50, 0.0, 5.0}, {32, -0.8, 0.8}, {72, 0.0, 2.0 * TMath::Pi()}}, true);

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

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
histos.add("hAntiLambdaMixForALAL", "hAntiLambdaMixForALAL", HistType::kTH3D, {{50, 0.0, 5.0}, {32, -0.8, 0.8}, {72, 0.0, 2.0 * TMath::Pi()}}, true);

histos.add("hSparseLambdaLambda", "hSparseLambdaLambda", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisInvMass, configThnAxisPol, configThnAxisCentrality, configThnAxisR}, true);
histos.add("hSparseLambdaAntiLambda", "hSparseLambdaAntiLambda", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisInvMass, configThnAxisPol, configThnAxisCentrality, configThnAxisR}, true);
Expand Down Expand Up @@ -127,13 +139,16 @@
template <typename T1, typename T2>
bool checkKinematics(T1 const& candidate1, T2 const& candidate2)
{
if (candidate1.v0Status() != candidate2.v0Status()) {
return false;
}
if (std::abs(candidate1.lambdaPt() - candidate2.lambdaPt()) > ptMix) {
return false;
}
if (std::abs(candidate1.lambdaEta() - candidate2.lambdaEta()) > etaMix) {
return false;
}
if (std::abs(candidate1.lambdaPhi() - candidate2.lambdaPhi()) > phiMix) {
if (std::abs(RecoDecay::constrainAngle(candidate1.lambdaPhi(), 0.0F) - RecoDecay::constrainAngle(candidate2.lambdaPhi(), 0.0F)) > phiMix) {
return false;
}
if (std::abs(candidate1.lambdaMass() - candidate2.lambdaMass()) > massMix) {
Expand Down Expand Up @@ -179,25 +194,31 @@

auto cosThetaDiff = -999.0;
cosThetaDiff = proton1LambdaRF.Vect().Unit().Dot(proton2LambdaRF.Vect().Unit());
double deltaPhi = RecoDecay::constrainAngle(particle1Dummy.Phi() - particle2Dummy.Phi(), 0.0F, 2U);
double deltaPhi = std::abs(RecoDecay::constrainAngle(particle1Dummy.Phi(), 0.0F) - RecoDecay::constrainAngle(particle2Dummy.Phi(), 0.0F));
double deltaEta = particle1Dummy.Eta() - particle2Dummy.Eta();
double deltaR = TMath::Sqrt(deltaEta * deltaEta + deltaPhi * deltaPhi);

if (datatype == 0) {
if (tag1 == 0 && tag2 == 0) {
histos.fill(HIST("hSparseLambdaLambda"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR);
histos.fill(HIST("hLambdaSameForLL"), particle1.Pt(), particle1.Eta(), RecoDecay::constrainAngle(particle1.Phi(), 0.0F));
} else if ((tag1 == 0 && tag2 == 1) || (tag1 == 1 && tag2 == 0)) {
histos.fill(HIST("hSparseLambdaAntiLambda"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR);
histos.fill(HIST("hLambdaSameForLAL"), particle1.Pt(), particle1.Eta(), RecoDecay::constrainAngle(particle1.Phi(), 0.0F));

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
} else if (tag1 == 1 && tag2 == 1) {
histos.fill(HIST("hSparseAntiLambdaAntiLambda"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR);
histos.fill(HIST("hAntiLambdaSameForALAL"), particle1.Pt(), particle1.Eta(), RecoDecay::constrainAngle(particle1.Phi(), 0.0F));
}
} else if (datatype == 1) {
if (tag1 == 0 && tag2 == 0) {
histos.fill(HIST("hSparseLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR);
histos.fill(HIST("hLambdaMixForLL"), particle1.Pt(), particle1.Eta(), RecoDecay::constrainAngle(particle1.Phi(), 0.0F));
} else if ((tag1 == 0 && tag2 == 1) || (tag1 == 1 && tag2 == 0)) {
histos.fill(HIST("hSparseLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR);
histos.fill(HIST("hLambdaMixForLAL"), particle1.Pt(), particle1.Eta(), RecoDecay::constrainAngle(particle1.Phi(), 0.0F));
} else if (tag1 == 1 && tag2 == 1) {
histos.fill(HIST("hSparseAntiLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR);
histos.fill(HIST("hAntiLambdaMixForALAL"), particle1.Pt(), particle1.Eta(), RecoDecay::constrainAngle(particle1.Phi(), 0.0F));
}
}
}
Expand All @@ -218,6 +239,8 @@
if (!selectionV0(v0)) {
continue;
}
histos.fill(HIST("ptCent"), v0.lambdaPt(), centrality);
histos.fill(HIST("etaCent"), v0.lambdaEta(), centrality);
proton = ROOT::Math::PtEtaPhiMVector(v0.protonPt(), v0.protonEta(), v0.protonPhi(), o2::constants::physics::MassProton);
lambda = ROOT::Math::PtEtaPhiMVector(v0.lambdaPt(), v0.lambdaEta(), v0.lambdaPhi(), v0.lambdaMass());
for (const auto& v02 : V0s) {
Expand All @@ -235,6 +258,7 @@
}
proton2 = ROOT::Math::PtEtaPhiMVector(v02.protonPt(), v02.protonEta(), v02.protonPhi(), o2::constants::physics::MassProton);
lambda2 = ROOT::Math::PtEtaPhiMVector(v02.lambdaPt(), v02.lambdaEta(), v02.lambdaPhi(), v02.lambdaMass());
histos.fill(HIST("deltaPhiSame"), std::abs(RecoDecay::constrainAngle(v0.lambdaPhi(), 0.0F) - RecoDecay::constrainAngle(v02.lambdaPhi(), 0.0F)));
if (v0.v0Status() == 0 && v02.v0Status() == 0) {
fillHistograms(0, 0, lambda, lambda2, proton, proton2, centrality, 0);
}
Expand Down Expand Up @@ -264,9 +288,9 @@
for (auto& [collision1, collision2] : selfCombinations(colBinning, nEvtMixing, -1, collisions, collisions)) {
// LOGF(info, "Mixed event collisions: (%d, %d)", collision1.index(), collision2.index());
auto centrality = collision1.cent();
auto groupV01 = V0s.sliceBy(tracksPerCollisionV0, collision1.globalIndex());
auto groupV02 = V0s.sliceBy(tracksPerCollisionV0, collision1.globalIndex());
auto groupV03 = V0s.sliceBy(tracksPerCollisionV0, collision2.globalIndex());
auto groupV01 = V0s.sliceBy(tracksPerCollisionV0, collision1.index());
auto groupV02 = V0s.sliceBy(tracksPerCollisionV0, collision1.index());
auto groupV03 = V0s.sliceBy(tracksPerCollisionV0, collision2.index());
auto collNewIndex = collision1.index();
// LOGF(info, "Mixed event collisions: (%d, %d)", collNewIndex, collOldIndex);
if (collOldIndex != collNewIndex) {
Expand Down Expand Up @@ -306,6 +330,7 @@
lambda = ROOT::Math::PtEtaPhiMVector(t3.lambdaPt(), t3.lambdaEta(), t3.lambdaPhi(), t3.lambdaMass());
proton2 = ROOT::Math::PtEtaPhiMVector(t2.protonPt(), t2.protonEta(), t2.protonPhi(), o2::constants::physics::MassProton);
lambda2 = ROOT::Math::PtEtaPhiMVector(t2.lambdaPt(), t2.lambdaEta(), t2.lambdaPhi(), t2.lambdaMass());
histos.fill(HIST("deltaPhiMix"), std::abs(RecoDecay::constrainAngle(t3.lambdaPhi(), 0.0F) - RecoDecay::constrainAngle(t2.lambdaPhi(), 0.0F)));
if (t3.v0Status() == 0 && t2.v0Status() == 0) {
fillHistograms(0, 0, lambda, lambda2, proton, proton2, centrality, 1);
}
Expand All @@ -322,7 +347,7 @@
} // replacement track pair
} // collision pair
}
PROCESS_SWITCH(lambdaspincorrderived, processME, "Process data ME", true);
PROCESS_SWITCH(lambdaspincorrderived, processME, "Process data ME", false);
};
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
Expand Down
Loading