Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 10 additions & 16 deletions PWGLF/DataModel/LFSigmaTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include "PWGLF/DataModel/LFStrangenessTables.h"

#include "Common/Core/RecoDecay.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/Qvectors.h"

#include "PWGLF/DataModel/LFStrangenessTables.h"

#include "CommonConstants/PhysicsConstants.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
Expand All @@ -29,7 +29,7 @@
#ifndef PWGLF_DATAMODEL_LFSIGMATABLES_H_
#define PWGLF_DATAMODEL_LFSIGMATABLES_H_

using std::array;

Check failure on line 32 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[import-std-name]

Do not import names from the std namespace in headers.

// Creating output TTree for sigma analysis
namespace o2::aod
Expand Down Expand Up @@ -66,7 +66,7 @@

DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt,
[](float photonPx, float photonPy, float lambdaPx, float lambdaPy) -> float {
return RecoDecay::pt(array{photonPx + lambdaPx, photonPy + lambdaPy});

Check failure on line 69 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
});

DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! Total momentum in GeV/c
Expand Down Expand Up @@ -328,10 +328,10 @@
DECLARE_SOA_COLUMN(LambdaIsCorrectlyAssoc, lambdaIsCorrectlyAssoc, bool);

DECLARE_SOA_DYNAMIC_COLUMN(IsSigma0, isSigma0, //! IsSigma0
[](int pdgCode) -> bool { return pdgCode == 3212; });

Check failure on line 331 in PWGLF/DataModel/LFSigmaTables.h

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.

Check failure on line 331 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.

DECLARE_SOA_DYNAMIC_COLUMN(IsAntiSigma0, isAntiSigma0, //! IsASigma0
[](int pdgCode) -> bool { return pdgCode == -3212; });

Check failure on line 334 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.

DECLARE_SOA_DYNAMIC_COLUMN(MCPx, mcpx, //! Sigma0 px
[](float photonMCPx, float lambdaMCPx) -> float { return photonMCPx + lambdaMCPx; });
Expand All @@ -342,7 +342,7 @@

DECLARE_SOA_DYNAMIC_COLUMN(MCPt, mcpt,
[](float photonMCPx, float photonMCPy, float lambdaMCPx, float lambdaMCPy) -> float {
return RecoDecay::pt(array{photonMCPx + lambdaMCPx, photonMCPy + lambdaMCPy});

Check failure on line 345 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
});

DECLARE_SOA_DYNAMIC_COLUMN(MCP, mcp, //! Total momentum in GeV/c
Expand Down Expand Up @@ -376,7 +376,7 @@
TVector3 v1(photonMCPx, photonMCPy, photonMCPz);
TVector3 v2(lambdaMCPx, lambdaMCPy, lambdaMCPz);
return v1.Angle(v2);
});
});

// Photon
DECLARE_SOA_DYNAMIC_COLUMN(PhotonMCPt, photonmcpt, //! Transverse momentum in GeV/c
Expand Down Expand Up @@ -425,7 +425,6 @@

DECLARE_SOA_DYNAMIC_COLUMN(LambdaMCPhi, lambdaMCPhi, //! Phi in the range [0, 2pi)
[](float lambdaMCPx, float lambdaMCPy) -> float { return RecoDecay::phi(lambdaMCPx, lambdaMCPy); });


} // namespace sigma0MCCore

Expand All @@ -436,9 +435,9 @@
sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::PhotonMCPz,
sigma0MCCore::IsPhotonPrimary, sigma0MCCore::PhotonPDGCode, sigma0MCCore::PhotonPDGCodeMother, sigma0MCCore::PhotonIsCorrectlyAssoc,

sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz,
sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz,
sigma0MCCore::IsLambdaPrimary, sigma0MCCore::LambdaPDGCode, sigma0MCCore::LambdaPDGCodeMother, sigma0MCCore::LambdaIsCorrectlyAssoc,

// Dynamic columns
sigma0MCCore::IsSigma0<sigma0MCCore::PDGCode>,
sigma0MCCore::IsAntiSigma0<sigma0MCCore::PDGCode>,
Expand All @@ -451,7 +450,7 @@
sigma0MCCore::Sigma0MCMass<sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::PhotonMCPz, sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz>,
sigma0MCCore::Sigma0MCY<sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::PhotonMCPz, sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz>,
sigma0MCCore::MCPhi<sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy>,
sigma0MCCore::MCEta<sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::PhotonMCPz, sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz>,
sigma0MCCore::MCEta<sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::PhotonMCPz, sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz>,
sigma0MCCore::MCOPAngle<sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::PhotonMCPz, sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz>,

sigma0MCCore::PhotonMCPt<sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy>,
Expand All @@ -464,10 +463,7 @@
sigma0MCCore::LambdaMCP<sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz>,
sigma0MCCore::LambdaMCEta<sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz>,
sigma0MCCore::LambdaMCY<sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz>,
sigma0MCCore::LambdaMCPhi<sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy>
);


sigma0MCCore::LambdaMCPhi<sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy>);

namespace sigma0Gen
{
Expand Down Expand Up @@ -550,7 +546,7 @@

DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt,
[](float photon1Px, float photon1Py, float photon2Px, float photon2Py) -> float {
return RecoDecay::pt(array{photon1Px + photon2Px, photon1Py + photon2Py});

Check failure on line 549 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
});

DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! Total momentum in GeV/c
Expand Down Expand Up @@ -703,12 +699,11 @@
DECLARE_SOA_COLUMN(Photon2PDGCodeMother, photon2PDGCodeMother, int);
DECLARE_SOA_COLUMN(Photon2IsCorrectlyAssoc, photon2IsCorrectlyAssoc, bool);


DECLARE_SOA_DYNAMIC_COLUMN(IsPi0, isPi0, //! IsPi0
[](int pdgCode) -> bool { return pdgCode == 111; });

Check failure on line 703 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.

DECLARE_SOA_DYNAMIC_COLUMN(IsFromXi0, isFromXi0, //! Pi0 from Xi0
[](int pdgCodeMother) -> bool { return pdgCodeMother == 3322; });

Check failure on line 706 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.

DECLARE_SOA_DYNAMIC_COLUMN(MCPx, mcpx, //! Pi0 MC px
[](float photon1MCPx, float photon2MCPx) -> float { return photon1MCPx + photon2MCPx; });
Expand All @@ -719,7 +714,7 @@

DECLARE_SOA_DYNAMIC_COLUMN(MCPt, mcpt,
[](float photon1MCPx, float photon1MCPy, float photon2MCPx, float photon2MCPy) -> float {
return RecoDecay::pt(array{photon1MCPx + photon2MCPx, photon1MCPy + photon2MCPy});

Check failure on line 717 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
});

DECLARE_SOA_DYNAMIC_COLUMN(MCP, mcp, //! Total momentum in GeV/c
Expand Down Expand Up @@ -816,7 +811,7 @@
// Dynamic columns
Pi0CoreMC::IsPi0<Pi0CoreMC::PDGCode>,
Pi0CoreMC::IsFromXi0<Pi0CoreMC::PDGCodeMother>,

Pi0CoreMC::MCPx<Pi0CoreMC::Photon1MCPx, Pi0CoreMC::Photon2MCPx>,
Pi0CoreMC::MCPy<Pi0CoreMC::Photon1MCPy, Pi0CoreMC::Photon2MCPy>,
Pi0CoreMC::MCPz<Pi0CoreMC::Photon1MCPz, Pi0CoreMC::Photon2MCPz>,
Expand All @@ -825,7 +820,7 @@
Pi0CoreMC::Pi0MCMass<Pi0CoreMC::Photon1MCPx, Pi0CoreMC::Photon1MCPy, Pi0CoreMC::Photon1MCPz, Pi0CoreMC::Photon2MCPx, Pi0CoreMC::Photon2MCPy, Pi0CoreMC::Photon2MCPz>,
Pi0CoreMC::Pi0MCY<Pi0CoreMC::Photon1MCPx, Pi0CoreMC::Photon1MCPy, Pi0CoreMC::Photon1MCPz, Pi0CoreMC::Photon2MCPx, Pi0CoreMC::Photon2MCPy, Pi0CoreMC::Photon2MCPz>,
Pi0CoreMC::MCPhi<Pi0CoreMC::Photon1MCPx, Pi0CoreMC::Photon1MCPy, Pi0CoreMC::Photon2MCPx, Pi0CoreMC::Photon2MCPy>,
Pi0CoreMC::MCEta<Pi0CoreMC::Photon1MCPx, Pi0CoreMC::Photon1MCPy, Pi0CoreMC::Photon1MCPz, Pi0CoreMC::Photon2MCPx, Pi0CoreMC::Photon2MCPy, Pi0CoreMC::Photon2MCPz>,
Pi0CoreMC::MCEta<Pi0CoreMC::Photon1MCPx, Pi0CoreMC::Photon1MCPy, Pi0CoreMC::Photon1MCPz, Pi0CoreMC::Photon2MCPx, Pi0CoreMC::Photon2MCPy, Pi0CoreMC::Photon2MCPz>,
Pi0CoreMC::MCOPAngle<Pi0CoreMC::Photon1MCPx, Pi0CoreMC::Photon1MCPy, Pi0CoreMC::Photon1MCPz, Pi0CoreMC::Photon2MCPx, Pi0CoreMC::Photon2MCPy, Pi0CoreMC::Photon2MCPz>,

Pi0CoreMC::Photon1MCPt<Pi0CoreMC::Photon1MCPx, Pi0CoreMC::Photon1MCPy>,
Expand All @@ -838,8 +833,7 @@
Pi0CoreMC::Photon2MCP<Pi0CoreMC::Photon2MCPx, Pi0CoreMC::Photon2MCPy, Pi0CoreMC::Photon2MCPz>,
Pi0CoreMC::Photon2MCEta<Pi0CoreMC::Photon2MCPx, Pi0CoreMC::Photon2MCPy, Pi0CoreMC::Photon2MCPz>,
Pi0CoreMC::Photon2MCY<Pi0CoreMC::Photon2MCPx, Pi0CoreMC::Photon2MCPy, Pi0CoreMC::Photon2MCPz>,
Pi0CoreMC::Photon2MCPhi<Pi0CoreMC::Photon2MCPx, Pi0CoreMC::Photon2MCPy>
);
Pi0CoreMC::Photon2MCPhi<Pi0CoreMC::Photon2MCPx, Pi0CoreMC::Photon2MCPy>);

DECLARE_SOA_TABLE(Pi0CollRef, "AOD", "PI0COLLREF", //! optional table to refer back to a collision
o2::soa::Index<>, v0data::StraCollisionId);
Expand Down
8 changes: 4 additions & 4 deletions PWGLF/TableProducer/Strangeness/sigma0builder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ struct sigma0builder {
float V02MCpx = -999.f;
float V02MCpy = -999.f;
float V02MCpz = -999.f;
float V0PairMCRadius = -999.f;
float V0PairMCRadius = -999.f;
};

// ______________________________________________________
Expand Down Expand Up @@ -434,10 +434,10 @@ struct sigma0builder {
}

MCinfo.V01MCpx = v01MC.pxMC();
MCinfo.V01MCpy = v01MC.pyMC();
MCinfo.V01MCpy = v01MC.pyMC();
MCinfo.V01MCpz = v01MC.pzMC();
MCinfo.V02MCpx = v02MC.pxMC();
MCinfo.V02MCpy = v02MC.pyMC();
MCinfo.V02MCpy = v02MC.pyMC();
MCinfo.V02MCpz = v02MC.pzMC();

// Get corresponding entries in MCParticles table
Expand All @@ -459,7 +459,7 @@ struct sigma0builder {
MCinfo.V0PairPDGCode = MCMother_v01.pdgCode();
MCinfo.V0PairMCProcess = MCMother_v01.getProcess();
MCinfo.V0PairMCParticleID = MCMother_v01.globalIndex();
MCinfo.V0PairMCRadius = std::hypot(MCMother_v01.vx(), MCMother_v01.vy()); // production position radius
MCinfo.V0PairMCRadius = std::hypot(MCMother_v01.vx(), MCMother_v01.vy()); // production position radius

auto const& v0pairmothers = MCMother_v01.template mothers_as<aod::McParticles>(); // Get mothers
if (!v0pairmothers.empty()) {
Expand Down
16 changes: 7 additions & 9 deletions PWGLF/Tasks/Strangeness/sigmaanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1357,16 +1357,15 @@ struct sigmaanalysis {
return false;

// Sigma0 specific selections
// Rapidity
if constexpr (requires { cand.sigma0MCY();}) { // MC
// Rapidity
if constexpr (requires { cand.sigma0MCY(); }) { // MC
if (TMath::Abs(cand.sigma0MCY()) > sigma0Selections.Sigma0MaxRap)
return false;
}
else{ // Real data
} else { // Real data
if (TMath::Abs(cand.sigma0Y()) > sigma0Selections.Sigma0MaxRap)
return false;
}

// V0Pair Radius
if (cand.radius() > sigma0Selections.Sigma0MaxRadius)
return false;
Expand Down Expand Up @@ -1489,15 +1488,14 @@ struct sigmaanalysis {
return false;

// Pi0 specific selections
if constexpr (requires { cand.pi0MCY();}) { // MC
if constexpr (requires { cand.pi0MCY(); }) { // MC
if (TMath::Abs(cand.pi0MCY()) > pi0Selections.Pi0MaxRap)
return false;
}
else{ // DATA
} else { // DATA
if (TMath::Abs(cand.pi0Y()) > pi0Selections.Pi0MaxRap)
return false;
}

// V0Pair Radius
if (cand.radius() > pi0Selections.Pi0MaxRadius)
return false;
Expand Down
Loading