Skip to content

Commit c6b3382

Browse files
fgrosaalibuild
andauthored
[PWGHF] Add possibility to match decay daughters interacting with material in HF (#9431)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent c24e2b7 commit c6b3382

File tree

4 files changed

+84
-32
lines changed

4 files changed

+84
-32
lines changed

PWGHF/DataModel/CandidateReconstructionTables.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,9 @@ DECLARE_SOA_COLUMN(KfTopolChi2OverNdf, kfTopolChi2OverNdf, float); //! chi2overn
586586
DECLARE_SOA_COLUMN(PtBhadMotherPart, ptBhadMotherPart, float); //! pt of the first B-hadron mother particle (only in case of non-prompt)
587587
DECLARE_SOA_COLUMN(PdgBhadMotherPart, pdgBhadMotherPart, int); //! pdg of the first B-hadron mother particle (only in case of non-prompt)
588588
DECLARE_SOA_COLUMN(IdxBhadMotherPart, idxBhadMotherPart, int); //! index of the first B-hadron mother particle (only in case of non-prompt)
589-
// Kink topology mc flag
590-
DECLARE_SOA_COLUMN(NTracksDecayed, nTracksDecayed, int8_t); //! number of tracks matched with kinked decay topology
589+
// Kink topology and material interaction mc flags
590+
DECLARE_SOA_COLUMN(NTracksDecayed, nTracksDecayed, int8_t); //! number of tracks matched with kinked decay topology
591+
DECLARE_SOA_COLUMN(NInteractionsWithMaterial, nInteractionsWithMaterial, int8_t); //! number of tracks matched after interaction with material
591592

592593
// method of secondary-vertex reconstruction
593594
enum VertexerType { DCAFitter = 0,
@@ -735,7 +736,8 @@ DECLARE_SOA_TABLE(HfCand2ProngMcRec, "AOD", "HFCAND2PMCREC", //!
735736
hf_cand_2prong::OriginMcRec,
736737
hf_cand::PtBhadMotherPart,
737738
hf_cand::PdgBhadMotherPart,
738-
hf_cand::NTracksDecayed);
739+
hf_cand::NTracksDecayed,
740+
hf_cand::NInteractionsWithMaterial);
739741

740742
// table with results of generator level MC matching
741743
DECLARE_SOA_TABLE(HfCand2ProngMcGen, "AOD", "HFCAND2PMCGEN", //!
@@ -1058,7 +1060,8 @@ DECLARE_SOA_TABLE(HfCand3ProngMcRec, "AOD", "HFCAND3PMCREC", //!
10581060
hf_cand_3prong::FlagMcDecayChanRec,
10591061
hf_cand::PtBhadMotherPart,
10601062
hf_cand::PdgBhadMotherPart,
1061-
hf_cand::NTracksDecayed);
1063+
hf_cand::NTracksDecayed,
1064+
hf_cand::NInteractionsWithMaterial);
10621065

10631066
// table with results of generator level MC matching
10641067
DECLARE_SOA_TABLE(HfCand3ProngMcGen, "AOD", "HFCAND3PMCGEN", //!
@@ -2404,7 +2407,8 @@ DECLARE_SOA_TABLE(HfCandDstarMcRec, "AOD", "HFCANDDSTRMCREC",
24042407
hf_cand_dstar::OriginMcRec,
24052408
hf_cand::PtBhadMotherPart,
24062409
hf_cand::PdgBhadMotherPart,
2407-
hf_cand::NTracksDecayed);
2410+
hf_cand::NTracksDecayed,
2411+
hf_cand::NInteractionsWithMaterial);
24082412

24092413
// table with results of generator level MC matching
24102414
DECLARE_SOA_TABLE(HfCandDstarMcGen, "AOD", "HFCANDDSTRMCGEN",

PWGHF/TableProducer/candidateCreator2Prong.cxx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ struct HfCandidateCreator2ProngExpressions {
684684
// Configuration
685685
o2::framework::Configurable<bool> rejectBackground{"rejectBackground", true, "Reject particles from background events"};
686686
o2::framework::Configurable<bool> matchKinkedDecayTopology{"matchKinkedDecayTopology", false, "Match also candidates with tracks that decay with kinked topology"};
687+
o2::framework::Configurable<bool> matchInteractionsWithMaterial{"matchInteractionsWithMaterial", false, "Match also candidates with tracks that interact with material"};
687688

688689
HfEventSelectionMc hfEvSelMc; // mc event selection and monitoring
689690

@@ -732,6 +733,7 @@ struct HfCandidateCreator2ProngExpressions {
732733
int8_t flag = 0;
733734
int8_t origin = 0;
734735
int8_t nKinkedTracks = 0;
736+
int8_t nInteractionsWithMaterial = 0;
735737

736738
// Match reconstructed candidates.
737739
// Spawned table can be used directly
@@ -753,15 +755,19 @@ struct HfCandidateCreator2ProngExpressions {
753755
}
754756
}
755757
if (fromBkg) {
756-
rowMcMatchRec(flag, origin, -1.f, 0, 0);
758+
rowMcMatchRec(flag, origin, -1.f, 0, 0, 0);
757759
continue;
758760
}
759761
}
760762
std::vector<int> idxBhadMothers{};
761763

762764
// D0(bar) → π± K∓
763-
if (matchKinkedDecayTopology) {
764-
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true>(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1, &nKinkedTracks);
765+
if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
766+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1, &nKinkedTracks, &nInteractionsWithMaterial);
767+
} else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
768+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, false>(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1, &nKinkedTracks);
769+
} else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
770+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, false, true>(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1, nullptr, &nInteractionsWithMaterial);
765771
} else {
766772
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign);
767773
}
@@ -771,15 +777,23 @@ struct HfCandidateCreator2ProngExpressions {
771777

772778
// J/ψ → e+ e−
773779
if (flag == 0) {
774-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true);
780+
if (matchInteractionsWithMaterial) {
781+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, false, true>(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true, &sign, 1, nullptr, &nInteractionsWithMaterial);
782+
} else {
783+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true);
784+
}
775785
if (indexRec > -1) {
776786
flag = 1 << DecayType::JpsiToEE;
777787
}
778788
}
779789

780790
// J/ψ → μ+ μ−
781791
if (flag == 0) {
782-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true);
792+
if (matchInteractionsWithMaterial) {
793+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, false, true>(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true, &sign, 1, nullptr, &nInteractionsWithMaterial);
794+
} else {
795+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true);
796+
}
783797
if (indexRec > -1) {
784798
flag = 1 << DecayType::JpsiToMuMu;
785799
}
@@ -792,9 +806,9 @@ struct HfCandidateCreator2ProngExpressions {
792806
}
793807
if (origin == RecoDecay::OriginType::NonPrompt) {
794808
auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]);
795-
rowMcMatchRec(flag, origin, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks);
809+
rowMcMatchRec(flag, origin, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks, nInteractionsWithMaterial);
796810
} else {
797-
rowMcMatchRec(flag, origin, -1.f, 0, nKinkedTracks);
811+
rowMcMatchRec(flag, origin, -1.f, 0, nKinkedTracks, nInteractionsWithMaterial);
798812
}
799813
}
800814

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ struct HfCandidateCreator3ProngExpressions {
784784
// Configuration
785785
o2::framework::Configurable<bool> rejectBackground{"rejectBackground", true, "Reject particles from background events"};
786786
o2::framework::Configurable<bool> matchKinkedDecayTopology{"matchKinkedDecayTopology", false, "Match also candidates with tracks that decay with kinked topology"};
787+
o2::framework::Configurable<bool> matchInteractionsWithMaterial{"matchInteractionsWithMaterial", false, "Match also candidates with tracks that interact with material"};
787788

788789
bool createDplus{false};
789790
bool createDs{false};
@@ -856,6 +857,7 @@ struct HfCandidateCreator3ProngExpressions {
856857
int8_t swapping = 0;
857858
int8_t channel = 0;
858859
int8_t nKinkedTracks = 0;
860+
int8_t nInteractionsWithMaterial = 0;
859861
std::vector<int> arrDaughIndex;
860862
std::array<int, 2> arrPDGDaugh;
861863
std::array<int, 2> arrPDGResonant1 = {kProton, 313}; // Λc± → p± K*
@@ -888,15 +890,19 @@ struct HfCandidateCreator3ProngExpressions {
888890
}
889891
}
890892
if (fromBkg) {
891-
rowMcMatchRec(flag, origin, swapping, channel, -1.f, 0, 0);
893+
rowMcMatchRec(flag, origin, swapping, channel, -1.f, 0, 0, 0);
892894
continue;
893895
}
894896
}
895897

896898
// D± → π± K∓ π±
897899
if (createDplus) {
898-
if (matchKinkedDecayTopology) {
899-
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true>(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks);
900+
if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
901+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial);
902+
} else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
903+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, false>(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks);
904+
} else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
905+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, false, true>(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2, nullptr, &nInteractionsWithMaterial);
900906
} else {
901907
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
902908
}
@@ -908,15 +914,23 @@ struct HfCandidateCreator3ProngExpressions {
908914
// Ds± → K± K∓ π± and D± → K± K∓ π±
909915
if (flag == 0 && createDs) {
910916
bool isDplus = false;
911-
if (matchKinkedDecayTopology) {
912-
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true>(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks);
917+
if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
918+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial);
919+
} else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
920+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, false>(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks);
921+
} else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
922+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, false, true>(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, nullptr, &nInteractionsWithMaterial);
913923
} else {
914924
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
915925
}
916926
if (indexRec == -1) {
917927
isDplus = true;
918-
if (matchKinkedDecayTopology) {
919-
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true>(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks);
928+
if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
929+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial);
930+
} else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
931+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, false>(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks);
932+
} else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
933+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, false, true>(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, nullptr, &nInteractionsWithMaterial);
920934
} else {
921935
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
922936
}
@@ -945,8 +959,12 @@ struct HfCandidateCreator3ProngExpressions {
945959

946960
// Λc± → p± K∓ π±
947961
if (flag == 0 && createLc) {
948-
if (matchKinkedDecayTopology) {
949-
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true>(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks);
962+
if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
963+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial);
964+
} else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
965+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, false>(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks);
966+
} else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
967+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, false, true>(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, nullptr, &nInteractionsWithMaterial);
950968
} else {
951969
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
952970
}
@@ -976,8 +994,12 @@ struct HfCandidateCreator3ProngExpressions {
976994

977995
// Ξc± → p± K∓ π±
978996
if (flag == 0 && createXic) {
979-
if (matchKinkedDecayTopology) {
980-
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true>(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks);
997+
if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
998+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial);
999+
} else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
1000+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, false>(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks);
1001+
} else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
1002+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, false, true>(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, nullptr, &nInteractionsWithMaterial);
9811003
} else {
9821004
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
9831005
}
@@ -993,9 +1015,9 @@ struct HfCandidateCreator3ProngExpressions {
9931015
}
9941016
if (origin == RecoDecay::OriginType::NonPrompt) {
9951017
auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]);
996-
rowMcMatchRec(flag, origin, swapping, channel, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks);
1018+
rowMcMatchRec(flag, origin, swapping, channel, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks, nInteractionsWithMaterial);
9971019
} else {
998-
rowMcMatchRec(flag, origin, swapping, channel, -1.f, 0, nKinkedTracks);
1020+
rowMcMatchRec(flag, origin, swapping, channel, -1.f, 0, nKinkedTracks, nInteractionsWithMaterial);
9991021
}
10001022
}
10011023

0 commit comments

Comments
 (0)