@@ -57,7 +57,7 @@ struct femtoUniversePairTaskTrackTrackMcTruth {
5757
5858 // / Partition for particle 1
5959 Partition<aod::FDParticles> partsOne = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kMCTruthTrack )) &&
60- aod::femtouniverseparticle::pt < ConfPtHighPart1 && aod::femtouniverseparticle::pt > ConfPtLowPart1&& nabs(aod::femtouniverseparticle::eta) < ConfEtaMax;
60+ ( aod::femtouniverseparticle::pt < ConfPtHighPart1) && ( aod::femtouniverseparticle::pt > ConfPtLowPart1) && ( nabs(aod::femtouniverseparticle::eta) < ConfEtaMax) ;
6161
6262 // / Histogramming for particle 1
6363 FemtoUniverseParticleHisto<aod::femtouniverseparticle::ParticleType::kMCTruthTrack , 1 > trackHistoPartOne;
@@ -71,7 +71,7 @@ struct femtoUniversePairTaskTrackTrackMcTruth {
7171
7272 // / Partition for particle 2
7373 Partition<aod::FDParticles> partsTwo = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kMCTruthTrack )) &&
74- aod::femtouniverseparticle::pt < ConfPtHighPart2 && aod::femtouniverseparticle::pt > ConfPtLowPart2&& nabs(aod::femtouniverseparticle::eta) < ConfEtaMax;
74+ ( aod::femtouniverseparticle::pt < ConfPtHighPart2) && ( aod::femtouniverseparticle::pt > ConfPtLowPart2) && ( nabs(aod::femtouniverseparticle::eta) < ConfEtaMax) ;
7575
7676 // / Histogramming for particle 2
7777 FemtoUniverseParticleHisto<aod::femtouniverseparticle::ParticleType::kMCTruthTrack , 2 > trackHistoPartTwo;
@@ -176,23 +176,42 @@ struct femtoUniversePairTaskTrackTrackMcTruth {
176176 }
177177 }
178178 // / Now build the combinations
179- for (auto & [p1, p2] : combinations (CombinationsStrictlyUpperIndexPolicy (groupPartsOne, groupPartsTwo))) {
180- // track cleaning
181- if (!pairCleaner.isCleanPair (p1, p2, parts)) {
182- continue ;
183- }
184- if ((!ConfNoPDGPartOne && p2.pidcut () != ConfPDGCodePartOne) || (!ConfNoPDGPartTwo && p1.pidcut () != ConfPDGCodePartTwo)) {
185- continue ;
179+ if (!ConfIsSame) {
180+ // Build the combinations for pairs of non-identical particles
181+ for (auto & [p1, p2] : combinations (CombinationsFullIndexPolicy (groupPartsOne, groupPartsTwo))) {
182+ // track cleaning
183+ if (!pairCleaner.isCleanPair (p1, p2, parts)) {
184+ continue ;
185+ }
186+ if ((!ConfNoPDGPartOne && p2.pidcut () != ConfPDGCodePartOne) || (!ConfNoPDGPartTwo && p1.pidcut () != ConfPDGCodePartTwo)) {
187+ continue ;
188+ }
189+ if (swpart)
190+ sameEventCont.setPair <isMC>(p1, p2, multCol, ConfUse3D);
191+ else
192+ sameEventCont.setPair <isMC>(p2, p1, multCol, ConfUse3D);
193+
194+ swpart = !swpart;
186195 }
187- if (swpart)
188- sameEventCont.setPair <isMC>(p1, p2, multCol, ConfUse3D);
189- else
190- sameEventCont.setPair <isMC>(p2, p1, multCol, ConfUse3D);
196+ } else {
197+ // Build the combinations for pairs of identical pairs
198+ for (auto & [p1, p2] : combinations (CombinationsStrictlyUpperIndexPolicy (groupPartsOne, groupPartsTwo))) {
199+ // track cleaning
200+ if (!pairCleaner.isCleanPair (p1, p2, parts)) {
201+ continue ;
202+ }
203+ if ((!ConfNoPDGPartOne && p2.pidcut () != ConfPDGCodePartOne) || (!ConfNoPDGPartTwo && p1.pidcut () != ConfPDGCodePartTwo)) {
204+ continue ;
205+ }
206+ if (swpart)
207+ sameEventCont.setPair <isMC>(p1, p2, multCol, ConfUse3D);
208+ else
209+ sameEventCont.setPair <isMC>(p2, p1, multCol, ConfUse3D);
191210
192- swpart = !swpart;
211+ swpart = !swpart;
212+ }
193213 }
194214 }
195-
196215 // / process function for to call doSameEvent with Data
197216 // / \param col subscribe to the collision table (Data)
198217 // / \param parts subscribe to the femtoUniverseParticleTable
0 commit comments