@@ -572,13 +572,28 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
572572 // / \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth
573573 // / \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table
574574 void processSameEventMC (o2::aod::FdCollision& col,
575- soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels>& /* parts*/ ,
575+ soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels>& parts,
576576 o2::aod::FdMCParticles&)
577577 {
578578 fillCollision (col);
579579
580580 auto thegroupPartsOne = partsOneMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, col.globalIndex (), cache);
581581 auto thegroupPartsTwo = partsTwoMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, col.globalIndex (), cache);
582+ bool fillQA = true ;
583+ randgen = new TRandom2 (0 );
584+
585+ if (cfgProcessPM) {
586+ doSameEvent<false >(thegroupPartsOne, thegroupPartsTwo, parts, col.magField (), col.multV0M (), 1 , fillQA);
587+ }
588+
589+ if (cfgProcessPP) {
590+ doSameEvent<false >(thegroupPartsOne, thegroupPartsOne, parts, col.magField (), col.multV0M (), 2 , fillQA);
591+ }
592+
593+ if (cfgProcessMM) {
594+ doSameEvent<false >(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField (), col.multV0M (), 3 , fillQA);
595+ }
596+ delete randgen;
582597 }
583598 PROCESS_SWITCH (femtoUniversePairTaskTrackTrackSpherHarMultKtExtended, processSameEventMC, " Enable processing same event for Monte Carlo" , false );
584599
@@ -716,9 +731,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
716731 // / @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth
717732 // / @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table
718733 void processMixedEventMC (o2::aod::FdCollisions& cols,
719- soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels>& /* parts*/ ,
734+ soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels>& parts,
720735 o2::aod::FdMCParticles&)
721736 {
737+ randgen = new TRandom2 (0 );
738+
722739 for (auto & [collision1, collision2] : soa::selfCombinations (colBinning, ConfNEventsMix, -1 , cols, cols)) {
723740
724741 const int multiplicityCol = collision1.multV0M ();
@@ -732,7 +749,24 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended {
732749 }
733750 // / \todo before mixing we should check whether both collisions contain a pair of particles!
734751 // if (partsOne.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTwo.size() == 0 ) continue;
752+
753+ if (cfgProcessPM) {
754+ auto groupPartsOne = partsOneMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex (), cache);
755+ auto groupPartsTwo = partsTwoMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex (), cache);
756+ doMixedEvent<false >(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 1 );
757+ }
758+ if (cfgProcessPP) {
759+ auto groupPartsOne = partsOneMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex (), cache);
760+ auto groupPartsTwo = partsOneMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex (), cache);
761+ doMixedEvent<false >(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 2 );
762+ }
763+ if (cfgProcessMM) {
764+ auto groupPartsOne = partsTwoMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex (), cache);
765+ auto groupPartsTwo = partsTwoMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex (), cache);
766+ doMixedEvent<false >(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 3 );
767+ }
735768 }
769+ delete randgen;
736770 }
737771 PROCESS_SWITCH (femtoUniversePairTaskTrackTrackSpherHarMultKtExtended, processMixedEventMC, " Enable processing mixed events MC" , false );
738772};
@@ -743,4 +777,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
743777 adaptAnalysisTask<femtoUniversePairTaskTrackTrackSpherHarMultKtExtended>(cfgc),
744778 };
745779 return workflow;
746- }
780+ }
0 commit comments