From 51639945c35f4f5f3b8cdd4f5416d1df9724a618 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 22 Aug 2025 09:33:19 +0000 Subject: [PATCH] Please consider the following formatting changes --- PWGLF/DataModel/LFSigmaTables.h | 316 +++++------ .../Strangeness/sigma0builder.cxx | 505 +++++++++--------- .../Strangeness/strangenessbuilder.cxx | 3 +- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 339 ++++++------ 4 files changed, 586 insertions(+), 577 deletions(-) diff --git a/PWGLF/DataModel/LFSigmaTables.h b/PWGLF/DataModel/LFSigmaTables.h index 116928c61c3..4f0985adcdb 100644 --- a/PWGLF/DataModel/LFSigmaTables.h +++ b/PWGLF/DataModel/LFSigmaTables.h @@ -9,17 +9,20 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Math/Vector3D.h" -#include "TVector3.h" -#include -#include -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Qvectors.h" + #include "CommonConstants/PhysicsConstants.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" + +#include "Math/Vector3D.h" +#include "TVector3.h" + +#include +#include #ifndef PWGLF_DATAMODEL_LFSIGMATABLES_H_ #define PWGLF_DATAMODEL_LFSIGMATABLES_H_ @@ -35,8 +38,8 @@ namespace sigma0Core { DECLARE_SOA_COLUMN(X, x, float); DECLARE_SOA_COLUMN(Y, y, float); -DECLARE_SOA_COLUMN(Z, z, float); -DECLARE_SOA_COLUMN(DCADaughters, dcadaughters, float); +DECLARE_SOA_COLUMN(Z, z, float); +DECLARE_SOA_COLUMN(DCADaughters, dcadaughters, float); DECLARE_SOA_COLUMN(PhotonPx, photonPx, float); DECLARE_SOA_COLUMN(PhotonPy, photonPy, float); @@ -59,27 +62,27 @@ DECLARE_SOA_DYNAMIC_COLUMN(Py, py, //! Sigma0 py DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, //! Sigma0 pz [](float photonPz, float lambdaPz) -> float { return photonPz + lambdaPz; }); -DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, +DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float photonPx, float photonPy, float lambdaPx, float lambdaPy) -> float { - return RecoDecay::pt(array{photonPx + lambdaPx, photonPy + lambdaPy}); + return RecoDecay::pt(array{photonPx + lambdaPx, photonPy + lambdaPy}); }); DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! Total momentum in GeV/c [](float photonPx, float photonPy, float photonPz, float lambdaPx, float lambdaPy, float lambdaPz) -> float { - return RecoDecay::sqrtSumOfSquares(photonPx+lambdaPx, photonPy+lambdaPy, photonPz+lambdaPz); - }); - -DECLARE_SOA_DYNAMIC_COLUMN(Sigma0Mass, sigma0Mass, + return RecoDecay::sqrtSumOfSquares(photonPx + lambdaPx, photonPy + lambdaPy, photonPz + lambdaPz); + }); + +DECLARE_SOA_DYNAMIC_COLUMN(Sigma0Mass, sigma0Mass, [](float photonPx, float photonPy, float photonPz, float lambdaPx, float lambdaPy, float lambdaPz) -> float { - std::array pVecPhotons{photonPx, photonPy, photonPz}; - std::array pVecLambda{lambdaPx, lambdaPy, lambdaPz}; - auto arrMom = std::array{pVecPhotons, pVecLambda}; - return RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); - }); - -DECLARE_SOA_DYNAMIC_COLUMN(Sigma0Y, sigma0Y, + std::array pVecPhotons{photonPx, photonPy, photonPz}; + std::array pVecLambda{lambdaPx, lambdaPy, lambdaPz}; + auto arrMom = std::array{pVecPhotons, pVecLambda}; + return RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); + }); + +DECLARE_SOA_DYNAMIC_COLUMN(Sigma0Y, sigma0Y, [](float photonPx, float photonPy, float photonPz, float lambdaPx, float lambdaPy, float lambdaPz) -> float { - return RecoDecay::y(std::array{photonPx+lambdaPx, photonPy+lambdaPy, photonPz+lambdaPz}, o2::constants::physics::MassSigma0); + return RecoDecay::y(std::array{photonPx + lambdaPx, photonPy + lambdaPy, photonPz + lambdaPz}, o2::constants::physics::MassSigma0); }); DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, //! Phi in the range [0, 2pi) @@ -87,19 +90,19 @@ DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, //! Phi in the range [0, 2pi) DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, //! Pseudorapidity [](float photonPx, float photonPy, float photonPz, float lambdaPx, float lambdaPy, float lambdaPz) -> float { - return RecoDecay::eta(std::array{photonPx+lambdaPx, photonPy+lambdaPy, photonPz+lambdaPz}); - }); - + return RecoDecay::eta(std::array{photonPx + lambdaPx, photonPy + lambdaPy, photonPz + lambdaPz}); + }); + DECLARE_SOA_DYNAMIC_COLUMN(Radius, radius, //! Sigma0 decay radius (2D, centered at zero) - [](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); }); - -DECLARE_SOA_DYNAMIC_COLUMN(OPAngle, opAngle, + [](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); }); + +DECLARE_SOA_DYNAMIC_COLUMN(OPAngle, opAngle, [](float photonPx, float photonPy, float photonPz, float lambdaPx, float lambdaPy, float lambdaPz) { - TVector3 v1(photonPx, photonPy, photonPz); - TVector3 v2(lambdaPx, lambdaPy, lambdaPz); - return v1.Angle(v2); - }); - + TVector3 v1(photonPx, photonPy, photonPz); + TVector3 v2(lambdaPx, lambdaPy, lambdaPz); + return v1.Angle(v2); + }); + // Photon DECLARE_SOA_DYNAMIC_COLUMN(PhotonPt, photonPt, //! Transverse momentum in GeV/c [](float photonPx, float photonPy) -> float { @@ -119,10 +122,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(PhotonEta, photonEta, //! Pseudorapidity, conditional DECLARE_SOA_DYNAMIC_COLUMN(PhotonY, photonY, //! Rapidity [](float photonPx, float photonPy, float photonPz) -> float { return RecoDecay::y(std::array{photonPx, photonPy, photonPz}, o2::constants::physics::MassGamma); - }); - + }); + DECLARE_SOA_DYNAMIC_COLUMN(PhotonPhi, photonPhi, //! Phi in the range [0, 2pi) - [](float photonPx, float photonPy) -> float { return RecoDecay::phi(photonPx, photonPy); }); + [](float photonPx, float photonPy) -> float { return RecoDecay::phi(photonPx, photonPy); }); // Lambda/ALambda DECLARE_SOA_DYNAMIC_COLUMN(LambdaPt, lambdaPt, //! Transverse momentum in GeV/c @@ -133,7 +136,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(LambdaPt, lambdaPt, //! Transverse momentum in GeV/c DECLARE_SOA_DYNAMIC_COLUMN(LambdaP, lambdap, //! Total momentum in GeV/c [](float lambdaPx, float lambdaPy, float lambdaPz) -> float { return RecoDecay::sqrtSumOfSquares(lambdaPx, lambdaPy, lambdaPz); - }); + }); DECLARE_SOA_DYNAMIC_COLUMN(LambdaEta, lambdaEta, //! Pseudorapidity, conditionally defined to avoid FPEs [](float lambdaPx, float lambdaPy, float lambdaPz) -> float { @@ -143,11 +146,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(LambdaEta, lambdaEta, //! Pseudorapidity, conditional DECLARE_SOA_DYNAMIC_COLUMN(LambdaY, lambdaY, //! Rapidity [](float lambdaPx, float lambdaPy, float lambdaPz) -> float { return RecoDecay::y(std::array{lambdaPx, lambdaPy, lambdaPz}, o2::constants::physics::MassLambda); - }); - -DECLARE_SOA_DYNAMIC_COLUMN(LambdaPhi, lambdaPhi, //! Phi in the range [0, 2pi) - [](float lambdaPx, float lambdaPy) -> float { return RecoDecay::phi(lambdaPx, lambdaPy); }); + }); +DECLARE_SOA_DYNAMIC_COLUMN(LambdaPhi, lambdaPhi, //! Phi in the range [0, 2pi) + [](float lambdaPx, float lambdaPy) -> float { return RecoDecay::phi(lambdaPx, lambdaPy); }); } // namespace sigma0Core @@ -158,29 +160,29 @@ DECLARE_SOA_TABLE(Sigma0Cores, "AOD", "SIGMA0CORES", sigma0Core::LambdaPx, sigma0Core::LambdaPy, sigma0Core::LambdaPz, sigma0Core::LambdaMass, sigma0Core::AntiLambdaMass, // Dynamic columns - sigma0Core::Px, - sigma0Core::Py, - sigma0Core::Pz, - sigma0Core::Pt, - sigma0Core::P, - sigma0Core::Sigma0Mass, - sigma0Core::Sigma0Y, - sigma0Core::Phi, - sigma0Core::Eta, - sigma0Core::Radius, - sigma0Core::OPAngle, - - sigma0Core::PhotonPt, - sigma0Core::PhotonP, - sigma0Core::PhotonEta, - sigma0Core::PhotonY, - sigma0Core::PhotonPhi, - - sigma0Core::LambdaPt, - sigma0Core::LambdaP, - sigma0Core::LambdaEta, - sigma0Core::LambdaY, - sigma0Core::LambdaPhi); + sigma0Core::Px, + sigma0Core::Py, + sigma0Core::Pz, + sigma0Core::Pt, + sigma0Core::P, + sigma0Core::Sigma0Mass, + sigma0Core::Sigma0Y, + sigma0Core::Phi, + sigma0Core::Eta, + sigma0Core::Radius, + sigma0Core::OPAngle, + + sigma0Core::PhotonPt, + sigma0Core::PhotonP, + sigma0Core::PhotonEta, + sigma0Core::PhotonY, + sigma0Core::PhotonPhi, + + sigma0Core::LambdaPt, + sigma0Core::LambdaP, + sigma0Core::LambdaEta, + sigma0Core::LambdaY, + sigma0Core::LambdaPhi); // For Photon extra info namespace sigma0PhotonExtra @@ -212,21 +214,21 @@ DECLARE_SOA_COLUMN(PhotonV0Type, photonV0Type, uint8_t); } // namespace sigma0PhotonExtra -DECLARE_SOA_TABLE(Sigma0PhotonExtras, "AOD", "SIGMA0PHOTON", +DECLARE_SOA_TABLE(Sigma0PhotonExtras, "AOD", "SIGMA0PHOTON", sigma0PhotonExtra::PhotonQt, - sigma0PhotonExtra::PhotonAlpha, + sigma0PhotonExtra::PhotonAlpha, sigma0PhotonExtra::PhotonCosPA, sigma0PhotonExtra::PhotonDCADau, sigma0PhotonExtra::PhotonDCANegPV, sigma0PhotonExtra::PhotonDCAPosPV, sigma0PhotonExtra::PhotonRadius, - sigma0PhotonExtra::PhotonZconv, + sigma0PhotonExtra::PhotonZconv, sigma0PhotonExtra::PhotonPosTPCNSigmaEl, sigma0PhotonExtra::PhotonNegTPCNSigmaEl, sigma0PhotonExtra::PhotonPosTPCCrossedRows, - sigma0PhotonExtra::PhotonNegTPCCrossedRows, + sigma0PhotonExtra::PhotonNegTPCCrossedRows, sigma0PhotonExtra::PhotonPosEta, - sigma0PhotonExtra::PhotonNegEta, + sigma0PhotonExtra::PhotonNegEta, sigma0PhotonExtra::PhotonPsiPair, sigma0PhotonExtra::PhotonPosITSCls, sigma0PhotonExtra::PhotonNegITSCls, @@ -234,8 +236,8 @@ DECLARE_SOA_TABLE(Sigma0PhotonExtras, "AOD", "SIGMA0PHOTON", sigma0PhotonExtra::PhotonNegITSChi2PerNcl, sigma0PhotonExtra::PhotonPosTrackCode, sigma0PhotonExtra::PhotonNegTrackCode, - sigma0PhotonExtra::PhotonV0Type); - + sigma0PhotonExtra::PhotonV0Type); + // For Lambda extra info namespace sigma0LambdaExtra { @@ -269,7 +271,7 @@ DECLARE_SOA_COLUMN(LambdaV0Type, lambdaV0Type, uint8_t); } // namespace sigma0LambdaExtra -DECLARE_SOA_TABLE(Sigma0LambdaExtras, "AOD", "SIGMA0LAMBDA", +DECLARE_SOA_TABLE(Sigma0LambdaExtras, "AOD", "SIGMA0LAMBDA", sigma0LambdaExtra::LambdaQt, sigma0LambdaExtra::LambdaAlpha, sigma0LambdaExtra::LambdaLifeTime, @@ -277,7 +279,7 @@ DECLARE_SOA_TABLE(Sigma0LambdaExtras, "AOD", "SIGMA0LAMBDA", sigma0LambdaExtra::LambdaCosPA, sigma0LambdaExtra::LambdaDCADau, sigma0LambdaExtra::LambdaDCANegPV, - sigma0LambdaExtra::LambdaDCAPosPV, + sigma0LambdaExtra::LambdaDCAPosPV, sigma0LambdaExtra::LambdaPosPrTPCNSigma, sigma0LambdaExtra::LambdaPosPiTPCNSigma, sigma0LambdaExtra::LambdaNegPrTPCNSigma, @@ -287,18 +289,18 @@ DECLARE_SOA_TABLE(Sigma0LambdaExtras, "AOD", "SIGMA0LAMBDA", sigma0LambdaExtra::ALambdaPrTOFNSigma, sigma0LambdaExtra::ALambdaPiTOFNSigma, sigma0LambdaExtra::LambdaPosTPCCrossedRows, - sigma0LambdaExtra::LambdaNegTPCCrossedRows, + sigma0LambdaExtra::LambdaNegTPCCrossedRows, sigma0LambdaExtra::LambdaPosEta, - sigma0LambdaExtra::LambdaNegEta, + sigma0LambdaExtra::LambdaNegEta, sigma0LambdaExtra::LambdaPosITSCls, sigma0LambdaExtra::LambdaNegITSCls, sigma0LambdaExtra::LambdaPosITSChi2PerNcl, sigma0LambdaExtra::LambdaNegITSChi2PerNcl, sigma0LambdaExtra::LambdaPosTrackCode, sigma0LambdaExtra::LambdaNegTrackCode, - sigma0LambdaExtra::LambdaV0Type); + sigma0LambdaExtra::LambdaV0Type); -// for MC +// for MC namespace sigma0MCCore { DECLARE_SOA_COLUMN(MCpt, mcpt, float); @@ -321,35 +323,35 @@ DECLARE_SOA_COLUMN(LambdaPDGCodeMother, lambdaPDGCodeMother, int); DECLARE_SOA_COLUMN(LambdaIsCorrectlyAssoc, lambdaIsCorrectlyAssoc, bool); DECLARE_SOA_DYNAMIC_COLUMN(IsSigma0, isSigma0, //! IsSigma0 - [](int pdgCode) -> bool { return pdgCode==3212; }); + [](int pdgCode) -> bool { return pdgCode == 3212; }); DECLARE_SOA_DYNAMIC_COLUMN(IsAntiSigma0, isAntiSigma0, //! IsASigma0 - [](int pdgCode) -> bool { return pdgCode==-3212; }); + [](int pdgCode) -> bool { return pdgCode == -3212; }); } // namespace sigma0MCCore -DECLARE_SOA_TABLE(Sigma0MCCores, "AOD", "SIGMA0MCCORES", +DECLARE_SOA_TABLE(Sigma0MCCores, "AOD", "SIGMA0MCCORES", // Basic properties - sigma0MCCore::MCpt, sigma0MCCore::MCradius, sigma0MCCore::PDGCode, sigma0MCCore::PDGCodeMother, sigma0MCCore::MCprocess, sigma0MCCore::IsProducedByGenerator, + sigma0MCCore::MCpt, sigma0MCCore::MCradius, sigma0MCCore::PDGCode, sigma0MCCore::PDGCodeMother, sigma0MCCore::MCprocess, sigma0MCCore::IsProducedByGenerator, sigma0MCCore::PhotonMCpt, sigma0MCCore::IsPhotonPrimary, sigma0MCCore::PhotonPDGCode, sigma0MCCore::PhotonPDGCodeMother, sigma0MCCore::PhotonIsCorrectlyAssoc, sigma0MCCore::LambdaMCpt, sigma0MCCore::IsLambdaPrimary, sigma0MCCore::LambdaPDGCode, sigma0MCCore::LambdaPDGCodeMother, sigma0MCCore::LambdaIsCorrectlyAssoc, - + // Dynamic columns sigma0MCCore::IsSigma0, sigma0MCCore::IsAntiSigma0); namespace sigma0Gen { -DECLARE_SOA_COLUMN(IsSigma0, isSigma0, bool); // true: sigma0, false: antisigma0 -DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool); -DECLARE_SOA_COLUMN(Sigma0MCPt, sigma0MCPt, float); // MC pT +DECLARE_SOA_COLUMN(IsSigma0, isSigma0, bool); // true: sigma0, false: antisigma0 +DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool); +DECLARE_SOA_COLUMN(Sigma0MCPt, sigma0MCPt, float); // MC pT } // namespace sigma0Gen DECLARE_SOA_TABLE(Sigma0Gens, "AOD", "SIGMA0GENS", - sigma0Gen::IsSigma0, - sigma0Gen::ProducedByGenerator, - sigma0Gen::Sigma0MCPt); + sigma0Gen::IsSigma0, + sigma0Gen::ProducedByGenerator, + sigma0Gen::Sigma0MCPt); DECLARE_SOA_TABLE(SigmaCollRef, "AOD", "SIGMACOLLREF", //! optional table to refer back to a collision o2::soa::Index<>, v0data::StraCollisionId); @@ -418,27 +420,27 @@ DECLARE_SOA_DYNAMIC_COLUMN(Py, py, //! Sigma0 py DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, //! Sigma0 pz [](float photon1Pz, float photon2Pz) -> float { return photon1Pz + photon2Pz; }); -DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, +DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float photon1Px, float photon1Py, float photon2Px, float photon2Py) -> float { - return RecoDecay::pt(array{photon1Px + photon2Px, photon1Py + photon2Py}); + return RecoDecay::pt(array{photon1Px + photon2Px, photon1Py + photon2Py}); }); DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! Total momentum in GeV/c [](float photon1Px, float photon1Py, float photon1Pz, float photon2Px, float photon2Py, float photon2Pz) -> float { - return RecoDecay::sqrtSumOfSquares(photon1Px+photon2Px, photon1Py+photon2Py, photon1Pz+photon2Pz); - }); - -DECLARE_SOA_DYNAMIC_COLUMN(Pi0Mass, pi0Mass, + return RecoDecay::sqrtSumOfSquares(photon1Px + photon2Px, photon1Py + photon2Py, photon1Pz + photon2Pz); + }); + +DECLARE_SOA_DYNAMIC_COLUMN(Pi0Mass, pi0Mass, [](float photon1Px, float photon1Py, float photon1Pz, float photon2Px, float photon2Py, float photon2Pz) -> float { - std::array pVecPhoton1{photon1Px, photon1Py, photon1Pz}; - std::array pVecPhoton2{photon2Px, photon2Py, photon2Pz}; - auto arrMom = std::array{pVecPhoton1, pVecPhoton2}; - return RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassPhoton}); - }); - -DECLARE_SOA_DYNAMIC_COLUMN(Pi0Y, pi0Y, + std::array pVecPhoton1{photon1Px, photon1Py, photon1Pz}; + std::array pVecPhoton2{photon2Px, photon2Py, photon2Pz}; + auto arrMom = std::array{pVecPhoton1, pVecPhoton2}; + return RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassPhoton}); + }); + +DECLARE_SOA_DYNAMIC_COLUMN(Pi0Y, pi0Y, [](float photon1Px, float photon1Py, float photon1Pz, float photon2Px, float photon2Py, float photon2Pz) -> float { - return RecoDecay::y(std::array{photon1Px+photon2Px, photon1Py+photon2Py, photon1Pz+photon2Pz}, o2::constants::physics::MassPi0); + return RecoDecay::y(std::array{photon1Px + photon2Px, photon1Py + photon2Py, photon1Pz + photon2Pz}, o2::constants::physics::MassPi0); }); DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, //! Phi in the range [0, 2pi) @@ -446,18 +448,18 @@ DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, //! Phi in the range [0, 2pi) DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, //! Pseudorapidity [](float photon1Px, float photon1Py, float photon1Pz, float photon2Px, float photon2Py, float photon2Pz) -> float { - return RecoDecay::eta(std::array{photon1Px+photon2Px, photon1Py+photon2Py, photon1Pz+photon2Pz}); - }); + return RecoDecay::eta(std::array{photon1Px + photon2Px, photon1Py + photon2Py, photon1Pz + photon2Pz}); + }); DECLARE_SOA_DYNAMIC_COLUMN(Radius, radius, //! Pi0 decay radius (2D, centered at zero) - [](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); }); - -DECLARE_SOA_DYNAMIC_COLUMN(OPAngle, opAngle, + [](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); }); + +DECLARE_SOA_DYNAMIC_COLUMN(OPAngle, opAngle, [](float photon1Px, float photon1Py, float photon1Pz, float photon2Px, float photon2Py, float photon2Pz) { - TVector3 v1(photon1Px, photon1Py, photon1Pz); - TVector3 v2(photon2Px, photon2Py, photon2Pz); - return v1.Angle(v2); - }); + TVector3 v1(photon1Px, photon1Py, photon1Pz); + TVector3 v2(photon2Px, photon2Py, photon2Pz); + return v1.Angle(v2); + }); DECLARE_SOA_DYNAMIC_COLUMN(Photon1Pt, photon1Pt, //! Transverse momentum in GeV/c [](float photon1Px, float photon1Py) -> float { @@ -477,10 +479,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(Photon1Eta, photon1Eta, //! Pseudorapidity, condition DECLARE_SOA_DYNAMIC_COLUMN(Photon1Y, photon1Y, //! Rapidity [](float photon1Px, float photon1Py, float photon1Pz) -> float { return RecoDecay::y(std::array{photon1Px, photon1Py, photon1Pz}, o2::constants::physics::MassGamma); - }); - + }); + DECLARE_SOA_DYNAMIC_COLUMN(Photon1Phi, photon1Phi, //! Phi in the range [0, 2pi) - [](float photon1Px, float photon1Py) -> float { return RecoDecay::phi(photon1Px, photon1Py); }); + [](float photon1Px, float photon1Py) -> float { return RecoDecay::phi(photon1Px, photon1Py); }); DECLARE_SOA_DYNAMIC_COLUMN(Photon2Pt, photon2Pt, //! Transverse momentum in GeV/c [](float photon2Px, float photon2Py) -> float { @@ -500,55 +502,54 @@ DECLARE_SOA_DYNAMIC_COLUMN(Photon2Eta, photon2Eta, //! Pseudorapidity, condition DECLARE_SOA_DYNAMIC_COLUMN(Photon2Y, photon2Y, //! Rapidity [](float photon2Px, float photon2Py, float photon2Pz) -> float { return RecoDecay::y(std::array{photon2Px, photon2Py, photon2Pz}, o2::constants::physics::MassGamma); - }); - + }); + DECLARE_SOA_DYNAMIC_COLUMN(Photon2Phi, photon2Phi, //! Phi in the range [0, 2pi) - [](float photon2Px, float photon2Py) -> float { return RecoDecay::phi(photon2Px, photon2Py); }); + [](float photon2Px, float photon2Py) -> float { return RecoDecay::phi(photon2Px, photon2Py); }); } // namespace Pi0Core DECLARE_SOA_TABLE(Pi0Cores, "AOD", "PI0CORES", Pi0Core::X, Pi0Core::Y, Pi0Core::Z, Pi0Core::DCADaughters, Pi0Core::CosPA, - + // Photon 1 base properties Pi0Core::Photon1Px, Pi0Core::Photon1Py, Pi0Core::Photon1Pz, Pi0Core::Photon1Mass, Pi0Core::Photon1Qt, Pi0Core::Photon1Alpha, Pi0Core::Photon1DCAPosPV, Pi0Core::Photon1DCANegPV, Pi0Core::Photon1DCADau, Pi0Core::Photon1NegEta, Pi0Core::Photon1PosEta, Pi0Core::Photon1CosPA, Pi0Core::Photon1Radius, Pi0Core::Photon1Zconv, - Pi0Core::Photon1PosTPCCrossedRows, Pi0Core::Photon1NegTPCCrossedRows, Pi0Core::Photon1PosTPCNSigmaEl, Pi0Core::Photon1NegTPCNSigmaEl, Pi0Core::Photon1V0Type, - + Pi0Core::Photon1PosTPCCrossedRows, Pi0Core::Photon1NegTPCCrossedRows, Pi0Core::Photon1PosTPCNSigmaEl, Pi0Core::Photon1NegTPCNSigmaEl, Pi0Core::Photon1V0Type, + // Photon 2 base properties Pi0Core::Photon2Px, Pi0Core::Photon2Py, Pi0Core::Photon2Pz, Pi0Core::Photon2Mass, Pi0Core::Photon2Qt, Pi0Core::Photon2Alpha, Pi0Core::Photon2DCAPosPV, Pi0Core::Photon2DCANegPV, Pi0Core::Photon2DCADau, Pi0Core::Photon2NegEta, Pi0Core::Photon2PosEta, Pi0Core::Photon2CosPA, Pi0Core::Photon2Radius, Pi0Core::Photon2Zconv, - Pi0Core::Photon2PosTPCCrossedRows, Pi0Core::Photon2NegTPCCrossedRows, Pi0Core::Photon2PosTPCNSigmaEl, Pi0Core::Photon2NegTPCNSigmaEl, Pi0Core::Photon2V0Type, - + Pi0Core::Photon2PosTPCCrossedRows, Pi0Core::Photon2NegTPCCrossedRows, Pi0Core::Photon2PosTPCNSigmaEl, Pi0Core::Photon2NegTPCNSigmaEl, Pi0Core::Photon2V0Type, + // Dynamic columns - Pi0Core::Px, - Pi0Core::Py, - Pi0Core::Pz, - Pi0Core::Pt, - Pi0Core::P, - Pi0Core::Pi0Mass, - Pi0Core::Pi0Y, - Pi0Core::Phi, - Pi0Core::Eta, - Pi0Core::Radius, - Pi0Core::OPAngle, - - Pi0Core::Photon1Pt, - Pi0Core::Photon1P, - Pi0Core::Photon1Eta, - Pi0Core::Photon1Y, - Pi0Core::Photon1Phi, - - Pi0Core::Photon2Pt, - Pi0Core::Photon2P, - Pi0Core::Photon2Eta, - Pi0Core::Photon2Y, - Pi0Core::Photon2Phi); - - -// for MC + Pi0Core::Px, + Pi0Core::Py, + Pi0Core::Pz, + Pi0Core::Pt, + Pi0Core::P, + Pi0Core::Pi0Mass, + Pi0Core::Pi0Y, + Pi0Core::Phi, + Pi0Core::Eta, + Pi0Core::Radius, + Pi0Core::OPAngle, + + Pi0Core::Photon1Pt, + Pi0Core::Photon1P, + Pi0Core::Photon1Eta, + Pi0Core::Photon1Y, + Pi0Core::Photon1Phi, + + Pi0Core::Photon2Pt, + Pi0Core::Photon2P, + Pi0Core::Photon2Eta, + Pi0Core::Photon2Y, + Pi0Core::Photon2Phi); + +// for MC namespace Pi0CoreMC { DECLARE_SOA_COLUMN(MCpt, mcpt, float); @@ -571,36 +572,35 @@ 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; }); + [](int pdgCode) -> bool { return pdgCode == 111; }); DECLARE_SOA_DYNAMIC_COLUMN(IsFromXi0, isFromXi0, //! Pi0 from Xi0 - [](int pdgCodeMother) -> bool { return pdgCodeMother==3322; }); + [](int pdgCodeMother) -> bool { return pdgCodeMother == 3322; }); } // namespace Pi0CoreMC DECLARE_SOA_TABLE(Pi0CoresMC, "AOD", "PI0CORESMC", // Basic properties - Pi0CoreMC::MCpt, Pi0CoreMC::MCradius, Pi0CoreMC::PDGCode, Pi0CoreMC::PDGCodeMother, Pi0CoreMC::MCprocess, Pi0CoreMC::IsProducedByGenerator, + Pi0CoreMC::MCpt, Pi0CoreMC::MCradius, Pi0CoreMC::PDGCode, Pi0CoreMC::PDGCodeMother, Pi0CoreMC::MCprocess, Pi0CoreMC::IsProducedByGenerator, Pi0CoreMC::Photon1MCpt, Pi0CoreMC::IsPhoton1Primary, Pi0CoreMC::Photon1PDGCode, Pi0CoreMC::Photon1PDGCodeMother, Pi0CoreMC::Photon1IsCorrectlyAssoc, Pi0CoreMC::Photon2MCpt, Pi0CoreMC::IsPhoton2Primary, Pi0CoreMC::Photon2PDGCode, Pi0CoreMC::Photon2PDGCodeMother, Pi0CoreMC::Photon2IsCorrectlyAssoc, - + // Dynamic columns Pi0CoreMC::IsPi0, Pi0CoreMC::IsFromXi0); - DECLARE_SOA_TABLE(Pi0CollRef, "AOD", "PI0COLLREF", //! optional table to refer back to a collision o2::soa::Index<>, v0data::StraCollisionId); namespace pi0Gen { -DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool); -DECLARE_SOA_COLUMN(Pi0MCPt, pi0MCPt, float); // MC pT +DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool); +DECLARE_SOA_COLUMN(Pi0MCPt, pi0MCPt, float); // MC pT } // namespace pi0Gen -DECLARE_SOA_TABLE(Pi0Gens, "AOD", "PI0GENS", +DECLARE_SOA_TABLE(Pi0Gens, "AOD", "PI0GENS", pi0Gen::ProducedByGenerator, - pi0Gen::Pi0MCPt); + pi0Gen::Pi0MCPt); DECLARE_SOA_TABLE(Pi0GenCollRef, "AOD", "PI0GENCOLLREF", //! optional table to refer back to a collision o2::soa::Index<>, v0data::StraMCCollisionId); diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index 6d5f971c1c0..9cabac924ee 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -20,37 +20,40 @@ // gianni.shigeru.setoue.liveraro@cern.ch // -#include "Math/Vector3D.h" -#include -#include -#include -#include +#include "PWGLF/DataModel/LFSigmaTables.h" +#include "PWGLF/DataModel/LFStrangenessMLTables.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/ASoA.h" -#include "ReconstructionDataFormats/Track.h" +#include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/trackUtilities.h" #include "Common/Core/TrackSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/EventSelection.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/LFStrangenessPIDTables.h" -#include "PWGLF/DataModel/LFStrangenessMLTables.h" -#include "PWGLF/DataModel/LFSigmaTables.h" +#include "Common/DataModel/TrackSelectionTables.h" + #include "CCDB/BasicCCDBManager.h" -#include "Common/CCDB/ctpRateFetcher.h" +#include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include "Math/Vector3D.h" +#include +#include #include #include -#include #include #include -#include +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -62,27 +65,27 @@ using V0DerivedMCDatas = soa::Join; using V0TOFDerivedMCDatas = soa::Join; -struct sigma0builder { +struct sigma0builder { Service ccdb; ctpRateFetcher rateFetcher; - + //__________________________________________________ // Sigma0 specific - Produces sigma0cores; // sigma0 candidates info for analysis - Produces sigmaPhotonExtras; // photons from sigma0 candidates info - Produces sigmaLambdaExtras; // lambdas from sigma0 candidates info - Produces sigma0CollRefs; // references collisions from Sigma0Cores - Produces sigma0mccores; // Reco sigma0 MC properties - Produces sigma0Gens; // Generated sigma0s - Produces sigma0GenCollRefs; // references collisions from sigma0Gens + Produces sigma0cores; // sigma0 candidates info for analysis + Produces sigmaPhotonExtras; // photons from sigma0 candidates info + Produces sigmaLambdaExtras; // lambdas from sigma0 candidates info + Produces sigma0CollRefs; // references collisions from Sigma0Cores + Produces sigma0mccores; // Reco sigma0 MC properties + Produces sigma0Gens; // Generated sigma0s + Produces sigma0GenCollRefs; // references collisions from sigma0Gens //__________________________________________________ // Pi0 specific - Produces pi0cores; // pi0 candidates info for analysis - Produces pi0coresRefs; // references collisions from photonpair - Produces pi0coresmc; // Reco pi0 MC properties - Produces pi0Gens; // Generated pi0s - Produces pi0GenCollRefs; // references collisions from pi0Gens + Produces pi0cores; // pi0 candidates info for analysis + Produces pi0coresRefs; // references collisions from photonpair + Produces pi0coresmc; // Reco pi0 MC properties + Produces pi0Gens; // Generated pi0s + Produces pi0GenCollRefs; // references collisions from pi0Gens //__________________________________________________ // pack track quality but separte also afterburner @@ -98,15 +101,15 @@ struct sigma0builder { Configurable doAssocStudy{"doAssocStudy", false, "Do v0 to collision association study."}; Configurable doPPAnalysis{"doPPAnalysis", true, "if in pp, set to true"}; - + Configurable fGetIR{"fGetIR", false, "Flag to retrieve the IR info."}; Configurable fIRCrashOnNull{"fIRCrashOnNull", false, "Flag to avoid CTP RateFetcher crash."}; Configurable irSource{"irSource", "T0VTX", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; // Tables to fill Configurable fillPi0Tables{"fillPi0Tables", false, "fill pi0 tables for QA"}; - Configurable fillSigma0Tables{"fillSigma0Tables", true, "fill sigma0 tables for analysis"}; - + Configurable fillSigma0Tables{"fillSigma0Tables", true, "fill sigma0 tables for analysis"}; + // For ML Selection Configurable useMLScores{"useMLScores", false, "use ML scores to select candidates"}; Configurable Gamma_MLThreshold{"Gamma_MLThreshold", 0.1, "Decision Threshold value to select gammas"}; @@ -136,7 +139,7 @@ struct sigma0builder { //// Sigma0 criteria: Configurable Sigma0Window{"Sigma0Window", 0.1, "Mass window around expected (in GeV/c2)"}; Configurable SigmaMaxRap{"SigmaMaxRap", 0.8, "Max sigma0 rapidity"}; - + //// Pi0 criteria:: Configurable Pi0MaxRap{"Pi0MaxRap", 0.8, "Max Pi0 Rapidity"}; Configurable Pi0MassWindow{"Pi0MassWindow", 0.115, "Mass window around expected (in GeV/c2)"}; @@ -145,7 +148,7 @@ struct sigma0builder { struct : ConfigurableGroup { Configurable doQA{"doQA", true, "If True, fill QA histos"}; Configurable mc_keepOnlyFromGenerator{"mc_keepOnlyFromGenerator", false, "Keep only mcparticles from the generator"}; - Configurable mc_keepOnlyFromTransport{"mc_keepOnlyFromTransport", false, "Keep only mcparticles from the transport code"}; + Configurable mc_keepOnlyFromTransport{"mc_keepOnlyFromTransport", false, "Keep only mcparticles from the transport code"}; Configurable mc_selectMCProcess{"mc_selectMCProcess", -1, "Keep only mcparticles produced in the selected MC process"}; Configurable mc_rapidityWindow{"mc_rapidityWindow", 0.5, "Max generated particle rapidity"}; } genSelections; @@ -158,7 +161,7 @@ struct sigma0builder { // Invariant Mass ConfigurableAxis axisSigmaMass{"axisSigmaMass", {500, 1.10f, 1.30f}, "M_{#Sigma^{0}} (GeV/c^{2})"}; ConfigurableAxis axisLambdaMass{"axisLambdaMass", {200, 1.05f, 1.151f}, "M_{#Lambda} (GeV/c^{2})"}; - ConfigurableAxis axisPhotonMass{"axisPhotonMass", {200, -0.1f, 0.5f}, "M_{#Gamma}"}; + ConfigurableAxis axisPhotonMass{"axisPhotonMass", {200, -0.1f, 0.5f}, "M_{#Gamma}"}; ConfigurableAxis axisK0SMass{"axisK0SMass", {200, 0.4f, 0.6f}, "M_{K^{0}}"}; // topological variable QA axes @@ -170,14 +173,15 @@ struct sigma0builder { ConfigurableAxis axisRapidity{"axisRapidity", {100, -2.0f, 2.0f}, "Rapidity"}; ConfigurableAxis axisCandSel{"axisCandSel", {7, 0.5f, +7.5f}, "Candidate Selection"}; ConfigurableAxis axisIRBinning{"axisIRBinning", {151, -10, 1500}, "Binning for the interaction rate (kHz)"}; - + void init(InitContext const&) - { + { LOGF(info, "Initializing now: cross-checking correctness..."); if (doprocessRealData + - doprocessRealDataWithTOF + - doprocessMonteCarlo + - doprocessMonteCarloWithTOF > 1) { + doprocessRealDataWithTOF + + doprocessMonteCarlo + + doprocessMonteCarloWithTOF > + 1) { LOGF(fatal, "You have enabled more than one process function. Please check your configuration! Aborting now."); } @@ -210,7 +214,7 @@ struct sigma0builder { histos.add("PhotonSel/hPhotonRadius", "hPhotonRadius", kTH1F, {axisRadius}); histos.add("PhotonSel/h3dPhotonMass", "h3dPhotonMass", kTH3D, {axisCentrality, axisPt, axisPhotonMass}); - histos.add("LambdaSel/h2dMassLambdaVsK0S", "h2dMassLambdaVsK0S", kTH2D, {axisLambdaMass, axisK0SMass}); + histos.add("LambdaSel/h2dMassLambdaVsK0S", "h2dMassLambdaVsK0S", kTH2D, {axisLambdaMass, axisK0SMass}); histos.add("LambdaSel/h2dMassLambdaVsGamma", "h2dMassLambdaVsGamma", kTH2D, {axisLambdaMass, axisPhotonMass}); histos.add("LambdaSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); histos.get(HIST("LambdaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); @@ -237,9 +241,9 @@ struct sigma0builder { histos.get(HIST("SigmaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Sigma Mass Window"); histos.get(HIST("SigmaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "Sigma Y Window"); - // For selection: + // For selection: histos.add("SigmaSel/hSigmaMassSelected", "hSigmaMassSelected", kTH1F, {axisSigmaMass}); - + if (doAssocStudy && (doprocessMonteCarlo || doprocessMonteCarloWithTOF)) { histos.add("V0AssoQA/h2dIRVsPt_TrueGamma", "h2dIRVsPt_TrueGamma", kTH2F, {axisIRBinning, axisPt}); histos.add("V0AssoQA/h3dPAVsIRVsPt_TrueGamma", "h3dPAVsIRVsPt_TrueGamma", kTH3F, {axisPA, axisIRBinning, axisPt}); @@ -257,21 +261,21 @@ struct sigma0builder { histos.add("MC/h2dGammaXYConversion", "h2dGammaXYConversion", kTH2F, {axisXY, axisXY}); histos.add("MC/h2dPtVsCentrality_MCAssocGamma", "h2dPtVsCentrality_MCAssocGamma", kTH2D, {axisCentrality, axisPt}); histos.add("MC/h2dPtVsCentrality_MCAssocLambda", "h2dPtVsCentrality_MCAssocLambda", kTH2D, {axisCentrality, axisPt}); - histos.add("MC/h2dPtVsCentrality_MCAssocALambda", "h2dPtVsCentrality_MCAssocALambda", kTH2D, {axisCentrality, axisPt}); + histos.add("MC/h2dPtVsCentrality_MCAssocALambda", "h2dPtVsCentrality_MCAssocALambda", kTH2D, {axisCentrality, axisPt}); } if (doprocessGeneratedRun3 && genSelections.doQA) { - + // Pi0s histos.add("GenQA/hGenPi0", "hGenPi0", kTH1D, {axisPt}); - + auto hPrimaryPi0s = histos.add("GenQA/hPrimaryPi0s", "hPrimaryPi0s", kTH1D, {{2, -0.5f, 1.5f}}); hPrimaryPi0s->GetXaxis()->SetBinLabel(1, "All Pi0s"); - hPrimaryPi0s->GetXaxis()->SetBinLabel(2, "Primary Pi0s"); + hPrimaryPi0s->GetXaxis()->SetBinLabel(2, "Primary Pi0s"); - histos.add("GenQA/h2dPi0MCSourceVsPDGMother", "h2dPi0MCSourceVsPDGMother", kTHnSparseD, {{2, -0.5f, 1.5f}, {10001, -5000.5f, +5000.5f}}); + histos.add("GenQA/h2dPi0MCSourceVsPDGMother", "h2dPi0MCSourceVsPDGMother", kTHnSparseD, {{2, -0.5f, 1.5f}, {10001, -5000.5f, +5000.5f}}); histos.add("GenQA/h2dPi0NDaughtersVsPDG", "h2dPi0NDaughtersVsPDG", kTHnSparseD, {{10, -0.5f, +9.5f}, {10001, -5000.5f, +5000.5f}}); - + auto h2DGenPi0TypeVsProducedByGen = histos.add("GenQA/h2DGenPi0TypeVsProducedByGen", "h2DGenPi0TypeVsProducedByGen", kTH2D, {{2, -0.5f, 1.5f}, {2, -0.5f, 1.5f}}); h2DGenPi0TypeVsProducedByGen->GetXaxis()->SetBinLabel(1, "Sterile"); h2DGenPi0TypeVsProducedByGen->GetXaxis()->SetBinLabel(2, "Non-Sterile"); @@ -280,74 +284,73 @@ struct sigma0builder { // ______________________________________________________ // Sigma0s - histos.add("GenQA/hGenSigma0", "hGenSigma0", kTH1D, {axisPt}); - histos.add("GenQA/hGenAntiSigma0", "hGenAntiSigma0", kTH1D, {axisPt}); - - histos.add("GenQA/h2dGenSigma0xy_Generator", "hGenSigma0xy_Generator", kTH2D, {axisXY, axisXY}); - histos.add("GenQA/h2dGenSigma0xy_Transport", "hGenSigma0xy_Transport", kTH2D, {axisXY, axisXY}); - histos.add("GenQA/hGenSigma0Radius_Generator", "hGenSigma0Radius_Generator", kTH1D, {axisRadius}); - histos.add("GenQA/hGenSigma0Radius_Transport", "hGenSigma0Radius_Transport", kTH1D, {axisRadius}); - - histos.add("GenQA/h2dSigma0MCSourceVsPDGMother", "h2dSigma0MCSourceVsPDGMother", kTHnSparseD, {{2, -0.5f, 1.5f}, {10001, -5000.5f, +5000.5f}}); + histos.add("GenQA/hGenSigma0", "hGenSigma0", kTH1D, {axisPt}); + histos.add("GenQA/hGenAntiSigma0", "hGenAntiSigma0", kTH1D, {axisPt}); + + histos.add("GenQA/h2dGenSigma0xy_Generator", "hGenSigma0xy_Generator", kTH2D, {axisXY, axisXY}); + histos.add("GenQA/h2dGenSigma0xy_Transport", "hGenSigma0xy_Transport", kTH2D, {axisXY, axisXY}); + histos.add("GenQA/hGenSigma0Radius_Generator", "hGenSigma0Radius_Generator", kTH1D, {axisRadius}); + histos.add("GenQA/hGenSigma0Radius_Transport", "hGenSigma0Radius_Transport", kTH1D, {axisRadius}); + + histos.add("GenQA/h2dSigma0MCSourceVsPDGMother", "h2dSigma0MCSourceVsPDGMother", kTHnSparseD, {{2, -0.5f, 1.5f}, {10001, -5000.5f, +5000.5f}}); histos.add("GenQA/h2dSigma0NDaughtersVsPDG", "h2dSigma0NDaughtersVsPDG", kTHnSparseD, {{10, -0.5f, +9.5f}, {10001, -5000.5f, +5000.5f}}); - + auto hPrimarySigma0s = histos.add("GenQA/hPrimarySigma0s", "hPrimarySigma0s", kTH1D, {{2, -0.5f, 1.5f}}); hPrimarySigma0s->GetXaxis()->SetBinLabel(1, "All Sigma0s"); - hPrimarySigma0s->GetXaxis()->SetBinLabel(2, "Primary Sigma0s"); - + hPrimarySigma0s->GetXaxis()->SetBinLabel(2, "Primary Sigma0s"); + auto hGenSpecies = histos.add("GenQA/hGenSpecies", "hGenSpecies", kTH1D, {{4, -0.5f, 3.5f}}); hGenSpecies->GetXaxis()->SetBinLabel(1, "All Prim. Lambda"); hGenSpecies->GetXaxis()->SetBinLabel(2, "All Prim. ALambda"); hGenSpecies->GetXaxis()->SetBinLabel(5, "All Sigma0s"); hGenSpecies->GetXaxis()->SetBinLabel(6, "All ASigma0s"); - histos.add("GenQA/hSigma0NDau", "hSigma0NDau", kTH1D, {{10, -0.5f, +9.5f}}); - histos.add("GenQA/h2dSigma0NDauVsProcess", "h2dSigma0NDauVsProcess", kTH2D, {{10, -0.5f, +9.5f}, {50, -0.5f, 49.5f}}); + histos.add("GenQA/hSigma0NDau", "hSigma0NDau", kTH1D, {{10, -0.5f, +9.5f}}); + histos.add("GenQA/h2dSigma0NDauVsProcess", "h2dSigma0NDauVsProcess", kTH2D, {{10, -0.5f, +9.5f}, {50, -0.5f, 49.5f}}); auto h2DGenSigma0TypeVsProducedByGen = histos.add("GenQA/h2DGenSigma0TypeVsProducedByGen", "h2DGenSigma0TypeVsProducedByGen", kTH2D, {{2, -0.5f, 1.5f}, {2, -0.5f, 1.5f}}); h2DGenSigma0TypeVsProducedByGen->GetXaxis()->SetBinLabel(1, "Sterile"); h2DGenSigma0TypeVsProducedByGen->GetXaxis()->SetBinLabel(2, "Non-Sterile"); h2DGenSigma0TypeVsProducedByGen->GetYaxis()->SetBinLabel(1, "Generator"); h2DGenSigma0TypeVsProducedByGen->GetYaxis()->SetBinLabel(2, "Transport"); - } } // ______________________________________________________ // Struct to store V0Pair properties struct V0PairTopoInfo { - float X=-999.f; - float Y=-999.f; - float Z=-999.f; - float DCADau=-999.f; - float CosPA=-1.f; + float X = -999.f; + float Y = -999.f; + float Z = -999.f; + float DCADau = -999.f; + float CosPA = -1.f; }; // ______________________________________________________ // Struct to store V0Pair MC properties - struct V0PairMCInfo { - bool fIsV01CorrectlyAssign=false; - bool fIsV02CorrectlyAssign=false; - bool fIsV01Primary=false; - bool fIsV02Primary=false; - bool fV0PairProducedByGenerator = false; - int V01PDGCode=0; - int V02PDGCode=0; - int V01PDGCodeMother=0; - int V02PDGCodeMother=0; - int V0PairPDGCode=0; - int V0PairPDGCodeMother=0; - int V0PairMCProcess=-1; - int V0PairMCParticleID=-1; - float V01MCpT=-999.f; - float V02MCpT=-999.f; - float V0PairMCRadius=-999.f; - float V0PairMCpT=-999.f; + struct V0PairMCInfo { + bool fIsV01CorrectlyAssign = false; + bool fIsV02CorrectlyAssign = false; + bool fIsV01Primary = false; + bool fIsV02Primary = false; + bool fV0PairProducedByGenerator = false; + int V01PDGCode = 0; + int V02PDGCode = 0; + int V01PDGCodeMother = 0; + int V02PDGCodeMother = 0; + int V0PairPDGCode = 0; + int V0PairPDGCodeMother = 0; + int V0PairMCProcess = -1; + int V0PairMCParticleID = -1; + float V01MCpT = -999.f; + float V02MCpT = -999.f; + float V0PairMCRadius = -999.f; + float V0PairMCpT = -999.f; }; - // ______________________________________________________ + // ______________________________________________________ // Struct to store V0Pair Generated properties - struct V0PairGenInfo { + struct V0PairGenInfo { bool IsPrimary = false; bool IsV0Lambda = false; bool IsV0AntiLambda = false; @@ -359,14 +362,15 @@ struct sigma0builder { int MCProcess = -1; int MCCollId = -1; int PDGCodeMother = 0; - int NDaughters = -1; + int NDaughters = -1; float MCPt = -999.f; - float MCvx = 999.f; - float MCvy = 999.f; + float MCvx = 999.f; + float MCvy = 999.f; }; template - V0PairTopoInfo propagateV0PairToDCA(TV01 const& v01, TV02 const& v02) { + V0PairTopoInfo propagateV0PairToDCA(TV01 const& v01, TV02 const& v02) + { V0PairTopoInfo info; // Positions @@ -396,79 +400,80 @@ struct sigma0builder { // Calculate properties and fill struct info.DCADau = (cross.Mag2() > 0) ? std::abs(posdiff.Dot(cross)) / cross.R() : 999.f; info.CosPA = v01momentumNorm.Dot(v02momentumNorm); - - if (d < 1e-5f) { // Parallel or nearly parallel lines - info.X = info.Y = info.Z = 0.f; // should we use another dummy value? Perhaps 999.f? + + if (d < 1e-5f) { // Parallel or nearly parallel lines + info.X = info.Y = info.Z = 0.f; // should we use another dummy value? Perhaps 999.f? return info; } - + info.X = PCA.X(); info.Y = PCA.Y(); - info.Z = PCA.Z(); + info.Z = PCA.Z(); return info; } template - V0PairMCInfo getV0PairMCInfo(TV01 const& v01, TV02 const& v02, TCollision const& collision, TMCParticles const& mcparticles) { + V0PairMCInfo getV0PairMCInfo(TV01 const& v01, TV02 const& v02, TCollision const& collision, TMCParticles const& mcparticles) + { V0PairMCInfo MCinfo; - + if (!v01.has_v0MCCore() || !v02.has_v0MCCore()) return MCinfo; - + auto v01MC = v01.template v0MCCore_as>(); auto v02MC = v02.template v0MCCore_as>(); if (collision.has_straMCCollision()) { - auto MCCollision = collision.template straMCCollision_as>(); - MCinfo.fIsV01CorrectlyAssign = (v01MC.straMCCollisionId() == MCCollision.globalIndex()); + auto MCCollision = collision.template straMCCollision_as>(); + MCinfo.fIsV01CorrectlyAssign = (v01MC.straMCCollisionId() == MCCollision.globalIndex()); MCinfo.fIsV02CorrectlyAssign = (v02MC.straMCCollisionId() == MCCollision.globalIndex()); } - + // Get corresponding entries in MCParticles table auto MCParticle_v01 = mcparticles.rawIteratorAt(v01MC.particleIdMC()); auto MCParticle_v02 = mcparticles.rawIteratorAt(v02MC.particleIdMC()); // Get MC Mothers - auto const& MCMothersList_v01 = MCParticle_v01.template mothers_as(); - auto const& MCMothersList_v02 = MCParticle_v02.template mothers_as(); - - if (!MCMothersList_v01.empty() && !MCMothersList_v02.empty()){ // Are there mothers? + auto const& MCMothersList_v01 = MCParticle_v01.template mothers_as(); + auto const& MCMothersList_v02 = MCParticle_v02.template mothers_as(); + + if (!MCMothersList_v01.empty() && !MCMothersList_v02.empty()) { // Are there mothers? auto const& MCMother_v01 = MCMothersList_v01.front(); // First mother auto const& MCMother_v02 = MCMothersList_v02.front(); // First mother - if (MCMother_v01.globalIndex() == MCMother_v02.globalIndex()){ // Is it the same mother? - + if (MCMother_v01.globalIndex() == MCMother_v02.globalIndex()) { // Is it the same mother? + MCinfo.fV0PairProducedByGenerator = MCMother_v01.producedByGenerator(); 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.V0PairMCpT = MCMother_v01.pt(); + MCinfo.V0PairMCRadius = std::hypot(MCMother_v01.vx(), MCMother_v01.vy()); // production position radius + MCinfo.V0PairMCpT = MCMother_v01.pt(); auto const& v0pairmothers = MCMother_v01.template mothers_as(); // Get mothers - if (!v0pairmothers.empty()){ - auto& v0PairMother = v0pairmothers.front(); // V0Pair mother, V0s grandmother + if (!v0pairmothers.empty()) { + auto& v0PairMother = v0pairmothers.front(); // V0Pair mother, V0s grandmother MCinfo.V0PairPDGCodeMother = v0PairMother.pdgCode(); } - } + } } - + MCinfo.fIsV01Primary = v01MC.isPhysicalPrimary(); MCinfo.fIsV02Primary = v02MC.isPhysicalPrimary(); MCinfo.V01PDGCode = v01MC.pdgCode(); MCinfo.V02PDGCode = v02MC.pdgCode(); - MCinfo.V01PDGCodeMother = v01MC.pdgCodeMother(); - MCinfo.V02PDGCodeMother = v02MC.pdgCodeMother(); - + MCinfo.V01PDGCodeMother = v01MC.pdgCodeMother(); + MCinfo.V02PDGCodeMother = v02MC.pdgCodeMother(); + MCinfo.V01MCpT = RecoDecay::pt(array{v01MC.pxMC(), v01MC.pyMC()}); MCinfo.V02MCpT = RecoDecay::pt(array{v02MC.pxMC(), v02MC.pyMC()}); - + return MCinfo; } - // ______________________________________________________ + // ______________________________________________________ // MC-specific // Analyze v0-to-collision association template @@ -508,7 +513,8 @@ struct sigma0builder { } template - V0PairGenInfo getV0PairGenInfo(TMCParticle const& mcParticle) { + V0PairGenInfo getV0PairGenInfo(TMCParticle const& mcParticle) + { V0PairGenInfo GenInfo; // auxiliary struct to store info // Fill with properties @@ -521,66 +527,72 @@ struct sigma0builder { GenInfo.IsProducedByGenerator = mcParticle.producedByGenerator(); GenInfo.MCProcess = mcParticle.getProcess(); GenInfo.MCPt = mcParticle.pt(); - GenInfo.MCvx = mcParticle.vx(); // production position X - GenInfo.MCvy = mcParticle.vy(); // production position Y + GenInfo.MCvx = mcParticle.vx(); // production position X + GenInfo.MCvy = mcParticle.vy(); // production position Y - if (mcParticle.has_mcCollision()) + if (mcParticle.has_mcCollision()) GenInfo.MCCollId = mcParticle.mcCollisionId(); // save this reference, please // Checking decay mode if sigma0 - if (GenInfo.IsSigma0 || GenInfo.IsAntiSigma0 || GenInfo.IsPi0){ - + if (GenInfo.IsSigma0 || GenInfo.IsAntiSigma0 || GenInfo.IsPi0) { + // This is a costly operation, so we do it only for pi0s and sigma0s auto const& daughters = mcParticle.template daughters_as(); GenInfo.NDaughters = daughters.size(); - GenInfo.IsSterile = daughters.size()==0; + GenInfo.IsSterile = daughters.size() == 0; - auto const& GenMothersList = mcParticle.template mothers_as(); - GenInfo.PDGCodeMother = (!GenMothersList.empty()) ? GenMothersList.front().pdgCode(): 0; + auto const& GenMothersList = mcParticle.template mothers_as(); + GenInfo.PDGCodeMother = (!GenMothersList.empty()) ? GenMothersList.front().pdgCode() : 0; - if ((GenInfo.IsSigma0 || GenInfo.IsAntiSigma0) && genSelections.doQA){ - histos.fill(HIST("GenQA/h2dSigma0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); - for (auto& daughter : daughters) // checking decay modes - histos.fill(HIST("GenQA/h2dSigma0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); + if ((GenInfo.IsSigma0 || GenInfo.IsAntiSigma0) && genSelections.doQA) { + histos.fill(HIST("GenQA/h2dSigma0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); + for (auto& daughter : daughters) // checking decay modes + histos.fill(HIST("GenQA/h2dSigma0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); } - if (GenInfo.IsPi0 && genSelections.doQA){ - histos.fill(HIST("GenQA/h2dPi0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); - for (auto& daughter : daughters) // checking decay modes - histos.fill(HIST("GenQA/h2dPi0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); - } - } + if (GenInfo.IsPi0 && genSelections.doQA) { + histos.fill(HIST("GenQA/h2dPi0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); + for (auto& daughter : daughters) // checking decay modes + histos.fill(HIST("GenQA/h2dPi0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); + } + } return GenInfo; } // ______________________________________________________ - // Simulated processing (subscribes to MC information too) + // Simulated processing (subscribes to MC information too) void fillGenQAHistos(V0PairGenInfo const& GenInfo) - { - if (GenInfo.IsPi0){ + { + if (GenInfo.IsPi0) { histos.fill(HIST("GenQA/hGenPi0"), GenInfo.MCPt); histos.fill(HIST("GenQA/hPrimaryPi0s"), 0); - if (GenInfo.IsPrimary) histos.fill(HIST("GenQA/hPrimaryPi0s"), 1); - - if (GenInfo.IsSterile){ - if (GenInfo.IsProducedByGenerator) histos.fill(HIST("GenQA/h2DGenPi0TypeVsProducedByGen"), 0, 0); - else histos.fill(HIST("GenQA/h2DGenPi0TypeVsProducedByGen"), 0, 1); - } - else { - if (GenInfo.IsProducedByGenerator) histos.fill(HIST("GenQA/h2DGenPi0TypeVsProducedByGen"), 1, 0); - else histos.fill(HIST("GenQA/h2DGenPi0TypeVsProducedByGen"), 1, 1); + if (GenInfo.IsPrimary) + histos.fill(HIST("GenQA/hPrimaryPi0s"), 1); + + if (GenInfo.IsSterile) { + if (GenInfo.IsProducedByGenerator) + histos.fill(HIST("GenQA/h2DGenPi0TypeVsProducedByGen"), 0, 0); + else + histos.fill(HIST("GenQA/h2DGenPi0TypeVsProducedByGen"), 0, 1); + } else { + if (GenInfo.IsProducedByGenerator) + histos.fill(HIST("GenQA/h2DGenPi0TypeVsProducedByGen"), 1, 0); + else + histos.fill(HIST("GenQA/h2DGenPi0TypeVsProducedByGen"), 1, 1); } } - if (GenInfo.IsV0Lambda && GenInfo.IsPrimary) histos.fill(HIST("GenQA/hGenSpecies"), 0); - if (GenInfo.IsV0AntiLambda && GenInfo.IsPrimary) histos.fill(HIST("GenQA/hGenSpecies"), 1); + if (GenInfo.IsV0Lambda && GenInfo.IsPrimary) + histos.fill(HIST("GenQA/hGenSpecies"), 0); + if (GenInfo.IsV0AntiLambda && GenInfo.IsPrimary) + histos.fill(HIST("GenQA/hGenSpecies"), 1); // Checking decay mode - if (GenInfo.IsSigma0 || GenInfo.IsAntiSigma0){ + if (GenInfo.IsSigma0 || GenInfo.IsAntiSigma0) { histos.fill(HIST("GenQA/hSigma0NDau"), GenInfo.NDaughters); - histos.fill(HIST("GenQA/h2dSigma0NDauVsProcess"), GenInfo.NDaughters, GenInfo.MCProcess); + histos.fill(HIST("GenQA/h2dSigma0NDauVsProcess"), GenInfo.NDaughters, GenInfo.MCProcess); - const auto radius = std::hypot(GenInfo.MCvx, GenInfo.MCvy); + const auto radius = std::hypot(GenInfo.MCvx, GenInfo.MCvy); // Sigma0 XY and radius (separate histos for Gen/Transport) if (GenInfo.IsProducedByGenerator) { histos.fill(HIST("GenQA/h2dGenSigma0xy_Generator"), GenInfo.MCvx, GenInfo.MCvy); @@ -594,28 +606,29 @@ struct sigma0builder { const int genIndex = GenInfo.IsProducedByGenerator ? 0 : 1; // 0 = Generator, 1 = Transport const int typeIndex = GenInfo.IsSterile ? 0 : 1; // 0 = Sterile, 1 = Normal histos.fill(HIST("GenQA/h2DGenSigma0TypeVsProducedByGen"), typeIndex, genIndex); - + // Fill histograms - if (GenInfo.IsSigma0){ + if (GenInfo.IsSigma0) { histos.fill(HIST("GenQA/hGenSpecies"), 2); - histos.fill(HIST("GenQA/hGenSigma0"), GenInfo.MCPt); - + histos.fill(HIST("GenQA/hGenSigma0"), GenInfo.MCPt); + histos.fill(HIST("GenQA/hPrimarySigma0s"), 0); - if (GenInfo.IsPrimary) histos.fill(HIST("GenQA/hPrimarySigma0s"), 1); + if (GenInfo.IsPrimary) + histos.fill(HIST("GenQA/hPrimarySigma0s"), 1); } - if (GenInfo.IsAntiSigma0){ + if (GenInfo.IsAntiSigma0) { histos.fill(HIST("GenQA/hGenSpecies"), 3); - histos.fill(HIST("GenQA/hGenAntiSigma0"), GenInfo.MCPt); + histos.fill(HIST("GenQA/hGenAntiSigma0"), GenInfo.MCPt); } - } + } } - + // ______________________________________________________ - // Simulated processing (subscribes to MC information too) + // Simulated processing (subscribes to MC information too) template void genProcess(TMCParticles const& mcParticles) - { - for (auto& mcParticle : mcParticles) { + { + for (auto& mcParticle : mcParticles) { // Rapidity selection if (TMath::Abs(mcParticle.y()) > genSelections.mc_rapidityWindow) continue; @@ -632,29 +645,29 @@ struct sigma0builder { } // MC Process selection - if ((genSelections.mc_selectMCProcess >= 0) && (genSelections.mc_selectMCProcess!= mcParticle.getProcess())) + if ((genSelections.mc_selectMCProcess >= 0) && (genSelections.mc_selectMCProcess != mcParticle.getProcess())) continue; - + // Get generated particle info auto MCGenInfo = getV0PairGenInfo(mcParticle); // Fill QA histos - if (genSelections.doQA) + if (genSelections.doQA) fillGenQAHistos(MCGenInfo); // Fill tables // Pi0 - if (fillPi0Tables && MCGenInfo.IsPi0){ + if (fillPi0Tables && MCGenInfo.IsPi0) { pi0Gens(MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt); // optional table to store generated pi0 candidates. Be careful, this is a large table! - pi0GenCollRefs(MCGenInfo.MCCollId); // link to stramccollision table + pi0GenCollRefs(MCGenInfo.MCCollId); // link to stramccollision table } // Sigma0/ASigma0 - if (fillSigma0Tables && (MCGenInfo.IsSigma0 || MCGenInfo.IsAntiSigma0)){ - sigma0Gens(MCGenInfo.IsSigma0, MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt); + if (fillSigma0Tables && (MCGenInfo.IsSigma0 || MCGenInfo.IsAntiSigma0)) { + sigma0Gens(MCGenInfo.IsSigma0, MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt); sigma0GenCollRefs(MCGenInfo.MCCollId); // link to stramccollision table - } - } + } + } } //_______________________________________________ @@ -671,7 +684,7 @@ struct sigma0builder { histos.fill(HIST("PhotonSel/h2dMassGammaVsK0S"), gamma.mGamma(), gamma.mK0Short()); histos.fill(HIST("PhotonSel/h2dMassGammaVsLambda"), gamma.mGamma(), gamma.mLambda()); - if (useMLScores) { + if (useMLScores) { if (gamma.gammaBDTScore() <= Gamma_MLThreshold) return false; @@ -681,7 +694,7 @@ struct sigma0builder { histos.fill(HIST("PhotonSel/hSelectionStatistics"), 1.); histos.fill(HIST("PhotonSel/hPhotonMass"), gamma.mGamma()); if ((gamma.mGamma() < 0) || (gamma.mGamma() > PhotonMaxMass)) - return false; + return false; histos.fill(HIST("PhotonSel/hPhotonNegEta"), gamma.negativeeta()); histos.fill(HIST("PhotonSel/hPhotonPosEta"), gamma.positiveeta()); histos.fill(HIST("PhotonSel/hPhotonY"), PhotonY); @@ -703,20 +716,20 @@ struct sigma0builder { return false; histos.fill(HIST("PhotonSel/hSelectionStatistics"), 6.); } - + histos.fill(HIST("PhotonSel/h2dV0XY"), gamma.x(), gamma.y()); histos.fill(HIST("PhotonSel/h3dPhotonMass"), centrality, gamma.pt(), gamma.mGamma()); //_______________________________________________ // MC Processing - if constexpr (requires { gamma.motherMCPartId();}) { - if (gamma.has_v0MCCore()){ - auto gammaMC = gamma.template v0MCCore_as>(); + if constexpr (requires { gamma.motherMCPartId(); }) { + if (gamma.has_v0MCCore()) { + auto gammaMC = gamma.template v0MCCore_as>(); if (gammaMC.pdgCode() == 22) { - histos.fill(HIST("MC/h2dGammaXYConversion"), gamma.x(), gamma.y()); - histos.fill(HIST("MC/h2dPtVsCentrality_MCAssocGamma"), centrality, gamma.pt()); + histos.fill(HIST("MC/h2dGammaXYConversion"), gamma.x(), gamma.y()); + histos.fill(HIST("MC/h2dPtVsCentrality_MCAssocGamma"), centrality, gamma.pt()); } - } + } } return true; @@ -726,7 +739,7 @@ struct sigma0builder { // Process lambda candidate template bool processLambdaCandidate(TV0Object const& lambda, TCollision const& collision) - { + { // V0 type selection if (lambda.v0Type() != 1) return false; @@ -734,7 +747,7 @@ struct sigma0builder { float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); histos.fill(HIST("LambdaSel/h2dMassLambdaVsK0S"), lambda.mLambda(), lambda.mK0Short()); histos.fill(HIST("LambdaSel/h2dMassLambdaVsGamma"), lambda.mLambda(), lambda.mGamma()); - + if (useMLScores) { if ((lambda.lambdaBDTScore() <= Lambda_MLThreshold) && (lambda.antiLambdaBDTScore() <= AntiLambda_MLThreshold)) return false; @@ -767,20 +780,20 @@ struct sigma0builder { return false; histos.fill(HIST("LambdaSel/hSelectionStatistics"), 6.); } - + histos.fill(HIST("LambdaSel/h3dLambdaMass"), centrality, lambda.pt(), lambda.mLambda()); histos.fill(HIST("LambdaSel/h3dALambdaMass"), centrality, lambda.pt(), lambda.mAntiLambda()); //_______________________________________________ // MC Processing (if available) - if constexpr (requires { lambda.motherMCPartId();}) { - if (lambda.has_v0MCCore()){ - auto lambdaMC = lambda.template v0MCCore_as>(); + if constexpr (requires { lambda.motherMCPartId(); }) { + if (lambda.has_v0MCCore()) { + auto lambdaMC = lambda.template v0MCCore_as>(); if (lambdaMC.pdgCode() == 3122) // Is Lambda histos.fill(HIST("MC/h2dPtVsCentrality_MCAssocLambda"), centrality, lambda.pt()); if (lambdaMC.pdgCode() == -3122) // Is AntiLambda - histos.fill(HIST("MC/h2dPtVsCentrality_MCAssocALambda"), centrality, lambda.pt()); - } + histos.fill(HIST("MC/h2dPtVsCentrality_MCAssocALambda"), centrality, lambda.pt()); + } } return true; @@ -803,54 +816,53 @@ struct sigma0builder { std::array pVecGamma1{gamma1.px(), gamma1.py(), gamma1.pz()}; std::array pVecGamma2{gamma2.px(), gamma2.py(), gamma2.pz()}; std::array arrpi0{pVecGamma1, pVecGamma2}; - float pi0Mass = RecoDecay::m(arrpi0, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassPhoton}); - float pi0Y = RecoDecay::y(std::array{gamma1.px() + gamma2.px(), gamma1.py() + gamma2.py(), gamma1.pz() + gamma2.pz()}, o2::constants::physics::MassPi0); + float pi0Mass = RecoDecay::m(arrpi0, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassPhoton}); + float pi0Y = RecoDecay::y(std::array{gamma1.px() + gamma2.px(), gamma1.py() + gamma2.py(), gamma1.pz() + gamma2.pz()}, o2::constants::physics::MassPi0); //_______________________________________________ // Pi0-specific selections: - if (TMath::Abs(pi0Y) > Pi0MaxRap) + if (TMath::Abs(pi0Y) > Pi0MaxRap) return false; if (TMath::Abs(pi0Mass - o2::constants::physics::MassPi0) > Pi0MassWindow) return false; - + // Fill optional tables for QA - // Define the table! + // Define the table! auto posTrackGamma1 = gamma1.template posTrackExtra_as(); auto negTrackGamma1 = gamma1.template negTrackExtra_as(); auto posTrackGamma2 = gamma2.template posTrackExtra_as(); auto negTrackGamma2 = gamma2.template negTrackExtra_as(); - + // Calculate Pi0 topological info auto pi0TopoInfo = propagateV0PairToDCA(gamma1, gamma2); // Check if MC data and populate corresponding table if constexpr (requires { gamma1.motherMCPartId(); gamma2.motherMCPartId(); }) { auto pi0MCInfo = getV0PairMCInfo(gamma1, gamma2, collision, mcparticles); - + pi0coresmc(pi0MCInfo.V0PairMCpT, pi0MCInfo.V0PairMCRadius, pi0MCInfo.V0PairPDGCode, pi0MCInfo.V0PairPDGCodeMother, pi0MCInfo.V0PairMCProcess, pi0MCInfo.fV0PairProducedByGenerator, - pi0MCInfo.V01MCpT, pi0MCInfo.fIsV01Primary, pi0MCInfo.V01PDGCode, pi0MCInfo.V01PDGCodeMother, pi0MCInfo.fIsV01CorrectlyAssign, + pi0MCInfo.V01MCpT, pi0MCInfo.fIsV01Primary, pi0MCInfo.V01PDGCode, pi0MCInfo.V01PDGCodeMother, pi0MCInfo.fIsV01CorrectlyAssign, pi0MCInfo.V02MCpT, pi0MCInfo.fIsV02Primary, pi0MCInfo.V02PDGCode, pi0MCInfo.V02PDGCodeMother, pi0MCInfo.fIsV02CorrectlyAssign); - } - pi0cores(pi0TopoInfo.X, pi0TopoInfo.Y, pi0TopoInfo.Z, pi0TopoInfo.DCADau, pi0TopoInfo.CosPA, + pi0cores(pi0TopoInfo.X, pi0TopoInfo.Y, pi0TopoInfo.Z, pi0TopoInfo.DCADau, pi0TopoInfo.CosPA, gamma1.px(), gamma1.py(), gamma1.pz(), - gamma1.mGamma(), gamma1.qtarm(), gamma1.alpha(), gamma1.dcapostopv(), gamma1.dcanegtopv(), gamma1.dcaV0daughters(), - gamma1.negativeeta(), gamma1.positiveeta(), gamma1.v0cosPA(), gamma1.v0radius(), gamma1.z(), - posTrackGamma1.tpcCrossedRows(), negTrackGamma1.tpcCrossedRows(), posTrackGamma1.tpcNSigmaEl(), negTrackGamma1.tpcNSigmaEl(), gamma1.v0Type(), + gamma1.mGamma(), gamma1.qtarm(), gamma1.alpha(), gamma1.dcapostopv(), gamma1.dcanegtopv(), gamma1.dcaV0daughters(), + gamma1.negativeeta(), gamma1.positiveeta(), gamma1.v0cosPA(), gamma1.v0radius(), gamma1.z(), + posTrackGamma1.tpcCrossedRows(), negTrackGamma1.tpcCrossedRows(), posTrackGamma1.tpcNSigmaEl(), negTrackGamma1.tpcNSigmaEl(), gamma1.v0Type(), gamma2.px(), gamma2.py(), gamma2.pz(), - gamma2.mGamma(), gamma2.qtarm(), gamma2.alpha(), gamma2.dcapostopv(), gamma2.dcanegtopv(), gamma2.dcaV0daughters(), - gamma2.negativeeta(), gamma2.positiveeta(), gamma2.v0cosPA(), gamma2.v0radius(), gamma2.z(), + gamma2.mGamma(), gamma2.qtarm(), gamma2.alpha(), gamma2.dcapostopv(), gamma2.dcanegtopv(), gamma2.dcaV0daughters(), + gamma2.negativeeta(), gamma2.positiveeta(), gamma2.v0cosPA(), gamma2.v0radius(), gamma2.z(), posTrackGamma2.tpcCrossedRows(), negTrackGamma2.tpcCrossedRows(), posTrackGamma2.tpcNSigmaEl(), negTrackGamma2.tpcNSigmaEl(), gamma2.v0Type()); - - pi0coresRefs(collision.globalIndex()); - return true; + pi0coresRefs(collision.globalIndex()); + + return true; } //_______________________________________________ - // Build sigma0 candidate + // Build sigma0 candidate template bool buildSigma0(TV0Object const& lambda, TV0Object const& gamma, TCollision const& collision, TMCParticles const& mcparticles) { @@ -867,7 +879,7 @@ struct sigma0builder { std::array pVecLambda{lambda.px(), lambda.py(), lambda.pz()}; auto arrMom = std::array{pVecPhotons, pVecLambda}; - float sigmaMass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); + float sigmaMass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); float sigmaY = RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0); histos.fill(HIST("SigmaSel/hSelectionStatistics"), 1.); @@ -886,7 +898,7 @@ struct sigma0builder { // Sigma0 topological info auto sigma0TopoInfo = propagateV0PairToDCA(gamma, lambda); - sigma0cores(sigma0TopoInfo.X, sigma0TopoInfo.Y, sigma0TopoInfo.Z, sigma0TopoInfo.DCADau, + sigma0cores(sigma0TopoInfo.X, sigma0TopoInfo.Y, sigma0TopoInfo.Z, sigma0TopoInfo.DCADau, gamma.px(), gamma.py(), gamma.pz(), gamma.mGamma(), lambda.px(), lambda.py(), lambda.pz(), lambda.mLambda(), lambda.mAntiLambda()); // MC properties @@ -894,15 +906,14 @@ struct sigma0builder { auto sigma0MCInfo = getV0PairMCInfo(gamma, lambda, collision, mcparticles); sigma0mccores(sigma0MCInfo.V0PairMCpT, sigma0MCInfo.V0PairMCRadius, sigma0MCInfo.V0PairPDGCode, sigma0MCInfo.V0PairPDGCodeMother, sigma0MCInfo.V0PairMCProcess, sigma0MCInfo.fV0PairProducedByGenerator, - sigma0MCInfo.V01MCpT, sigma0MCInfo.fIsV01Primary, sigma0MCInfo.V01PDGCode, sigma0MCInfo.V01PDGCodeMother, sigma0MCInfo.fIsV01CorrectlyAssign, + sigma0MCInfo.V01MCpT, sigma0MCInfo.fIsV01Primary, sigma0MCInfo.V01PDGCode, sigma0MCInfo.V01PDGCodeMother, sigma0MCInfo.fIsV01CorrectlyAssign, sigma0MCInfo.V02MCpT, sigma0MCInfo.fIsV02Primary, sigma0MCInfo.V02PDGCode, sigma0MCInfo.V02PDGCodeMother, sigma0MCInfo.fIsV02CorrectlyAssign); - } // Sigma0s -> stracollisions link - sigma0CollRefs(collision.globalIndex()); - - //_______________________________________________ + sigma0CollRefs(collision.globalIndex()); + + //_______________________________________________ // Photon extra properties auto posTrackGamma = gamma.template posTrackExtra_as(); auto negTrackGamma = gamma.template negTrackExtra_as(); @@ -920,12 +931,11 @@ struct sigma0builder { (uint8_t(negTrackGamma.hasTOF()) << hasTOF)); sigmaPhotonExtras(gamma.qtarm(), gamma.alpha(), gamma.v0cosPA(), gamma.dcaV0daughters(), gamma.dcanegtopv(), gamma.dcapostopv(), gamma.v0radius(), gamma.z(), - posTrackGamma.tpcNSigmaEl(), negTrackGamma.tpcNSigmaEl(), posTrackGamma.tpcCrossedRows(), negTrackGamma.tpcCrossedRows(), - gamma.positiveeta(), gamma.negativeeta(), gamma.psipair(), posTrackGamma.itsNCls(), negTrackGamma.itsNCls(), posTrackGamma.itsChi2PerNcl(), negTrackGamma.itsChi2PerNcl(), + posTrackGamma.tpcNSigmaEl(), negTrackGamma.tpcNSigmaEl(), posTrackGamma.tpcCrossedRows(), negTrackGamma.tpcCrossedRows(), + gamma.positiveeta(), gamma.negativeeta(), gamma.psipair(), posTrackGamma.itsNCls(), negTrackGamma.itsNCls(), posTrackGamma.itsChi2PerNcl(), negTrackGamma.itsChi2PerNcl(), fPhotonPosTrackCode, fPhotonNegTrackCode, gamma.v0Type()); - - //_______________________________________________ + //_______________________________________________ // Lambda extra properties auto posTrackLambda = lambda.template posTrackExtra_as(); auto negTrackLambda = lambda.template negTrackExtra_as(); @@ -941,14 +951,14 @@ struct sigma0builder { (uint8_t(negTrackLambda.hasITSAfterburner()) << hasITSAfterburner) | (uint8_t(negTrackLambda.hasTRD()) << hasTRD) | (uint8_t(negTrackLambda.hasTOF()) << hasTOF)); - + float fLambdaLifeTime = lambda.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; float fLambdaPrTOFNSigma = -999.f; float fLambdaPiTOFNSigma = -999.f; float fALambdaPrTOFNSigma = -999.f; float fALambdaPiTOFNSigma = -999.f; - if constexpr (requires { lambda.tofNSigmaLaPr();}) { // If TOF info avaiable + if constexpr (requires { lambda.tofNSigmaLaPr(); }) { // If TOF info avaiable fLambdaPrTOFNSigma = lambda.tofNSigmaLaPr(); fLambdaPiTOFNSigma = lambda.tofNSigmaLaPi(); fALambdaPrTOFNSigma = lambda.tofNSigmaALaPr(); @@ -956,13 +966,13 @@ struct sigma0builder { } sigmaLambdaExtras(lambda.qtarm(), lambda.alpha(), fLambdaLifeTime, lambda.v0radius(), lambda.v0cosPA(), lambda.dcaV0daughters(), lambda.dcanegtopv(), lambda.dcapostopv(), - posTrackLambda.tpcNSigmaPr(), posTrackLambda.tpcNSigmaPi(), negTrackLambda.tpcNSigmaPr(), negTrackLambda.tpcNSigmaPi(), + posTrackLambda.tpcNSigmaPr(), posTrackLambda.tpcNSigmaPi(), negTrackLambda.tpcNSigmaPr(), negTrackLambda.tpcNSigmaPi(), fLambdaPrTOFNSigma, fLambdaPiTOFNSigma, fALambdaPrTOFNSigma, fALambdaPiTOFNSigma, - posTrackLambda.tpcCrossedRows(), negTrackLambda.tpcCrossedRows(), - lambda.positiveeta(), lambda.negativeeta(), + posTrackLambda.tpcCrossedRows(), negTrackLambda.tpcCrossedRows(), + lambda.positiveeta(), lambda.negativeeta(), posTrackLambda.itsNCls(), negTrackLambda.itsNCls(), posTrackLambda.itsChi2PerNcl(), negTrackLambda.itsChi2PerNcl(), - fLambdaPosTrackCode, fLambdaNegTrackCode, lambda.v0Type()); - + fLambdaPosTrackCode, fLambdaNegTrackCode, lambda.v0Type()); + return true; } @@ -1005,10 +1015,10 @@ struct sigma0builder { bestLambdasArray.push_back(v0.globalIndex()); // Save indices of best lambda candidates } - //_______________________________________________ + //_______________________________________________ // Wrongly collision association study (MC-specific) if constexpr (requires { coll.StraMCCollisionId(); }) { - if (doAssocStudy) { + if (doAssocStudy) { analyzeV0CollAssoc(coll, fullV0s, bestGammasArray, true); // Photon-analysis analyzeV0CollAssoc(coll, fullV0s, bestLambdasArray, false); // Lambda-analysis } @@ -1018,23 +1028,22 @@ struct sigma0builder { // V0 nested loop for (size_t i = 0; i < bestGammasArray.size(); ++i) { auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]); - + //_______________________________________________ // Sigma0 loop - if (fillSigma0Tables){ + if (fillSigma0Tables) { for (size_t j = 0; j < bestLambdasArray.size(); ++j) { auto lambda = fullV0s.rawIteratorAt(bestLambdasArray[j]); - + // Building sigma0 candidate & filling tables if (!buildSigma0(lambda, gamma1, coll, mcparticles)) continue; - } } - + //_______________________________________________ // pi0 loop - if (fillPi0Tables){ + if (fillPi0Tables) { for (size_t j = i + 1; j < bestGammasArray.size(); ++j) { auto gamma2 = fullV0s.rawIteratorAt(bestGammasArray[j]); @@ -1072,12 +1081,12 @@ struct sigma0builder { { genProcess(mcParticles); } - + PROCESS_SWITCH(sigma0builder, processRealData, "process as if real data", true); PROCESS_SWITCH(sigma0builder, processRealDataWithTOF, "process as if real data", false); PROCESS_SWITCH(sigma0builder, processMonteCarlo, "process as if MC data", false); PROCESS_SWITCH(sigma0builder, processMonteCarloWithTOF, "process as if MC data, uses TOF PID info", false); - PROCESS_SWITCH(sigma0builder, processGeneratedRun3, "process generated MC info", false); + PROCESS_SWITCH(sigma0builder, processGeneratedRun3, "process generated MC info", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx index b2328b6f583..b4b2d393ec2 100644 --- a/PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx @@ -1002,11 +1002,10 @@ struct StrangenessBuilder { V0DuplicateExtras[bestPointingAngleIndex].isBestPA = true; if (bestDCADaughtersIndex != static_cast(-1)) V0DuplicateExtras[bestDCADaughtersIndex].isBestDCADau = true; - if (bestMLScoreIndex != static_cast(-1)){ + if (bestMLScoreIndex != static_cast(-1)) { V0DuplicateExtras[bestMLScoreIndex].isBestMLScore = true; histos.fill(HIST("DeduplicationQA/hPAOfBestMLScore"), V0DuplicateExtras[bestMLScoreIndex].PA); } - // return vector with duplicates info return V0DuplicateExtras; diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 24b48c9a2b6..c4603836121 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -19,36 +19,40 @@ // gianni.shigeru.setoue.liveraro@cern.ch // -#include -#include -#include -#include -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/ASoA.h" -#include "ReconstructionDataFormats/Track.h" +#include "PWGLF/DataModel/LFSigmaTables.h" +#include "PWGLF/DataModel/LFStrangenessMLTables.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" + +#include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/trackUtilities.h" #include "Common/Core/TrackSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/EventSelection.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/LFStrangenessPIDTables.h" -#include "PWGLF/DataModel/LFStrangenessMLTables.h" -#include "PWGLF/DataModel/LFSigmaTables.h" -#include "Common/CCDB/ctpRateFetcher.h" +#include "Common/DataModel/TrackSelectionTables.h" + #include "CCDB/BasicCCDBManager.h" +#include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include +#include #include #include -#include #include #include -#include +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -118,14 +122,14 @@ struct sigmaanalysis { } eventSelections; - // Generated Sigma0s + // Generated Sigma0s Configurable mc_keepOnlyFromGenerator{"mc_keepOnlyFromGenerator", true, "if true, consider only particles from generator to calculate efficiency."}; // QA Configurable fillBkgQAhistos{"fillBkgQAhistos", false, "if true, fill MC QA histograms for Bkg study. Only works with MC."}; Configurable fillResoQAhistos{"fillResoQAhistos", false, "if true, fill MC QA histograms for pT resolution study. Only works with MC."}; - // Analysis strategy: + // Analysis strategy: Configurable doMCAssociation{"doMCAssociation", false, "Flag to process only signal candidates. Use only with processMonteCarlo!"}; Configurable selRecoFromGenerator{"selRecoFromGenerator", false, "Flag to process only signal candidates from generator"}; Configurable doPhotonLambdaSelQA{"doPhotonLambdaSelQA", false, "Flag to fill photon and lambda QA histos!"}; @@ -166,7 +170,7 @@ struct sigmaanalysis { //// Photon criteria: struct : ConfigurableGroup { Configurable Gamma_MLThreshold{"Gamma_MLThreshold", 0.1, "Decision Threshold value to select gammas"}; - Configurable Photonv0TypeSel{"Photonv0TypeSel", 7, "select on a certain V0 type (leave negative if no selection desired)"}; + Configurable Photonv0TypeSel{"Photonv0TypeSel", 7, "select on a certain V0 type (leave negative if no selection desired)"}; Configurable PhotonMinDCADauToPv{"PhotonMinDCADauToPv", 0.0, "Min DCA daughter To PV (cm)"}; Configurable PhotonMaxDCAV0Dau{"PhotonMaxDCAV0Dau", 3.5, "Max DCA V0 Daughters (cm)"}; Configurable PhotonMinTPCCrossedRows{"PhotonMinTPCCrossedRows", 30, "Min daughter TPC Crossed Rows"}; @@ -212,7 +216,7 @@ struct sigmaanalysis { ConfigurableAxis axisDeltaPt{"axisDeltaPt", {400, -50.0, 50.0}, ""}; ConfigurableAxis axisRapidity{"axisRapidity", {100, -2.0f, 2.0f}, "Rapidity"}; ConfigurableAxis axisIRBinning{"axisIRBinning", {150, 0, 1500}, "Binning for the interaction rate (kHz)"}; - ConfigurableAxis axisNch{"axisNch", {300, 0.0f, 3000.0f}, "N_{ch}"}; + ConfigurableAxis axisNch{"axisNch", {300, 0.0f, 3000.0f}, "N_{ch}"}; ConfigurableAxis axisGeneratorIds{"axisGeneratorIds", {256, -0.5f, 255.5f}, "axis for generatorIds"}; // Invariant Mass @@ -243,7 +247,6 @@ struct sigmaanalysis { ConfigurableAxis axisPsiPair{"axisPsiPair", {250, -5.0f, 5.0f}, "Psipair for photons"}; ConfigurableAxis axisPhi{"axisPhi", {200, 0, 2 * o2::constants::math::PI}, "Phi for photons"}; ConfigurableAxis axisZ{"axisZ", {120, -120.0f, 120.0f}, "V0 Z position (cm)"}; - ConfigurableAxis axisCandSel{"axisCandSel", {20, 0.5f, +20.5f}, "Candidate Selection"}; @@ -251,9 +254,9 @@ struct sigmaanalysis { ConfigurableAxis MLProb{"MLOutput", {100, 0.0f, 1.0f}, ""}; void init(InitContext const&) - { + { LOGF(info, "Initializing now: cross-checking correctness..."); - if ((doprocessRealData + doprocessMonteCarlo + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || + if ((doprocessRealData + doprocessMonteCarlo + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || (doprocessGeneratedRun3 + doprocessPi0GeneratedRun3 > 1)) { LOGF(fatal, "You have enabled more than one process function. Please check your configuration! Aborting now."); } @@ -264,8 +267,8 @@ struct sigmaanalysis { ccdb->setFatalWhenNull(false); // Event Counters - histos.add("hEventCentrality", "hEventCentrality", kTH1D, {axisCentrality}); - + histos.add("hEventCentrality", "hEventCentrality", kTH1D, {axisCentrality}); + histos.add("hEventSelection", "hEventSelection", kTH1D, {{21, -0.5f, +20.5f}}); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut"); @@ -299,19 +302,19 @@ struct sigmaanalysis { histos.add("GeneralQA/hCentralityVsInteractionRate", "hCentralityVsInteractionRate", kTH2D, {axisCentrality, axisIRBinning}); } - if (doprocessRealData || doprocessMonteCarlo){ + if (doprocessRealData || doprocessMonteCarlo) { for (const auto& histodir : DirList) { histos.add(histodir + "/Photon/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); - histos.add(histodir + "/Photon/hV0Type", "hV0Type", kTH1D, {{8, 0.5f, 8.5f}}); + histos.add(histodir + "/Photon/hV0Type", "hV0Type", kTH1D, {{8, 0.5f, 8.5f}}); histos.add(histodir + "/Photon/hDCANegToPV", "hDCANegToPV", kTH1D, {axisDCAtoPV}); histos.add(histodir + "/Photon/hDCAPosToPV", "hDCAPosToPV", kTH1D, {axisDCAtoPV}); histos.add(histodir + "/Photon/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); histos.add(histodir + "/Photon/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Photon/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Photon/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); histos.add(histodir + "/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); histos.add(histodir + "/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - + histos.add(histodir + "/Photon/hpT", "hpT", kTH1D, {axisPt}); histos.add(histodir + "/Photon/hY", "hY", kTH1D, {axisRapidity}); histos.add(histodir + "/Photon/hPosEta", "hPosEta", kTH1D, {axisRapidity}); @@ -362,27 +365,26 @@ struct sigmaanalysis { histos.add(histodir + "/Sigma0/hY", "hY", kTH1D, {axisRapidity}); histos.add(histodir + "/Sigma0/hRadius", "hRadius", kTH1D, {axisV0PairRadius}); histos.add(histodir + "/Sigma0/h2dRadiusVspT", "h2dRadiusVspT", kTH2D, {axisV0PairRadius, axisPt}); - histos.add(histodir + "/Sigma0/hDCAPairDau", "hDCAPairDau", kTH1D, {axisDCAdau}); - histos.add(histodir + "/Sigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); + histos.add(histodir + "/Sigma0/hDCAPairDau", "hDCAPairDau", kTH1D, {axisDCAdau}); + histos.add(histodir + "/Sigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); histos.add(histodir + "/Sigma0/h3dOPAngleVsMass", "h3dOPAngleVsMass", kTH3D, {{140, 0.0f, +7.0f}, axisPt, axisSigmaMass}); - + histos.add(histodir + "/ASigma0/hMass", "hMass", kTH1D, {axisSigmaMass}); histos.add(histodir + "/ASigma0/hPt", "hPt", kTH1D, {axisPt}); - histos.add(histodir + "/ASigma0/hY", "hY", kTH1D, {axisRapidity}); + histos.add(histodir + "/ASigma0/hY", "hY", kTH1D, {axisRapidity}); histos.add(histodir + "/ASigma0/hRadius", "hRadius", kTH1D, {axisV0PairRadius}); histos.add(histodir + "/ASigma0/h2dRadiusVspT", "h2dRadiusVspT", kTH2D, {axisV0PairRadius, axisPt}); - histos.add(histodir + "/ASigma0/hDCAPairDau", "hDCAPairDau", kTH1D, {axisDCAdau}); - histos.add(histodir + "/ASigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); + histos.add(histodir + "/ASigma0/hDCAPairDau", "hDCAPairDau", kTH1D, {axisDCAdau}); + histos.add(histodir + "/ASigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); histos.add(histodir + "/ASigma0/h3dOPAngleVsMass", "h3dOPAngleVsMass", kTH3D, {{140, 0.0f, +7.0f}, axisPt, axisSigmaMass}); - // Process MC if (doprocessMonteCarlo) { histos.add(histodir + "/MC/Photon/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); histos.add(histodir + "/MC/Photon/hPt", "hPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Photon/hMCPt", "hMCPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Photon/hMCPt", "hMCPt", kTH1D, {axisPt}); histos.add(histodir + "/MC/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - histos.add(histodir + "/MC/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); + histos.add(histodir + "/MC/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); histos.add(histodir + "/MC/Photon/h2dPAVsPt", "h2dPAVsPt", kTH2D, {axisPA, axisPt}); histos.add(histodir + "/MC/Photon/hPt_BadCollAssig", "hPt_BadCollAssig", kTH1D, {axisPt}); histos.add(histodir + "/MC/Photon/h2dPAVsPt_BadCollAssig", "h2dPAVsPt_BadCollAssig", kTH2D, {axisPA, axisPt}); @@ -402,27 +404,27 @@ struct sigmaanalysis { histos.add(histodir + "/MC/h2dArmenteros", "h2dArmenteros", kTH2D, {axisAPAlpha, axisAPQt}); histos.add(histodir + "/MC/Sigma0/hPt", "hPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Sigma0/hMCPt", "hMCPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Sigma0/hMCPt", "hMCPt", kTH1D, {axisPt}); histos.add(histodir + "/MC/Sigma0/hMass", "hMass", kTH1D, {axisSigmaMass}); histos.add(histodir + "/MC/Sigma0/hMCProcess", "hMCProcess", kTH1D, {{50, -0.5f, 49.5f}}); histos.add(histodir + "/MC/Sigma0/hGenRadius", "hGenRadius", kTH1D, {axisV0PairRadius}); histos.add(histodir + "/MC/Sigma0/h2dMCPtVsLambdaMCPt", "h2dMCPtVsLambdaMCPt", kTH2D, {axisPt, axisPt}); histos.add(histodir + "/MC/Sigma0/h2dMCPtVsPhotonMCPt", "h2dMCPtVsPhotonMCPt", kTH2D, {axisPt, axisPt}); histos.add(histodir + "/MC/Sigma0/h2dMCProcessVsGenRadius", "h2dMCProcessVsGenRadius", kTH2D, {{50, -0.5f, 49.5f}, axisV0PairRadius}); - histos.add(histodir + "/MC/Sigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); + histos.add(histodir + "/MC/Sigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); histos.add(histodir + "/MC/Sigma0/h3dMCProcess", "h3dMCProcess", kTH3D, {{50, -0.5f, 49.5f}, axisPt, axisSigmaMass}); histos.add(histodir + "/MC/ASigma0/hPt", "hPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/ASigma0/hMCPt", "hMCPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/ASigma0/hMCPt", "hMCPt", kTH1D, {axisPt}); histos.add(histodir + "/MC/ASigma0/hMass", "hMass", kTH1D, {axisSigmaMass}); histos.add(histodir + "/MC/ASigma0/hMCProcess", "hMCProcess", kTH1D, {{50, -0.5f, 49.5f}}); histos.add(histodir + "/MC/ASigma0/hGenRadius", "hGenRadius", kTH1D, {axisV0PairRadius}); histos.add(histodir + "/MC/ASigma0/h2dMCPtVsLambdaMCPt", "h2dMCPtVsLambdaMCPt", kTH2D, {axisPt, axisPt}); histos.add(histodir + "/MC/ASigma0/h2dMCPtVsPhotonMCPt", "h2dMCPtVsPhotonMCPt", kTH2D, {axisPt, axisPt}); histos.add(histodir + "/MC/ASigma0/h2dMCProcessVsGenRadius", "h2dMCProcessVsGenRadius", kTH2D, {{50, -0.5f, 49.5f}, axisV0PairRadius}); - histos.add(histodir + "/MC/ASigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); + histos.add(histodir + "/MC/ASigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); histos.add(histodir + "/MC/ASigma0/h3dMCProcess", "h3dMCProcess", kTH3D, {{50, -0.5f, 49.5f}, axisPt, axisSigmaMass}); - + // 1/pT Resolution: if (fillResoQAhistos && histodir == "BeforeSel") { histos.add(histodir + "/MC/Reso/h3dGammaPtResoVsTPCCR", "h3dGammaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); @@ -437,7 +439,7 @@ struct sigmaanalysis { histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dSigma0RadiusResolution", "h2dSigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); - histos.add(histodir + "/MC/Reso/h2dASigma0RadiusResolution", "h2dASigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dASigma0RadiusResolution", "h2dASigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); } // For background decomposition study @@ -490,8 +492,8 @@ struct sigmaanalysis { histos.add("Pi0/hMass", "hMass", kTH1D, {axisPi0Mass}); histos.add("Pi0/hPt", "hPt", kTH1D, {axisPt}); histos.add("Pi0/hY", "hY", kTH1D, {axisRapidity}); - histos.add("Pi0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisPi0Mass}); - histos.add("Pi0/h3dMass_MCAssociated", "h3dMass_MCAssociated", kTH3D, {axisCentrality, axisPt, axisPi0Mass}); + histos.add("Pi0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisPi0Mass}); + histos.add("Pi0/h3dMass_MCAssociated", "h3dMass_MCAssociated", kTH3D, {axisCentrality, axisPt, axisPi0Mass}); } if (doprocessGeneratedRun3 || doprocessPi0GeneratedRun3) { @@ -507,22 +509,21 @@ struct sigmaanalysis { histos.add("Gen/hEventPVzMC", "hEventPVzMC", kTH1D, {{100, -20.0f, +20.0f}}); histos.add("Gen/hCentralityVsPVzMC", "hCentralityVsPVzMC", kTH2D, {{101, 0.0f, 101.0f}, {100, -20.0f, +20.0f}}); - + // Sigma0 specific - if (doprocessGeneratedRun3){ + if (doprocessGeneratedRun3) { histos.add("Gen/h2dGenSigma0", "h2dGenSigma0", kTH2D, {axisCentrality, axisPt}); - histos.add("Gen/h2dGenAntiSigma0", "h2dGenAntiSigma0", kTH2D, {axisCentrality, axisPt}); + histos.add("Gen/h2dGenAntiSigma0", "h2dGenAntiSigma0", kTH2D, {axisCentrality, axisPt}); histos.add("Gen/h2dGenSigma0VsMultMC_RecoedEvt", "h2dGenSigma0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt", "h2dGenAntiSigma0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenSigma0VsMultMC", "h2dGenSigma0VsMultMC", kTH2D, {axisNch, axisPt}); - histos.add("Gen/h2dGenAntiSigma0VsMultMC", "h2dGenAntiSigma0VsMultMC", kTH2D, {axisNch, axisPt}); - - } - else{ // Pi0 specific + histos.add("Gen/h2dGenAntiSigma0VsMultMC", "h2dGenAntiSigma0VsMultMC", kTH2D, {axisNch, axisPt}); + + } else { // Pi0 specific histos.add("Gen/h2dGenPi0VsMultMC_RecoedEvt", "h2dGenPi0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenPi0", "h2dGenPi0", kTH2D, {axisCentrality, axisPt}); - histos.add("Gen/h2dGenPi0VsMultMC", "h2dGenPi0VsMultMC", kTH2D, {axisNch, axisPt}); - } + histos.add("Gen/h2dGenPi0VsMultMC", "h2dGenPi0VsMultMC", kTH2D, {axisNch, axisPt}); + } } } @@ -638,12 +639,12 @@ struct sigmaanalysis { float interactionRate = (fGetIR) ? rateFetcher.fetch(ccdb.service, collision.timestamp(), collision.runNumber(), irSource, fIRCrashOnNull) * 1.e-3 : -1; float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); - if (fGetIR) { + if (fGetIR) { if (interactionRate < 0) histos.get(HIST("GeneralQA/hRunNumberNegativeIR"))->Fill(Form("%d", collision.runNumber()), 1); // This lists all run numbers without IR info! histos.fill(HIST("GeneralQA/hInteractionRate"), interactionRate); - histos.fill(HIST("GeneralQA/hCentralityVsInteractionRate"), centrality, interactionRate); + histos.fill(HIST("GeneralQA/hCentralityVsInteractionRate"), centrality, interactionRate); } if (eventSelections.minIR >= 0 && interactionRate < eventSelections.minIR) { @@ -657,7 +658,7 @@ struct sigmaanalysis { } if (fillHists) histos.fill(HIST("hEventSelection"), 19 /* Above max IR */); - + // Fill centrality histogram after event selection if (fillHists) histos.fill(HIST("hEventCentrality"), centrality); @@ -665,7 +666,7 @@ struct sigmaanalysis { return true; } - // ______________________________________________________ + // ______________________________________________________ // Simulated processing // Return the list of indices to the recoed collision associated to a given MC collision. template @@ -728,7 +729,7 @@ struct sigmaanalysis { int nCollisions = 0; for (auto const& collision : groupedCollisions) { - if (!IsEventAccepted(collision, false)) { + if (!IsEventAccepted(collision, false)) { continue; } @@ -755,12 +756,12 @@ struct sigmaanalysis { return; } - // ______________________________________________________ - // Simulated processing (subscribes to MC information too) + // ______________________________________________________ + // Simulated processing (subscribes to MC information too) template void analyzeGenerated(TMCCollisions const& mcCollisions, TCollisions const& collisions, TGenParticles const& genParticles) - { - fillGeneratedEventProperties(mcCollisions, collisions); + { + fillGeneratedEventProperties(mcCollisions, collisions); std::vector listBestCollisionIdx = getListOfRecoCollIndices(mcCollisions, collisions); for (auto& genParticle : genParticles) { @@ -769,12 +770,12 @@ struct sigmaanalysis { // Has MC collision if (!genParticle.has_straMCCollision()) continue; - - // Selection on the source (generator/transport) + + // Selection on the source (generator/transport) if (!genParticle.producedByGenerator() && mc_keepOnlyFromGenerator) continue; - - // Select corresponding mc collision && Basic event selection + + // Select corresponding mc collision && Basic event selection auto mcCollision = genParticle.template straMCCollision_as>(); if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) { continue; @@ -788,48 +789,47 @@ struct sigmaanalysis { continue; } } - + //______________________________________________________________________________ // Generated Sigma0 processing - if constexpr (requires { genParticle.sigma0MCPt();}) { - - float ptmc = genParticle.sigma0MCPt(); - + if constexpr (requires { genParticle.sigma0MCPt(); }) { + + float ptmc = genParticle.sigma0MCPt(); + if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); - - if (genParticle.isSigma0()) + + if (genParticle.isSigma0()) histos.fill(HIST("Gen/h2dGenSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); - + else - histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); } - + if (genParticle.isSigma0()) { histos.fill(HIST("Gen/h2dGenSigma0"), centrality, ptmc); histos.fill(HIST("Gen/h2dGenSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); - } - else{ + } else { histos.fill(HIST("Gen/h2dGenAntiSigma0"), centrality, ptmc); histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); } } //______________________________________________________________________________ // Generated Pi0 processing - if constexpr (requires { genParticle.pi0MCPt();}) { - float ptmc = genParticle.pi0MCPt(); - + if constexpr (requires { genParticle.pi0MCPt(); }) { + float ptmc = genParticle.pi0MCPt(); + if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); - centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); - histos.fill(HIST("Gen/h2dGenPi0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); + histos.fill(HIST("Gen/h2dGenPi0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); } - + histos.fill(HIST("Gen/h2dGenPi0"), centrality, ptmc); - histos.fill(HIST("Gen/h2dGenPi0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); - } - } + histos.fill(HIST("Gen/h2dGenPi0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); + } + } } //__________________________________________ @@ -900,7 +900,7 @@ struct sigmaanalysis { // Sigma and AntiSigma MC association if (sigma.isSigma0()) { histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution - if (sigma.mcpt() > 0) + if (sigma.mcpt() > 0) histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution } if (sigma.isAntiSigma0()) { @@ -955,7 +955,7 @@ struct sigmaanalysis { void fillHistos(TSigma0Object const& sigma, TCollision const& collision) { - // Check whether it is before or after selections + // Check whether it is before or after selections static constexpr std::string_view MainDir[] = {"BeforeSel", "AfterSel"}; // Get V0trackCode @@ -968,14 +968,14 @@ struct sigmaanalysis { // Photon histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hTrackCode"), GammaTrkCode); histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hV0Type"), sigma.photonV0Type()); - + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCANegToPV"), sigma.photonDCANegPV()); histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCAPosToPV"), sigma.photonDCAPosPV()); histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCADau"), sigma.photonDCADau()); histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCCR"), sigma.photonPosTPCCrossedRows()); histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCCR"), sigma.photonNegTPCCrossedRows()); histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hpT"), sigma.photonPt()); histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hY"), sigma.photonY()); histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosEta"), sigma.photonPosEta()); @@ -1023,12 +1023,12 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hMass"), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hPt"), sigma.pt()); - histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hY"), sigma.sigma0Y()); + histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hY"), sigma.sigma0Y()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hRadius"), sigma.radius()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h2dRadiusVspT"), sigma.radius(), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hDCAPairDau"), sigma.dcadaughters()); - histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dMass"), centrality, sigma.pt(), sigma.sigma0Mass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dOPAngleVsMass"), sigma.opAngle(), sigma.pt(), sigma.sigma0Mass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dMass"), centrality, sigma.pt(), sigma.sigma0Mass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dOPAngleVsMass"), sigma.opAngle(), sigma.pt(), sigma.sigma0Mass()); } else { histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_ALambdaPr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma()); histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_ALambdaPi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma()); @@ -1044,8 +1044,8 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/hRadius"), sigma.radius()); histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h2dRadiusVspT"), sigma.radius(), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/hDCAPairDau"), sigma.dcadaughters()); - histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dMass"), centrality, sigma.pt(), sigma.sigma0Mass()); - histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dOPAngleVsMass"), sigma.opAngle(), sigma.pt(), sigma.sigma0Mass()); + histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dMass"), centrality, sigma.pt(), sigma.sigma0Mass()); + histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dOPAngleVsMass"), sigma.opAngle(), sigma.pt(), sigma.sigma0Mass()); } //_______________________________________ @@ -1058,10 +1058,10 @@ struct sigmaanalysis { if (sigma.photonPDGCode() == 22) { histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hV0ToCollAssoc"), sigma.photonIsCorrectlyAssoc()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt"), sigma.photonPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hMCPt"), sigma.photonmcpt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hMCPt"), sigma.photonmcpt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); - + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); if (!sigma.photonIsCorrectlyAssoc()) { @@ -1097,17 +1097,17 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hPt"), sigma.pt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hMCPt"), sigma.mcpt()); - + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hMCPt"), sigma.mcpt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/h2dMCPtVsLambdaMCPt"), sigma.mcpt(), sigma.lambdamcpt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/h2dMCPtVsPhotonMCPt"), sigma.mcpt(), sigma.photonmcpt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hMass"), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/h3dMass"), centrality, sigma.mcpt(), sigma.sigma0Mass()); - - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hMCProcess"), sigma.mcprocess()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hGenRadius"), sigma.mcradius()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/h2dMCProcessVsGenRadius"), sigma.mcprocess(), sigma.mcradius()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/h3dMCProcess"), sigma.mcprocess(), sigma.mcpt(), sigma.sigma0Mass()); + + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hMCProcess"), sigma.mcprocess()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hGenRadius"), sigma.mcradius()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/h2dMCProcessVsGenRadius"), sigma.mcprocess(), sigma.mcradius()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/h3dMCProcess"), sigma.mcprocess(), sigma.mcpt(), sigma.sigma0Mass()); } //_______________________________________ @@ -1118,16 +1118,16 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hPt"), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hMCPt"), sigma.mcpt()); - + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/h2dMCPtVsLambdaMCPt"), sigma.mcpt(), sigma.lambdamcpt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/h2dMCPtVsPhotonMCPt"), sigma.mcpt(), sigma.photonmcpt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hMass"), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/h3dMass"), centrality, sigma.mcpt(), sigma.sigma0Mass()); - + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hMCProcess"), sigma.mcprocess()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hGenRadius"), sigma.mcradius()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/h2dMCProcessVsGenRadius"), sigma.mcprocess(), sigma.mcradius()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/h3dMCProcess"), sigma.mcprocess(), sigma.mcpt(), sigma.sigma0Mass()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hGenRadius"), sigma.mcradius()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/h2dMCProcessVsGenRadius"), sigma.mcprocess(), sigma.mcradius()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/h3dMCProcess"), sigma.mcprocess(), sigma.mcpt(), sigma.sigma0Mass()); } // For background studies: @@ -1179,7 +1179,7 @@ struct sigmaanalysis { fillSelHistos<0>(cand, 22); if (cand.photonV0Type() != photonSelections.Photonv0TypeSel && photonSelections.Photonv0TypeSel > -1) return false; - + fillSelHistos<1>(cand, 22); if ((TMath::Abs(cand.photonDCAPosPV()) < photonSelections.PhotonMinDCADauToPv) || (TMath::Abs(cand.photonDCANegPV()) < photonSelections.PhotonMinDCADauToPv)) return false; @@ -1356,8 +1356,8 @@ struct sigmaanalysis { if (!selectLambda(cand)) return false; - // Sigma0 specific selections - // Rapidity + // Sigma0 specific selections + // Rapidity if (TMath::Abs(cand.sigma0Y()) > sigma0Selections.Sigma0MaxRap) return false; @@ -1365,14 +1365,14 @@ struct sigmaanalysis { if (cand.radius() > sigma0Selections.Sigma0MaxRadius) return false; - // DCA V0Pair Daughters + // DCA V0Pair Daughters if (cand.dcadaughters() > sigma0Selections.Sigma0MaxDCADau) return false; // Opening Angle if (cand.opAngle() > sigma0Selections.Sigma0MaxOPAngle) return false; - + return true; } @@ -1388,25 +1388,25 @@ struct sigmaanalysis { } // Collisions loop - for (const auto& coll : collisions){ - + for (const auto& coll : collisions) { + // Event selection if (!IsEventAccepted(coll, true)) continue; - + // Sigma0s loop for (size_t i = 0; i < sigma0grouped[coll.globalIndex()].size(); i++) { auto sigma0 = fullSigma0s.rawIteratorAt(sigma0grouped[coll.globalIndex()][i]); // if MC - if constexpr (requires { sigma0.isSigma0(); sigma0.isAntiSigma0();}) { - if (doMCAssociation && !(sigma0.isSigma0() || sigma0.isAntiSigma0())) - continue; + if constexpr (requires { sigma0.isSigma0(); sigma0.isAntiSigma0(); }) { + if (doMCAssociation && !(sigma0.isSigma0() || sigma0.isAntiSigma0())) + continue; if (selRecoFromGenerator && !sigma0.isProducedByGenerator()) continue; } - + // Fill histos before any selection fillHistos<0>(sigma0, coll); @@ -1424,11 +1424,11 @@ struct sigmaanalysis { template bool processPi0Candidate(TPi0Object const& cand) { - if ((cand.photon1V0Type() != photonSelections.Photonv0TypeSel || cand.photon2V0Type() != photonSelections.Photonv0TypeSel )&& photonSelections.Photonv0TypeSel > -1) + if ((cand.photon1V0Type() != photonSelections.Photonv0TypeSel || cand.photon2V0Type() != photonSelections.Photonv0TypeSel) && photonSelections.Photonv0TypeSel > -1) return false; - if ((TMath::Abs(cand.photon1DCAPosPV()) < photonSelections.PhotonMinDCADauToPv) || - (TMath::Abs(cand.photon2DCAPosPV()) < photonSelections.PhotonMinDCADauToPv) || + if ((TMath::Abs(cand.photon1DCAPosPV()) < photonSelections.PhotonMinDCADauToPv) || + (TMath::Abs(cand.photon2DCAPosPV()) < photonSelections.PhotonMinDCADauToPv) || (TMath::Abs(cand.photon1DCANegPV()) < photonSelections.PhotonMinDCADauToPv) || (TMath::Abs(cand.photon2DCANegPV()) < photonSelections.PhotonMinDCADauToPv)) return false; @@ -1436,28 +1436,28 @@ struct sigmaanalysis { if ((TMath::Abs(cand.photon1DCADau()) > photonSelections.PhotonMaxDCAV0Dau) || (TMath::Abs(cand.photon2DCADau()) > photonSelections.PhotonMaxDCAV0Dau)) return false; - if ((cand.photon1PosTPCCrossedRows() < photonSelections.PhotonMinTPCCrossedRows) || - (cand.photon2PosTPCCrossedRows() < photonSelections.PhotonMinTPCCrossedRows) || + if ((cand.photon1PosTPCCrossedRows() < photonSelections.PhotonMinTPCCrossedRows) || + (cand.photon2PosTPCCrossedRows() < photonSelections.PhotonMinTPCCrossedRows) || (cand.photon1NegTPCCrossedRows() < photonSelections.PhotonMinTPCCrossedRows) || (cand.photon2NegTPCCrossedRows() < photonSelections.PhotonMinTPCCrossedRows)) return false; - - if (((cand.photon1PosTPCNSigmaEl() < photonSelections.PhotonMinTPCNSigmas) || - (cand.photon1PosTPCNSigmaEl() > photonSelections.PhotonMaxTPCNSigmas)) || - ((cand.photon2PosTPCNSigmaEl() < photonSelections.PhotonMinTPCNSigmas) || - (cand.photon2PosTPCNSigmaEl() > photonSelections.PhotonMaxTPCNSigmas))) + + if (((cand.photon1PosTPCNSigmaEl() < photonSelections.PhotonMinTPCNSigmas) || + (cand.photon1PosTPCNSigmaEl() > photonSelections.PhotonMaxTPCNSigmas)) || + ((cand.photon2PosTPCNSigmaEl() < photonSelections.PhotonMinTPCNSigmas) || + (cand.photon2PosTPCNSigmaEl() > photonSelections.PhotonMaxTPCNSigmas))) return false; - if (((cand.photon1NegTPCNSigmaEl() < photonSelections.PhotonMinTPCNSigmas) || - (cand.photon1NegTPCNSigmaEl() > photonSelections.PhotonMaxTPCNSigmas)) || - ((cand.photon2NegTPCNSigmaEl() < photonSelections.PhotonMinTPCNSigmas) || - (cand.photon2NegTPCNSigmaEl() > photonSelections.PhotonMaxTPCNSigmas))) + if (((cand.photon1NegTPCNSigmaEl() < photonSelections.PhotonMinTPCNSigmas) || + (cand.photon1NegTPCNSigmaEl() > photonSelections.PhotonMaxTPCNSigmas)) || + ((cand.photon2NegTPCNSigmaEl() < photonSelections.PhotonMinTPCNSigmas) || + (cand.photon2NegTPCNSigmaEl() > photonSelections.PhotonMaxTPCNSigmas))) return false; - if (((cand.photon1Pt() < photonSelections.PhotonMinPt) || - (cand.photon1Pt() > photonSelections.PhotonMaxPt)) || - ((cand.photon2Pt() < photonSelections.PhotonMinPt) || - (cand.photon2Pt() > photonSelections.PhotonMaxPt))) + if (((cand.photon1Pt() < photonSelections.PhotonMinPt) || + (cand.photon1Pt() > photonSelections.PhotonMaxPt)) || + ((cand.photon2Pt() < photonSelections.PhotonMinPt) || + (cand.photon2Pt() > photonSelections.PhotonMaxPt))) return false; if ((TMath::Abs(cand.photon1Y()) > photonSelections.PhotonMaxRap) || (TMath::Abs(cand.photon1PosEta()) > photonSelections.PhotonMaxDauEta) || (TMath::Abs(cand.photon1NegEta()) > photonSelections.PhotonMaxDauEta)) @@ -1467,9 +1467,9 @@ struct sigmaanalysis { return false; if (((cand.photon1Radius() < photonSelections.PhotonMinRadius) || (cand.photon1Radius() > photonSelections.PhotonMaxRadius)) || - ((cand.photon2Radius() < photonSelections.PhotonMinRadius) || (cand.photon2Radius() > photonSelections.PhotonMaxRadius))) + ((cand.photon2Radius() < photonSelections.PhotonMinRadius) || (cand.photon2Radius() > photonSelections.PhotonMaxRadius))) return false; - + if ((cand.photon1Qt() > photonSelections.PhotonMaxQt) || cand.photon2Qt() > photonSelections.PhotonMaxQt) return false; @@ -1478,7 +1478,7 @@ struct sigmaanalysis { if ((cand.photon1CosPA() < photonSelections.PhotonMinV0cospa) || (cand.photon2CosPA() < photonSelections.PhotonMinV0cospa)) return false; - + if ((TMath::Abs(cand.photon1Mass()) > photonSelections.PhotonMaxMass) || (TMath::Abs(cand.photon2Mass()) > photonSelections.PhotonMaxMass)) return false; @@ -1490,10 +1490,10 @@ struct sigmaanalysis { if (cand.radius() > pi0Selections.Pi0MaxRadius) return false; - // DCA V0Pair Daughters + // DCA V0Pair Daughters if (cand.dcadaughters() > pi0Selections.Pi0MaxDCADau) return false; - + return true; } @@ -1509,47 +1509,48 @@ struct sigmaanalysis { } // Collisions loop - for (const auto& coll : collisions){ - + for (const auto& coll : collisions) { + // Event selection if (!IsEventAccepted(coll, true)) continue; - + // Pi0s loop float centrality = doPPAnalysis ? coll.centFT0M() : coll.centFT0C(); - + for (size_t i = 0; i < pi0grouped[coll.globalIndex()].size(); i++) { auto pi0 = fullPi0s.rawIteratorAt(pi0grouped[coll.globalIndex()][i]); // Select sigma0 candidates if (!processPi0Candidate(pi0)) continue; - + // If MC - if constexpr (requires { pi0.isPi0();}) { + if constexpr (requires { pi0.isPi0(); }) { if (selRecoFromGenerator && !pi0.isProducedByGenerator()) continue; - if (pi0.isPi0()) histos.fill(HIST("Pi0/h3dMass_MCAssociated"), centrality, pi0.mcpt(), pi0.pi0Mass()); + if (pi0.isPi0()) + histos.fill(HIST("Pi0/h3dMass_MCAssociated"), centrality, pi0.mcpt(), pi0.pi0Mass()); } - + // Fill histos after all selections histos.fill(HIST("Pi0/hMass"), pi0.pi0Mass()); histos.fill(HIST("Pi0/hPt"), pi0.pt()); histos.fill(HIST("Pi0/hY"), pi0.pi0Y()); - histos.fill(HIST("Pi0/h3dMass"), centrality, pi0.pt(), pi0.pi0Mass()); + histos.fill(HIST("Pi0/h3dMass"), centrality, pi0.pt(), pi0.pi0Mass()); } } } - + void processRealData(soa::Join const& collisions, Sigma0s const& fullSigma0s) - { - analyzeRecoeSigma0s(collisions, fullSigma0s); + { + analyzeRecoeSigma0s(collisions, fullSigma0s); } void processMonteCarlo(soa::Join const& collisions, MCSigma0s const& fullSigma0s) { - analyzeRecoeSigma0s(collisions, fullSigma0s); + analyzeRecoeSigma0s(collisions, fullSigma0s); } // Simulated processing in Run 3 @@ -1559,15 +1560,15 @@ struct sigmaanalysis { } // _____________________________________________________ - // Pi0 QA + // Pi0 QA void processPi0RealData(soa::Join const& collisions, soa::Join const& fullPi0s) - { - analyzeRecoePi0s(collisions, fullPi0s); + { + analyzeRecoePi0s(collisions, fullPi0s); } void processPi0MonteCarlo(soa::Join const& collisions, soa::Join const& fullPi0s) { - analyzeRecoePi0s(collisions, fullPi0s); + analyzeRecoePi0s(collisions, fullPi0s); } void processPi0GeneratedRun3(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& Pi0Gens)