@@ -134,6 +134,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
134134 Configurable<float > ConfV0MHigh{" ConfV0MHigh" , 25000.0 , " Upper limit for V0M multiplicity" };
135135 Configurable<int > ConfTPCOccupancyLow{" ConfTPCOccupancyLow" , 0 , " Lower limit for TPC occupancy" };
136136 Configurable<int > ConfTPCOccupancyHigh{" ConfTPCOccupancyHigh" , 500 , " Higher limit for TPC occupancy" };
137+ Configurable<bool > ConfIsCent{" ConfIsCent" , true , " Condition to choose centrality of multiplicity for mixing" };
137138
138139 Filter collfilter = (o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh) &&
139140 (o2::aod::femtouniversecollision::occupancy > ConfTPCOccupancyLow) && (o2::aod::femtouniversecollision::occupancy < ConfTPCOccupancyHigh);
@@ -153,7 +154,8 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
153154 ConfigurableAxis ConfmTBins3D{" ConfmTBins3D" , {VARIABLE_WIDTH, 1 .02f , 1 .14f , 1 .20f , 1 .26f , 1 .38f , 1 .56f , 1 .86f , 4 .50f }, " mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <<twotracksconfigs.ConfUse3D>> to true in order to use)" };
154155 ConfigurableAxis ConfmultBins3D{" ConfmultBins3D" , {VARIABLE_WIDTH, 0 .0f , 20 .0f , 30 .0f , 40 .0f , 99999 .0f }, " multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <<twotracksconfigs.ConfUse3D>> to true in order to use)" };
155156
156- ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultV0M> colBinning{{ConfVtxBins, ConfMultBins}, true };
157+ ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultV0M> colBinningCent{{ConfVtxBins, ConfMultBins}, true };
158+ ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultNtr> colBinningNtr{{ConfVtxBins, ConfMultBins}, true };
157159
158160 ConfigurableAxis ConfkstarBins{" ConfkstarBins" , {300 , -1.5 , 1.5 }, " binning kstar" };
159161 ConfigurableAxis ConfkTBins{" ConfkTBins" , {150 , 0 ., 9 .}, " binning kT" };
@@ -416,9 +418,13 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
416418 }
417419
418420 template <typename CollisionType>
419- void fillCollision (CollisionType col)
421+ void fillCollision (CollisionType col, bool IsCent )
420422 {
421- MixQaRegistry.fill (HIST (" MixingQA/hSECollisionBins" ), colBinning.getBin ({col.posZ (), col.multV0M ()}));
423+ if (IsCent) {
424+ MixQaRegistry.fill (HIST (" MixingQA/hSECollisionBins" ), colBinningCent.getBin ({col.posZ (), col.multV0M ()}));
425+ } else {
426+ MixQaRegistry.fill (HIST (" MixingQA/hSECollisionBins" ), colBinningNtr.getBin ({col.posZ (), col.multNtr ()}));
427+ }
422428 eventHisto.fillQA (col);
423429 }
424430
@@ -438,7 +444,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
438444
439445 // / Histogramming same event
440446 if ((ContType == 1 || ContType == 2 ) && fillQA) {
441- for (auto & part : groupPartsOne) {
447+ for (const auto & part : groupPartsOne) {
442448 if (!IsParticleNSigma ((int8_t )1 , part.p (), trackCuts.getNsigmaTPC (part, o2::track::PID::Proton), trackCuts.getNsigmaTOF (part, o2::track::PID::Proton), trackCuts.getNsigmaTPC (part, o2::track::PID::Pion), trackCuts.getNsigmaTOF (part, o2::track::PID::Pion), trackCuts.getNsigmaTPC (part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF (part, o2::track::PID::Kaon))) {
443449 continue ;
444450 }
@@ -447,7 +453,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
447453 }
448454
449455 if ((ContType == 1 || ContType == 3 ) && fillQA) {
450- for (auto & part : groupPartsTwo) {
456+ for (const auto & part : groupPartsTwo) {
451457 if (!IsParticleNSigma ((int8_t )2 , part.p (), trackCuts.getNsigmaTPC (part, o2::track::PID::Proton), trackCuts.getNsigmaTOF (part, o2::track::PID::Proton), trackCuts.getNsigmaTPC (part, o2::track::PID::Pion), trackCuts.getNsigmaTOF (part, o2::track::PID::Pion), trackCuts.getNsigmaTPC (part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF (part, o2::track::PID::Kaon))) {
452458 continue ;
453459 }
@@ -458,7 +464,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
458464 if (ContType == 1 ) {
459465
460466 // / Now build the combinations for non-identical particle pairs
461- for (auto & [p1, p2] : combinations (CombinationsFullIndexPolicy (groupPartsOne, groupPartsTwo))) {
467+ for (const auto & [p1, p2] : combinations (CombinationsFullIndexPolicy (groupPartsOne, groupPartsTwo))) {
462468
463469 if (!IsParticleNSigma ((int8_t )1 , p1.p (), trackCuts.getNsigmaTPC (p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF (p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC (p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF (p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC (p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF (p1, o2::track::PID::Kaon))) {
464470 continue ;
@@ -491,7 +497,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
491497 } else {
492498 // / Now build the combinations for identical particles pairs
493499 double rand;
494- for (auto & [p1, p2] : combinations (CombinationsStrictlyUpperIndexPolicy (groupPartsOne, groupPartsOne))) {
500+ for (const auto & [p1, p2] : combinations (CombinationsStrictlyUpperIndexPolicy (groupPartsOne, groupPartsOne))) {
495501
496502 if (!IsParticleNSigma ((int8_t )2 , p1.p (), trackCuts.getNsigmaTPC (p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF (p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC (p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF (p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC (p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF (p1, o2::track::PID::Kaon))) {
497503 continue ;
@@ -571,7 +577,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
571577 void processSameEvent (FilteredFDCollision& col,
572578 FilteredFemtoFullParticles& parts)
573579 {
574- fillCollision (col);
580+ fillCollision (col, ConfIsCent );
575581
576582 auto thegroupPartsOne = partsOne->sliceByCached (aod::femtouniverseparticle::fdCollisionId, col.globalIndex (), cache);
577583 auto thegroupPartsTwo = partsTwo->sliceByCached (aod::femtouniverseparticle::fdCollisionId, col.globalIndex (), cache);
@@ -602,7 +608,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
602608 soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels>& parts,
603609 o2::aod::FdMCParticles&)
604610 {
605- fillCollision (col);
611+ fillCollision (col, ConfIsCent );
606612
607613 auto thegroupPartsOne = partsOneMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, col.globalIndex (), cache);
608614 auto thegroupPartsTwo = partsTwoMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, col.globalIndex (), cache);
@@ -639,7 +645,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
639645 void doMixedEvent (PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol, int ContType)
640646 {
641647
642- for (auto & [p1, p2] : combinations (CombinationsFullIndexPolicy (groupPartsOne, groupPartsTwo))) {
648+ for (const auto & [p1, p2] : combinations (CombinationsFullIndexPolicy (groupPartsOne, groupPartsTwo))) {
643649
644650 if (!IsParticleNSigma ((int8_t )2 , p1.p (), trackCuts.getNsigmaTPC (p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF (p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC (p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF (p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC (p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF (p1, o2::track::PID::Kaon))) {
645651 continue ;
@@ -730,15 +736,15 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
730736 // / process function for to call doMixedEvent with Data
731737 // / @param cols subscribe to the collisions table (Data)
732738 // / @param parts subscribe to the femtoUniverseParticleTable
733- void processMixedEvent (FilteredFDCollisions& cols,
734- FilteredFemtoFullParticles& parts)
739+ void processMixedEventCent (FilteredFDCollisions& cols,
740+ FilteredFemtoFullParticles& parts)
735741 {
736742 randgen = new TRandom2 (0 );
737743
738- for (auto & [collision1, collision2] : soa::selfCombinations (colBinning , ConfNEventsMix, -1 , cols, cols)) {
744+ for (const auto & [collision1, collision2] : soa::selfCombinations (colBinningCent , ConfNEventsMix, -1 , cols, cols)) {
739745
740746 const int multiplicityCol = collision1.multV0M ();
741- MixQaRegistry.fill (HIST (" MixingQA/hMECollisionBins" ), colBinning .getBin ({collision1.posZ (), multiplicityCol}));
747+ MixQaRegistry.fill (HIST (" MixingQA/hMECollisionBins" ), colBinningCent .getBin ({collision1.posZ (), multiplicityCol}));
742748
743749 const auto & magFieldTesla1 = collision1.magField ();
744750 const auto & magFieldTesla2 = collision2.magField ();
@@ -765,22 +771,106 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
765771 }
766772 delete randgen;
767773 }
768- PROCESS_SWITCH (femtoUniversePairTaskTrackTrack3DMultKtExtended, processMixedEvent , " Enable processing mixed events" , true );
774+ PROCESS_SWITCH (femtoUniversePairTaskTrackTrack3DMultKtExtended, processMixedEventCent , " Enable processing mixed events" , true );
769775
770776 // / brief process function for to call doMixedEvent with Monte Carlo
771777 // / @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed)
772778 // / @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth
773779 // / @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table
774- void processMixedEventMC (o2::aod::FdCollisions& cols,
775- soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels>& parts,
776- o2::aod::FdMCParticles&)
780+ void processMixedEventMCCent (o2::aod::FdCollisions& cols,
781+ soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels>& parts,
782+ o2::aod::FdMCParticles&)
777783 {
778784 randgen = new TRandom2 (0 );
779785
780- for (auto & [collision1, collision2] : soa::selfCombinations (colBinning , ConfNEventsMix, -1 , cols, cols)) {
786+ for (const auto & [collision1, collision2] : soa::selfCombinations (colBinningCent , ConfNEventsMix, -1 , cols, cols)) {
781787
782788 const int multiplicityCol = collision1.multV0M ();
783- MixQaRegistry.fill (HIST (" MixingQA/hMECollisionBins" ), colBinning.getBin ({collision1.posZ (), multiplicityCol}));
789+ MixQaRegistry.fill (HIST (" MixingQA/hMECollisionBins" ), colBinningCent.getBin ({collision1.posZ (), multiplicityCol}));
790+
791+ const auto & magFieldTesla1 = collision1.magField ();
792+ const auto & magFieldTesla2 = collision2.magField ();
793+
794+ if (magFieldTesla1 != magFieldTesla2) {
795+ continue ;
796+ }
797+ // / \todo before mixing we should check whether both collisions contain a pair of particles!
798+ // if (partsOne.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTwo.size() == 0 ) continue;
799+
800+ if (cfgProcessPM) {
801+ auto groupPartsOne = partsOneMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex (), cache);
802+ auto groupPartsTwo = partsTwoMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex (), cache);
803+ doMixedEvent<false >(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 1 );
804+ }
805+ if (cfgProcessPP) {
806+ auto groupPartsOne = partsOneMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex (), cache);
807+ auto groupPartsTwo = partsOneMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex (), cache);
808+ doMixedEvent<false >(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 2 );
809+ }
810+ if (cfgProcessMM) {
811+ auto groupPartsOne = partsTwoMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex (), cache);
812+ auto groupPartsTwo = partsTwoMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex (), cache);
813+ doMixedEvent<false >(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 3 );
814+ }
815+ }
816+ delete randgen;
817+ }
818+ PROCESS_SWITCH (femtoUniversePairTaskTrackTrack3DMultKtExtended, processMixedEventMCCent, " Enable processing mixed events MC" , false );
819+
820+ // / process function for to call doMixedEvent with Data
821+ // / @param cols subscribe to the collisions table (Data)
822+ // / @param parts subscribe to the femtoUniverseParticleTable
823+ void processMixedEventNtr (FilteredFDCollisions& cols,
824+ FilteredFemtoFullParticles& parts)
825+ {
826+ randgen = new TRandom2 (0 );
827+
828+ for (const auto & [collision1, collision2] : soa::selfCombinations (colBinningNtr, ConfNEventsMix, -1 , cols, cols)) {
829+
830+ const int multiplicityCol = collision1.multNtr ();
831+ MixQaRegistry.fill (HIST (" MixingQA/hMECollisionBins" ), colBinningNtr.getBin ({collision1.posZ (), multiplicityCol}));
832+
833+ const auto & magFieldTesla1 = collision1.magField ();
834+ const auto & magFieldTesla2 = collision2.magField ();
835+
836+ if (magFieldTesla1 != magFieldTesla2) {
837+ continue ;
838+ }
839+
840+ if (cfgProcessPM) {
841+ auto groupPartsOne = partsOne->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex (), cache);
842+ auto groupPartsTwo = partsTwo->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex (), cache);
843+ doMixedEvent<false >(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 1 );
844+ }
845+ if (cfgProcessPP) {
846+ auto groupPartsOne = partsOne->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex (), cache);
847+ auto groupPartsTwo = partsOne->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex (), cache);
848+ doMixedEvent<false >(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 2 );
849+ }
850+ if (cfgProcessMM) {
851+ auto groupPartsOne = partsTwo->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex (), cache);
852+ auto groupPartsTwo = partsTwo->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex (), cache);
853+ doMixedEvent<false >(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol, 3 );
854+ }
855+ }
856+ delete randgen;
857+ }
858+ PROCESS_SWITCH (femtoUniversePairTaskTrackTrack3DMultKtExtended, processMixedEventNtr, " Enable processing mixed events" , false );
859+
860+ // / brief process function for to call doMixedEvent with Monte Carlo
861+ // / @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed)
862+ // / @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth
863+ // / @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table
864+ void processMixedEventMCNtr (o2::aod::FdCollisions& cols,
865+ soa::Join<FilteredFemtoFullParticles, aod::FDMCLabels>& parts,
866+ o2::aod::FdMCParticles&)
867+ {
868+ randgen = new TRandom2 (0 );
869+
870+ for (const auto & [collision1, collision2] : soa::selfCombinations (colBinningCent, ConfNEventsMix, -1 , cols, cols)) {
871+
872+ const int multiplicityCol = collision1.multNtr ();
873+ MixQaRegistry.fill (HIST (" MixingQA/hMECollisionBins" ), colBinningNtr.getBin ({collision1.posZ (), multiplicityCol}));
784874
785875 const auto & magFieldTesla1 = collision1.magField ();
786876 const auto & magFieldTesla2 = collision2.magField ();
@@ -809,7 +899,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
809899 }
810900 delete randgen;
811901 }
812- PROCESS_SWITCH (femtoUniversePairTaskTrackTrack3DMultKtExtended, processMixedEventMC , " Enable processing mixed events MC" , false );
902+ PROCESS_SWITCH (femtoUniversePairTaskTrackTrack3DMultKtExtended, processMixedEventMCNtr , " Enable processing mixed events MC" , false );
813903};
814904
815905WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments