Skip to content

Commit 178e4e0

Browse files
Fix sigma0builder
1 parent 740c23e commit 178e4e0

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

‎PWGLF/TableProducer/Strangeness/sigma0builder.cxx‎

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
#include <Framework/InitContext.h>
4343
#include <Framework/OutputObjHeader.h>
4444
#include <Framework/runDataProcessing.h>
45+
#include <ReconstructionDataFormats/TrackParametrizationWithError.h>
46+
#include <ReconstructionDataFormats/Track.h>
47+
#include <DetectorsBase/Propagator.h>
4548

4649
#include <Math/Vector3D.h> // IWYU pragma: keep (do not replace with Math/Vector3Dfwd.h)
4750
#include <Math/Vector3Dfwd.h>
@@ -1094,8 +1097,9 @@ struct sigma0builder {
10941097
auto v02MC = v02.template v0MCCore_as<soa::Join<aod::V0MCCores, aod::V0MCCollRefs>>();
10951098

10961099
// Sanity check: Is V0Pair <-> Mother assignment correct?
1100+
int expectedPairPDG = doLambdaStar ? 3124 : PDG_t::kSigma0;
10971101
bool fIsSigma0 = false;
1098-
if ((v01MC.pdgCode() == PDG_t::kGamma) && (v01MC.pdgCodeMother() == PDG_t::kSigma0) && (v02MC.pdgCode() == PDG_t::kLambda0) && (v02MC.pdgCodeMother() == PDG_t::kSigma0) && (v01.motherMCPartId() == v02.motherMCPartId()))
1102+
if ((v01MC.pdgCode() == PDG_t::kGamma) && (v01MC.pdgCodeMother() == expectedPairPDG) && (v02MC.pdgCode() == PDG_t::kLambda0) && (v02MC.pdgCodeMother() == expectedPairPDG) && (v01.motherMCPartId() == v02.motherMCPartId()))
10991103
fIsSigma0 = true;
11001104

11011105
bool fIsKStar = false;
@@ -1246,11 +1250,11 @@ struct sigma0builder {
12461250
}
12471251
}
12481252
// Check association correctness
1249-
if (fIsSigma0 && (MCinfo.V0PairPDGCode == PDG_t::kSigma0))
1253+
if (fIsSigma0 && (MCinfo.V0PairPDGCode == expectedPairPDG))
12501254
histos.fill(HIST("MCQA/hSigma0MCCheck"), 1); // match
1251-
if (fIsSigma0 && !(MCinfo.V0PairPDGCode == PDG_t::kSigma0))
1255+
if (fIsSigma0 && !(MCinfo.V0PairPDGCode == expectedPairPDG))
12521256
histos.fill(HIST("MCQA/hSigma0MCCheck"), 2); // mismatch
1253-
if (!fIsSigma0 && (MCinfo.V0PairPDGCode == PDG_t::kSigma0))
1257+
if (!fIsSigma0 && (MCinfo.V0PairPDGCode == expectedPairPDG))
12541258
histos.fill(HIST("MCQA/hSigma0MCCheck"), 3); // mismatch
12551259

12561260
// Check association correctness
@@ -1905,6 +1909,8 @@ struct sigma0builder {
19051909
GenInfo.IsPi0 = mcParticle.pdgCode() == PDG_t::kPi0; // 111;
19061910
GenInfo.IsSigma0 = mcParticle.pdgCode() == PDG_t::kSigma0; // PDG_t::kSigma0
19071911
GenInfo.IsAntiSigma0 = mcParticle.pdgCode() == PDG_t::kSigma0Bar; //-3212
1912+
GenInfo.IsLambdaStar = mcParticle.pdgCode() == 3124; // 102134 (PYTHIA8)
1913+
GenInfo.IsAntiLambdaStar = mcParticle.pdgCode() == -3124; // -102134
19081914
GenInfo.IsKStar = std::abs(mcParticle.pdgCode()) == o2::constants::physics::Pdg::kK0Star892; // 313;
19091915
GenInfo.IsProducedByGenerator = mcParticle.producedByGenerator();
19101916
GenInfo.MCProcess = mcParticle.getProcess();
@@ -1916,7 +1922,7 @@ struct sigma0builder {
19161922
GenInfo.MCCollId = mcParticle.mcCollisionId(); // save this reference, please
19171923

19181924
// Checking decay mode if sigma0 or pi0 (it is easier here)
1919-
if (GenInfo.IsSigma0 || GenInfo.IsAntiSigma0 || GenInfo.IsPi0 || GenInfo.IsKStar) {
1925+
if (GenInfo.IsSigma0 || GenInfo.IsAntiSigma0 || GenInfo.IsPi0 || GenInfo.IsKStar || GenInfo.IsLambdaStar || GenInfo.IsAntiLambdaStar) {
19201926

19211927
// This is a costly operation, so we do it only for pi0s and sigma0s
19221928
auto const& daughters = mcParticle.template daughters_as<aod::McParticles>();
@@ -1926,7 +1932,7 @@ struct sigma0builder {
19261932
auto const& GenMothersList = mcParticle.template mothers_as<aod::McParticles>();
19271933
GenInfo.PDGCodeMother = (!GenMothersList.empty()) ? GenMothersList.front().pdgCode() : 0;
19281934

1929-
if ((GenInfo.IsSigma0 || GenInfo.IsAntiSigma0) && genSelections.doQA) {
1935+
if ((doLambdaStar ? (GenInfo.IsLambdaStar || GenInfo.IsAntiLambdaStar) : (GenInfo.IsSigma0 || GenInfo.IsAntiSigma0)) && genSelections.doQA) {
19301936
histos.fill(HIST("GenQA/h2dSigma0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother);
19311937

19321938
// Checking decay modes and getting daughter pTs
@@ -1989,7 +1995,7 @@ struct sigma0builder {
19891995
histos.fill(HIST("GenQA/hGenSpeciesKStar"), 0);
19901996

19911997
// Checking decay mode
1992-
if (GenInfo.IsSigma0 || GenInfo.IsAntiSigma0) {
1998+
if (doLambdaStar ? (GenInfo.IsLambdaStar || GenInfo.IsAntiLambdaStar) : (GenInfo.IsSigma0 || GenInfo.IsAntiSigma0)) {
19931999
histos.fill(HIST("GenQA/hSigma0NDau"), GenInfo.NDaughters);
19942000
histos.fill(HIST("GenQA/h2dSigma0NDauVsProcess"), GenInfo.NDaughters, GenInfo.MCProcess);
19952001

@@ -2009,7 +2015,7 @@ struct sigma0builder {
20092015
histos.fill(HIST("GenQA/h2DGenSigma0TypeVsProducedByGen"), typeIndex, genIndex);
20102016

20112017
// Fill histograms
2012-
if (GenInfo.IsSigma0) {
2018+
if (doLambdaStar ? GenInfo.IsLambdaStar : GenInfo.IsSigma0) {
20132019
histos.fill(HIST("GenQA/hGenSpecies"), 2);
20142020
histos.fill(HIST("GenQA/hGenSigma0"), GenInfo.MCPt);
20152021
histos.fill(HIST("GenQA/h3dGenSigma0_pTMap"), GenInfo.MCPt, GenInfo.MCDau1Pt, GenInfo.MCDau2Pt);
@@ -2018,7 +2024,7 @@ struct sigma0builder {
20182024
if (GenInfo.IsPrimary)
20192025
histos.fill(HIST("GenQA/hPrimarySigma0s"), 1);
20202026
}
2021-
if (GenInfo.IsAntiSigma0) {
2027+
if (doLambdaStar ? GenInfo.IsAntiLambdaStar : GenInfo.IsAntiSigma0) {
20222028
histos.fill(HIST("GenQA/hGenSpecies"), 3);
20232029
histos.fill(HIST("GenQA/hGenAntiSigma0"), GenInfo.MCPt);
20242030
histos.fill(HIST("GenQA/h3dGenASigma0_pTMap"), GenInfo.MCPt, GenInfo.MCDau1Pt, GenInfo.MCDau2Pt);
@@ -2095,9 +2101,10 @@ struct sigma0builder {
20952101
pi0GenCollRefs(MCGenInfo.MCCollId); // link to stramccollision table
20962102
}
20972103

2098-
// Sigma0/ASigma0
2099-
if (fillSigma0Tables && (MCGenInfo.IsSigma0 || MCGenInfo.IsAntiSigma0)) {
2100-
sigma0Gens(MCGenInfo.IsSigma0, MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt, mcParticle.y());
2104+
// Sigma0/ASigma0 (Lambda(1520)/ALambda(1520))
2105+
bool fIsGenSigma0Like = doLambdaStar ? (MCGenInfo.IsLambdaStar || MCGenInfo.IsAntiLambdaStar) : (MCGenInfo.IsSigma0 || MCGenInfo.IsAntiSigma0);
2106+
if (fillSigma0Tables && fIsGenSigma0Like) {
2107+
sigma0Gens(doLambdaStar ? MCGenInfo.IsLambdaStar : MCGenInfo.IsSigma0, MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt, mcParticle.y());
21012108
sigma0GenCollRefs(MCGenInfo.MCCollId); // link to stramccollision table
21022109
}
21032110

0 commit comments

Comments
 (0)