|
22 | 22 | #include "PWGLF/DataModel/LFStrangenessTables.h" |
23 | 23 |
|
24 | 24 | #include "ALICE3/Core/TrackUtilities.h" |
25 | | -#include "ALICE3/DataModel/OTFMCParticle.h" |
26 | 25 | #include "ALICE3/DataModel/OTFPIDTrk.h" |
27 | 26 | #include "ALICE3/DataModel/OTFRICH.h" |
28 | 27 | #include "ALICE3/DataModel/OTFStrangeness.h" |
@@ -66,7 +65,7 @@ using namespace o2::constants::physics; |
66 | 65 |
|
67 | 66 | using Alice3TracksWPid = soa::Join<aod::Tracks, aod::TracksCov, aod::McTrackLabels, aod::TracksDCA, aod::UpgradeTrkPids, aod::UpgradeTofs, aod::UpgradeRichs>; |
68 | 67 | using Alice3TracksACTS = soa::Join<aod::StoredTracks, aod::StoredTracksCov, aod::McTrackLabels, aod::TracksDCA, aod::TracksCovExtension, aod::TracksAlice3, aod::TracksAlice3Pdg>; |
69 | | -using Alice3TracksOTF = soa::Join<aod::StoredTracks, aod::StoredTracksCov, aod::McTrackWithDauLabels, aod::TracksDCA, aod::TracksCovExtension, aod::TracksAlice3>; |
| 68 | +using Alice3TracksOTF = soa::Join<aod::StoredTracks, aod::StoredTracksCov, aod::McTrackLabels, aod::TracksDCA, aod::TracksCovExtension, aod::TracksAlice3>; |
70 | 69 | using Alice3MCParticles = soa::Join<aod::McParticles, aod::MCParticlesExtraA3>; |
71 | 70 |
|
72 | 71 | struct Alice3strangenessFinder { |
@@ -270,34 +269,21 @@ struct Alice3strangenessFinder { |
270 | 269 | template <typename TTrackType> |
271 | 270 | bool checkSameMother(TTrackType const& track1, TTrackType const& track2) |
272 | 271 | { |
273 | | - // MC label points to McPartWithDaus |
274 | | - if constexpr (requires { track1.has_mcPartWithDau(); }) { |
275 | | - if (!track1.has_mcPartWithDau() || !track2.has_mcPartWithDau()) { |
276 | | - return false; |
277 | | - } |
278 | | - auto mcParticle1 = track1.template mcPartWithDau_as<aod::McPartWithDaus>(); |
279 | | - auto mcParticle2 = track2.template mcPartWithDau_as<aod::McPartWithDaus>(); |
280 | | - if (mcParticle1.mothersIds().empty() || mcParticle2.mothersIds().empty()) { |
281 | | - return false; |
282 | | - } |
283 | | - return mcParticle1.mothersIds()[0] == mcParticle2.mothersIds()[0]; |
284 | | - } else { // MC label points directly to aod::McParticles |
285 | | - bool returnValue = false; |
286 | | - if (track1.has_mcParticle() && track2.has_mcParticle()) { |
287 | | - auto mcParticle1 = track1.template mcParticle_as<aod::McParticles>(); |
288 | | - auto mcParticle2 = track2.template mcParticle_as<aod::McParticles>(); |
289 | | - if (mcParticle1.has_mothers() && mcParticle2.has_mothers()) { |
290 | | - for (const auto& m1 : mcParticle1.template mothers_as<aod::McParticles>()) { |
291 | | - for (const auto& m2 : mcParticle2.template mothers_as<aod::McParticles>()) { |
292 | | - if (m1.globalIndex() == m2.globalIndex()) { |
293 | | - returnValue = true; |
294 | | - } |
| 272 | + bool returnValue = false; |
| 273 | + if (track1.has_mcParticle() && track2.has_mcParticle()) { |
| 274 | + auto mcParticle1 = track1.template mcParticle_as<aod::McParticles>(); |
| 275 | + auto mcParticle2 = track2.template mcParticle_as<aod::McParticles>(); |
| 276 | + if (mcParticle1.has_mothers() && mcParticle2.has_mothers()) { |
| 277 | + for (const auto& m1 : mcParticle1.template mothers_as<aod::McParticles>()) { |
| 278 | + for (const auto& m2 : mcParticle2.template mothers_as<aod::McParticles>()) { |
| 279 | + if (m1.globalIndex() == m2.globalIndex()) { |
| 280 | + returnValue = true; |
295 | 281 | } |
296 | 282 | } |
297 | 283 | } |
298 | 284 | } |
299 | | - return returnValue; |
300 | 285 | } |
| 286 | + return returnValue; |
301 | 287 | } |
302 | 288 |
|
303 | 289 | template <typename TTrackType> |
@@ -465,18 +451,16 @@ struct Alice3strangenessFinder { |
465 | 451 | } |
466 | 452 |
|
467 | 453 | // OTF: pdg code from mcParticle table |
468 | | - if constexpr (requires { posTrack.has_mcPartWithDau(); }) { |
469 | | - if (!posTrack.has_mcPartWithDau() && !negTrack.has_mcPartWithDau()) { |
470 | | - continue; |
471 | | - } |
472 | | - auto mcParticlePos = posTrack.template mcPartWithDau_as<aod::McPartWithDaus>(); |
473 | | - auto mcParticleNeg = negTrack.template mcPartWithDau_as<aod::McPartWithDaus>(); |
474 | | - if ((mcParticlePos.pdgCode() != kPiPlus && mcParticleNeg.pdgCode() != kPiMinus) && isK0Gun) { |
475 | | - continue; |
476 | | - } |
477 | | - if ((mcParticlePos.pdgCode() != kProton && mcParticleNeg.pdgCode() != kPiMinus) && isLambdaGun) { |
478 | | - continue; |
479 | | - } |
| 454 | + if (!posTrack.has_mcParticle() && !negTrack.has_mcParticle()) { |
| 455 | + continue; |
| 456 | + } |
| 457 | + auto mcParticlePos = posTrack.template mcParticle_as<aod::McParticles>(); |
| 458 | + auto mcParticleNeg = negTrack.template mcParticle_as<aod::McParticles>(); |
| 459 | + if ((mcParticlePos.pdgCode() != kPiPlus && mcParticleNeg.pdgCode() != kPiMinus) && isK0Gun) { |
| 460 | + continue; |
| 461 | + } |
| 462 | + if ((mcParticlePos.pdgCode() != kProton && mcParticleNeg.pdgCode() != kPiMinus) && isLambdaGun) { |
| 463 | + continue; |
480 | 464 | } |
481 | 465 |
|
482 | 466 | histos.fill(HIST("hV0Building"), 2.0); |
@@ -682,7 +666,7 @@ struct Alice3strangenessFinder { |
682 | 666 | processFindV0CandidateNoPid(collision, negTracksGrouped, posTracksGrouped, bachTracksGrouped); |
683 | 667 | } |
684 | 668 |
|
685 | | - void processFindV0CandidateOTF(aod::Collision const& collision, Alice3TracksOTF const&, aod::McPartWithDaus const&) |
| 669 | + void processFindV0CandidateOTF(aod::Collision const& collision, Alice3TracksOTF const&, aod::McParticles const&) |
686 | 670 | { |
687 | 671 | auto negTracksGrouped = negativeSecondaryTracksOTF->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); |
688 | 672 | auto posTracksGrouped = positiveSecondaryTracksOTF->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); |
|
0 commit comments