Skip to content

Commit dd591bb

Browse files
Add V0 association info in datamodel
1 parent cab1413 commit dd591bb

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

PWGLF/DataModel/LFSigmaTables.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,12 @@ DECLARE_SOA_COLUMN(PhotonCandPDGCode, photonCandPDGCode, int);
216216
DECLARE_SOA_COLUMN(PhotonCandPDGCodeMother, photonCandPDGCodeMother, int);
217217
DECLARE_SOA_COLUMN(IsPhotonCandPrimary, isPhotonCandPrimary, bool);
218218
DECLARE_SOA_COLUMN(PhotonMCPt, photonMCPt, float);
219+
DECLARE_SOA_COLUMN(PhotonIsCorrectlyAssoc, photonIsCorrectlyAssoc, bool);
219220
DECLARE_SOA_COLUMN(LambdaCandPDGCode, lambdaCandPDGCode, int);
220221
DECLARE_SOA_COLUMN(LambdaCandPDGCodeMother, lambdaCandPDGCodeMother, int);
221222
DECLARE_SOA_COLUMN(IsLambdaCandPrimary, isLambdaCandPrimary, bool);
222223
DECLARE_SOA_COLUMN(LambdaMCPt, lambdaMCPt, float);
224+
DECLARE_SOA_COLUMN(LambdaIsCorrectlyAssoc, lambdaIsCorrectlyAssoc, bool);
223225

224226
} // namespace sigmaMCCore
225227

@@ -231,10 +233,12 @@ DECLARE_SOA_TABLE(SigmaMCCores, "AOD", "SIGMA0MCCORES",
231233
sigmaMCCore::PhotonCandPDGCodeMother,
232234
sigmaMCCore::IsPhotonCandPrimary,
233235
sigmaMCCore::PhotonMCPt,
236+
sigmaMCCore::PhotonIsCorrectlyAssoc,
234237
sigmaMCCore::LambdaCandPDGCode,
235238
sigmaMCCore::LambdaCandPDGCodeMother,
236239
sigmaMCCore::IsLambdaCandPrimary,
237-
sigmaMCCore::LambdaMCPt);
240+
sigmaMCCore::LambdaMCPt,
241+
sigmaMCCore::LambdaIsCorrectlyAssoc);
238242
} // namespace o2::aod
239243

240244
#endif // PWGLF_DATAMODEL_LFSIGMATABLES_H_

PWGLF/TableProducer/Strangeness/sigma0builder.cxx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -760,12 +760,15 @@ struct sigma0builder {
760760
fLambdaV0Type, LambdaBDTScore, AntiLambdaBDTScore);
761761
}
762762

763-
void processMonteCarlo(soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps> const& collisions, V0DerivedMCDatas const& V0s, dauTracks const&, aod::MotherMCParts const&, soa::Join<aod::StraMCCollisions, aod::StraMCCollMults> const&, soa::Join<aod::V0MCCores, aod::V0MCCollRefs> const&)
763+
void processMonteCarlo(soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps, aod::StraCollLabels> const& collisions, V0DerivedMCDatas const& V0s, dauTracks const&, aod::MotherMCParts const&, soa::Join<aod::StraMCCollisions, aod::StraMCCollMults> const&, soa::Join<aod::V0MCCores, aod::V0MCCollRefs> const&)
764764
{
765765
for (const auto& coll : collisions) {
766766
if (!IsEventAccepted(coll, true)) {
767767
continue;
768768
}
769+
770+
bool fIsPhotonCorrectlyAssign = false;
771+
769772
// Do analysis with collision-grouped V0s, retain full collision information
770773
const uint64_t collIdx = coll.globalIndex();
771774
auto V0Table_thisCollision = V0s.sliceBy(perCollisionMCDerived, collIdx);
@@ -780,6 +783,11 @@ struct sigma0builder {
780783

781784
auto gammaMC = gamma.v0MCCore_as<soa::Join<aod::V0MCCores, aod::V0MCCollRefs>>();
782785

786+
if (coll.has_straMCCollision()) {
787+
auto gammaMCCollision = coll.template straMCCollision_as<soa::Join<aod::StraMCCollisions, aod::StraMCCollMults>>();
788+
fIsPhotonCorrectlyAssign = (gammaMC.straMCCollisionId() == gammaMCCollision.globalIndex());
789+
}
790+
783791
// Auxiliary histograms:
784792
if (gammaMC.pdgCode() == 22) {
785793
histos.fill(HIST("MC/h3dGammasXYZ"), gamma.x(), gamma.y(), gamma.z());
@@ -828,8 +836,14 @@ struct sigma0builder {
828836
continue;
829837
}
830838

839+
bool fIsLambdaCorrectlyAssign = false;
831840
auto lambdaMC = lambda.v0MCCore_as<soa::Join<aod::V0MCCores, aod::V0MCCollRefs>>();
832841

842+
if (coll.has_straMCCollision()) {
843+
auto lambdaMCCollision = coll.template straMCCollision_as<soa::Join<aod::StraMCCollisions, aod::StraMCCollMults>>();
844+
fIsLambdaCorrectlyAssign = (lambdaMC.straMCCollisionId() == lambdaMCCollision.globalIndex());
845+
}
846+
833847
if (doPi0QA) // Pi0 QA study
834848
runPi0QA(gamma, lambda);
835849

@@ -859,11 +873,12 @@ struct sigma0builder {
859873
int PhotonCandPDGCode = gammaMC.pdgCode();
860874
int PhotonCandPDGCodeMother = gammaMC.pdgCodeMother();
861875
float PhotonMCpT = RecoDecay::pt(array{gammaMC.pxMC(), gammaMC.pyMC()});
876+
862877
bool fIsLambdaPrimary = lambdaMC.isPhysicalPrimary();
863878
int LambdaCandPDGCode = lambdaMC.pdgCode();
864879
int LambdaCandPDGCodeMother = lambdaMC.pdgCodeMother();
865880
float LambdaMCpT = RecoDecay::pt(array{lambdaMC.pxMC(), lambdaMC.pyMC()});
866-
881+
867882
if ((gammaMC.pdgCode() == 22) && (gammaMC.pdgCodeMother() == 3212) && (lambdaMC.pdgCode() == 3122) && (lambdaMC.pdgCodeMother() == 3212) && (gamma.motherMCPartId() == lambda.motherMCPartId())) {
868883
fIsSigma = true;
869884
histos.fill(HIST("MC/h2dPtVsCentrality_Sigma0AfterSel"), centrality, RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}));
@@ -874,8 +889,8 @@ struct sigma0builder {
874889
// TH3D Mass histogram
875890
}
876891
sigma0mccores(fIsSigma, fIsAntiSigma, SigmaMCpT,
877-
PhotonCandPDGCode, PhotonCandPDGCodeMother, fIsPhotonPrimary, PhotonMCpT,
878-
LambdaCandPDGCode, LambdaCandPDGCodeMother, fIsLambdaPrimary, LambdaMCpT);
892+
PhotonCandPDGCode, PhotonCandPDGCodeMother, fIsPhotonPrimary, PhotonMCpT, fIsPhotonCorrectlyAssign,
893+
LambdaCandPDGCode, LambdaCandPDGCodeMother, fIsLambdaPrimary, LambdaMCpT, fIsLambdaCorrectlyAssign);
879894

880895
fillTables(lambda, gamma, coll); // filling tables with accepted candidates
881896

0 commit comments

Comments
 (0)