From b11f2f759f0071a824babe1af8c0ec02f3e771f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zuzanna=20Chochulska-Gumi=C5=84ska?= Date: Thu, 12 Nov 2026 18:56:23 +0100 Subject: [PATCH 1/3] new process for K+K+ and K-K- invariant mass --- .../Tasks/femtoUniversePairTaskTrackPhi.cxx | 87 ++++++++++++++----- 1 file changed, 64 insertions(+), 23 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index 8b5948e5472..bd3606347e4 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -97,7 +97,6 @@ struct FemtoUniversePairTaskTrackPhi { Preslice perColMC = aod::femtouniverseparticle::fdCollisionId; Configurable confZVertexCut{"confZVertexCut", 10.f, "Event sel: Maximum z-Vertex (cm)"}; - // Configurable confNEventsMix{"confNEventsMix", 5, "Number of events for mixing"}; Filter collisionFilter = (nabs(aod::collision::posZ) < confZVertexCut); using FilteredFDCollisions = soa::Filtered; using FilteredFDCollision = FilteredFDCollisions::iterator; @@ -138,12 +137,12 @@ struct FemtoUniversePairTaskTrackPhi { Configurable confTrackUseRun3PIDforKaons{"confTrackUseRun3PIDforKaons", true, "Use Run3 PID for kaons from Veronika Barbasova's AN (https://alice-notes.web.cern.ch/node/1758). If this is on the other PID methods are ignored for kaons."}; /// Partitions for the track (particle 1) - Partition partsTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && + Partition partsTrack = (aod::femtouniverseparticle::partType == static_cast(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == confTrackSign) && (aod::femtouniverseparticle::pt > confTrackPtLow) && (aod::femtouniverseparticle::pt < confTrackPtHigh); - Partition partsTrackMCReco = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && + Partition partsTrackMCReco = (aod::femtouniverseparticle::partType == static_cast(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == confTrackSign) && (aod::femtouniverseparticle::pt > confTrackPtLow) && (aod::femtouniverseparticle::pt < confTrackPtHigh); @@ -154,27 +153,30 @@ struct FemtoUniversePairTaskTrackPhi { Configurable confInvMassLowLimitPhi{"confInvMassLowLimitPhi", 1.011, "Lower limit of the Phi invariant mass"}; // change that to do invariant mass cut Configurable confInvMassUpLimitPhi{"confInvMassUpLimitPhi", 1.027, "Upper limit of the Phi invariant mass"}; Configurable confFillMinvBackground{"confFillMinvBackground", false, "Fill background histograms for Phi invariant mass."}; + Configurable confFillMinvBackgroundKpKm{"confFillMinvBackgroundKpKm", false, "Fill background histograms for K+K- invariant mass."}; + Configurable confFillMinvBackgroundKpKp{"confFillMinvBackgroundKpKp", false, "Fill background histograms for K+K+ invariant mass."}; + Configurable confFillMinvBackgroundKmKm{"confFillMinvBackgroundKmKm", false, "Fill background histograms for K-K- invariant mass."}; /// Partitions for the Phi meson (particle 2) - Partition partsPhi = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kPhi)) && + Partition partsPhi = (aod::femtouniverseparticle::partType == static_cast(aod::femtouniverseparticle::ParticleType::kPhi)) && (aod::femtouniverseparticle::pt > confPhiPtLow) && (aod::femtouniverseparticle::pt < confPhiPtHigh) && (aod::femtouniverseparticle::tempFitVar > confInvMassLowLimitPhi) && (aod::femtouniverseparticle::tempFitVar < confInvMassUpLimitPhi); - Partition partsPhiMCReco = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kPhi)) && + Partition partsPhiMCReco = (aod::femtouniverseparticle::partType == static_cast(aod::femtouniverseparticle::ParticleType::kPhi)) && (aod::femtouniverseparticle::pt > confPhiPtLow) && (aod::femtouniverseparticle::pt < confPhiPtHigh) && (aod::femtouniverseparticle::tempFitVar > confInvMassLowLimitPhi) && (aod::femtouniverseparticle::tempFitVar < confInvMassUpLimitPhi); /// Partitions for Phi daughters kPhiChild - Partition partsPhiDaugh = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kPhiChild)); - Partition> partsPhiDaughMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kPhiChild)); + Partition partsPhiDaugh = (aod::femtouniverseparticle::partType == static_cast(aod::femtouniverseparticle::ParticleType::kPhiChild)); + Partition> partsPhiDaughMC = (aod::femtouniverseparticle::partType == static_cast(aod::femtouniverseparticle::ParticleType::kPhiChild)); // Partition for K+K- minv - Partition partsKaons = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)); - Partition> partsKaonsMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)); + Partition partsKaons = (aod::femtouniverseparticle::partType == static_cast(aod::femtouniverseparticle::ParticleType::kTrack)); + Partition> partsKaonsMC = (aod::femtouniverseparticle::partType == static_cast(aod::femtouniverseparticle::ParticleType::kTrack)); /// Histogramming for particle 1 FemtoUniverseParticleHisto trackHistoPartTrack; @@ -554,32 +556,31 @@ struct FemtoUniversePairTaskTrackPhi { if (confFillMinvBackground) { // Used for better fitting of invariant mass background. - TLorentzVector part1Vec; TLorentzVector part2Vec; - float mMassOne = o2::constants::physics::MassKPlus; - float mMassTwo = o2::constants::physics::MassKMinus; + float mMassKp = o2::constants::physics::MassKPlus; + float mMassKm = o2::constants::physics::MassKMinus; for (auto const& [kaon1, kaon2] : combinations(CombinationsStrictlyUpperIndexPolicy(partsKaons, partsKaons))) { - if ((kaon1.mAntiLambda() == 1) && (kaon2.mAntiLambda() == 1)) { - part1Vec.SetPtEtaPhiM(kaon1.pt(), kaon1.eta(), kaon1.phi(), mMassOne); - part2Vec.SetPtEtaPhiM(kaon2.pt(), kaon2.eta(), kaon2.phi(), mMassOne); + if ((confFillMinvBackgroundKpKp) && (kaon1.mAntiLambda() == 1) && (kaon2.mAntiLambda() == 1)) { + part1Vec.SetPtEtaPhiM(kaon1.pt(), kaon1.eta(), kaon1.phi(), mMassKp); + part2Vec.SetPtEtaPhiM(kaon2.pt(), kaon2.eta(), kaon2.phi(), mMassKp); TLorentzVector sumVec(part1Vec); sumVec += part2Vec; registryPhiMinvBackground.fill(HIST("InvariantMassKpKp"), sumVec.M()); } - if ((kaon1.mAntiLambda() == -1) && (kaon2.mAntiLambda() == -1)) { - part1Vec.SetPtEtaPhiM(kaon1.pt(), kaon1.eta(), kaon1.phi(), mMassTwo); - part2Vec.SetPtEtaPhiM(kaon2.pt(), kaon2.eta(), kaon2.phi(), mMassTwo); + if ((confFillMinvBackgroundKmKm) && (kaon1.mAntiLambda() == -1) && (kaon2.mAntiLambda() == -1)) { + part1Vec.SetPtEtaPhiM(kaon1.pt(), kaon1.eta(), kaon1.phi(), mMassKm); + part2Vec.SetPtEtaPhiM(kaon2.pt(), kaon2.eta(), kaon2.phi(), mMassKm); TLorentzVector sumVec(part1Vec); sumVec += part2Vec; registryPhiMinvBackground.fill(HIST("InvariantMassKmKm"), sumVec.M()); } - if ((kaon1.mAntiLambda() == 1) && (kaon2.mAntiLambda() == -1)) { - part1Vec.SetPtEtaPhiM(kaon1.pt(), kaon1.eta(), kaon1.phi(), mMassOne); - part2Vec.SetPtEtaPhiM(kaon2.pt(), kaon2.eta(), kaon2.phi(), mMassTwo); + if ((confFillMinvBackgroundKpKm) && (kaon1.mAntiLambda() == 1) && (kaon2.mAntiLambda() == -1)) { + part1Vec.SetPtEtaPhiM(kaon1.pt(), kaon1.eta(), kaon1.phi(), mMassKp); + part2Vec.SetPtEtaPhiM(kaon2.pt(), kaon2.eta(), kaon2.phi(), mMassKm); TLorentzVector sumVec(part1Vec); sumVec += part2Vec; @@ -681,7 +682,7 @@ struct FemtoUniversePairTaskTrackPhi { void processMCTruth(aod::FDParticles const& parts) { for (auto const& part : parts) { - if (part.partType() != uint8_t(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) { + if (part.partType() != static_cast(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) { continue; } @@ -781,6 +782,46 @@ struct FemtoUniversePairTaskTrackPhi { } PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processMCReco, "Process MC reco data", false); + + void processMinvBackground() + { + if (!confFillMinvBackground) { + return; + } + + TLorentzVector part1Vec; + TLorentzVector part2Vec; + + float mMassOne = o2::constants::physics::MassKPlus; + float mMassTwo = o2::constants::physics::MassKMinus; + + for (auto const& [kaon1, kaon2] : combinations(CombinationsStrictlyUpperIndexPolicy(partsKaons, partsKaons))) { + if ((confFillMinvBackgroundKpKp) && (kaon1.mAntiLambda() == 1) && (kaon2.mAntiLambda() == 1)) { + part1Vec.SetPtEtaPhiM(kaon1.pt(), kaon1.eta(), kaon1.phi(), mMassOne); + part2Vec.SetPtEtaPhiM(kaon2.pt(), kaon2.eta(), kaon2.phi(), mMassOne); + TLorentzVector sumVec(part1Vec); + sumVec += part2Vec; + registryPhiMinvBackground.fill(HIST("InvariantMassKpKp"), sumVec.M()); + } + if ((confFillMinvBackgroundKmKm) && (kaon1.mAntiLambda() == -1) && (kaon2.mAntiLambda() == -1)) { + part1Vec.SetPtEtaPhiM(kaon1.pt(), kaon1.eta(), kaon1.phi(), mMassTwo); + part2Vec.SetPtEtaPhiM(kaon2.pt(), kaon2.eta(), kaon2.phi(), mMassTwo); + + TLorentzVector sumVec(part1Vec); + sumVec += part2Vec; + registryPhiMinvBackground.fill(HIST("InvariantMassKmKm"), sumVec.M()); + } + if ((confFillMinvBackgroundKpKm) && (kaon1.mAntiLambda() == 1) && (kaon2.mAntiLambda() == -1)) { + part1Vec.SetPtEtaPhiM(kaon1.pt(), kaon1.eta(), kaon1.phi(), mMassOne); + part2Vec.SetPtEtaPhiM(kaon2.pt(), kaon2.eta(), kaon2.phi(), mMassTwo); + + TLorentzVector sumVec(part1Vec); + sumVec += part2Vec; + registryPhiMinvBackground.fill(HIST("InvariantMassKpKm"), sumVec.M()); + } + } + } + PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processMinvBackground, "Enable processing invariant mass background for kaon pairs (K+K+, K-K-, K+K-)", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) @@ -789,4 +830,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) adaptAnalysisTask(cfgc), }; return workflow; -} +} \ No newline at end of file From 1a4a33a0e96a982b548f14bdb6f163044d4fcb0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zuzanna=20Chochulska-Gumi=C5=84ska?= Date: Thu, 12 Nov 2026 19:05:45 +0100 Subject: [PATCH 2/3] clang test --- PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index bd3606347e4..b70d8bd4a41 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -830,4 +830,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) adaptAnalysisTask(cfgc), }; return workflow; -} \ No newline at end of file +} From a754f9d1c54c4147212cc63bcee37202069e6651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zuzanna=20Chochulska-Gumi=C5=84ska?= Date: Thu, 12 Nov 2026 20:10:25 +0100 Subject: [PATCH 3/3] Arguments in a process function --- PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index b70d8bd4a41..bf57c06eefe 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -783,7 +783,7 @@ struct FemtoUniversePairTaskTrackPhi { PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processMCReco, "Process MC reco data", false); - void processMinvBackground() + void processMinvBackground(aod::Tracks const& tracks, aod::Collisions const& collisions) { if (!confFillMinvBackground) { return;