You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit eab29c9
Browse filesBrowse the repository at this point in the historyBrowse files
/// Finds the mother of an MC particle by looking for the expected PDG code in the mother chain.
565
610
/// \tparam acceptFlavourOscillation switch to accept decays where the mother oscillated (e.g. B0 -> B0bar)
566
611
/// \param particlesMC table with MC particles
@@ -599,10 +644,12 @@ struct RecoDecay {
599
644
for (auto iPart : arrayIds[-stage]) { // check all the particles that were the mothers at the previous stage, o2-linter: disable=const-ref-in-for-loop (int elements)
600
645
auto particleMother = particlesMC.rawIteratorAt(iPart - particlesMC.offset());
601
646
if (particleMother.has_mothers()) {
602
-
// If searchUpToQuark is false we only take the first mother (since decay products only have one mother)
603
-
auto lastMotherIdxToCheck = searchUpToQuark ? particleMother.mothersIds().back() : particleMother.mothersIds().front();
604
-
for (auto iMother = particleMother.mothersIds().front(); iMother <= lastMotherIdxToCheck; ++iMother) { // loop over the mother particles of the analysed particle
605
-
if (std::find(arrayIdsStage.begin(), arrayIdsStage.end(), iMother) != arrayIdsStage.end()) { // if a mother is still present in the vector, do not check it again
for (autoconst& iMother : motherIdsOrdered) { // loop over the mother particles of the analysed particle
652
+
if (std::find(arrayIdsStage.begin(), arrayIdsStage.end(), iMother) != arrayIdsStage.end()) { // if a mother is still present in the vector, do not check it again
606
653
continue;
607
654
}
608
655
auto mother = particlesMC.rawIteratorAt(iMother - particlesMC.offset());
@@ -1059,6 +1106,7 @@ struct RecoDecay {
1059
1106
while (arrayIds[-stage].size() > 0) {
1060
1107
// vector of mother indices for the current stage
1061
1108
std::vector<int64_t> arrayIdsStage{};
1109
+
std::vector<int64_t> motherIdsOrdered{};
1062
1110
for (auto iPart : arrayIds[-stage]) { // check all the particles that were the mothers at the previous stage, o2-linter: disable=const-ref-in-for-loop (int elements)
1063
1111
auto particleMother = particlesMC.rawIteratorAt(iPart - particlesMC.offset());
1064
1112
if (particleMother.has_mothers()) {
@@ -1072,8 +1120,9 @@ struct RecoDecay {
1072
1120
}
1073
1121
}
1074
1122
1075
-
for (auto iMother = particleMother.mothersIds().front(); iMother <= particleMother.mothersIds().back(); ++iMother) { // loop over the mother particles of the analysed particle
1076
-
if (std::find(arrayIdsStage.begin(), arrayIdsStage.end(), iMother) != arrayIdsStage.end()) { // if a mother is still present in the vector, do not check it again
for (autoconst& iMother : motherIdsOrdered) { // loop over the mother particles of the analysed particle
1125
+
if (std::find(arrayIdsStage.begin(), arrayIdsStage.end(), iMother) != arrayIdsStage.end()) { // if a mother is still present in the vector, do not check it again
1077
1126
continue;
1078
1127
}
1079
1128
auto mother = particlesMC.rawIteratorAt(iMother - particlesMC.offset());
@@ -1161,30 +1210,11 @@ struct RecoDecay {
1161
1210
auto particleMother = particlesMC.rawIteratorAt(iPart - particlesMC.offset());
1162
1211
if (particleMother.has_mothers()) {
1163
1212
1164
-
// we break immediately if searchUpToQuark is false and the first mother is a quark or a boson (a hadron should never be the mother of a parton)
1165
-
if (!searchUpToQuark) {
1166
-
auto mother = particlesMC.rawIteratorAt(particleMother.mothersIds().front() - particlesMC.offset());
1167
-
auto pdgParticleIMother = std::abs(mother.pdgCode()); // PDG code of the mother
for (auto iMother = particleMother.mothersIds().front(); iMother <= particleMother.mothersIds().back(); ++iMother) {// loop over the mother particles of the analysed particle
1187
-
if (std::find(arrayIdsStage.begin(), arrayIdsStage.end(), iMother) != arrayIdsStage.end()) { // if a mother is still present in the vector, do not check it again
1216
+
for (autoconst& iMother : motherIdsOrdered) { // loop over the mother particles of the analysed particle
1217
+
if (std::find(arrayIdsStage.begin(), arrayIdsStage.end(), iMother) != arrayIdsStage.end()) { // if a mother is still present in the vector, do not check it again
1188
1218
continue;
1189
1219
}
1190
1220
auto mother = particlesMC.rawIteratorAt(iMother - particlesMC.offset());
0 commit comments