@@ -178,7 +178,7 @@ struct femtoUniversePairTaskTrackV0Extended {
178178 pairCloseRejection.init (&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value , ConfCPRdeltaEtaMax.value , ConfCPRdeltaPhiCut.value , ConfCPRdeltaEtaCut.value , ConfCPRPlotPerRadii.value );
179179 }
180180 }
181- // / This function processes the same event and takes care of all the histogramming
181+ // / This function processes the same event for track - V0
182182 void processSameEvent (o2::aod::FDCollision& col, FemtoFullParticles& parts)
183183 {
184184 const auto & magFieldTesla = col.magField ();
@@ -242,9 +242,53 @@ struct femtoUniversePairTaskTrackV0Extended {
242242 }
243243 }
244244
245- PROCESS_SWITCH (femtoUniversePairTaskTrackV0Extended, processSameEvent, " Enable processing same event" , true );
245+ PROCESS_SWITCH (femtoUniversePairTaskTrackV0Extended, processSameEvent, " Enable processing same event for track - V0 " , false );
246246
247- // / This function processes the mixed event
247+ // / This function processes the same event for V0 - V0
248+ void processSameEventV0 (o2::aod::FDCollision& col, FemtoFullParticles& parts)
249+ {
250+ const auto & magFieldTesla = col.magField ();
251+
252+ auto groupPartsTwo = partsTwo->sliceByCached (aod::femtouniverseparticle::fdCollisionId, col.globalIndex (), cache);
253+ const int multCol = col.multNtr ();
254+
255+ eventHisto.fillQA (col);
256+
257+ // / Histogramming same event
258+ for (auto & part : groupPartsTwo) {
259+ const auto & posChild = parts.iteratorAt (part.index () - 2 );
260+ const auto & negChild = parts.iteratorAt (part.index () - 1 );
261+ // printf("-- V0 d- %d d+ %d\n",negChild.globalIndex(),posChild.globalIndex());
262+ if ((ConfV0Type > 0 && !IsParticleTPC (posChild, 0 )) || (ConfV0Type < 0 && !IsParticleTPC (negChild, 0 )))
263+ continue ;
264+
265+ trackHistoPartTwo.fillQA <false , false >(part);
266+ posChildHistos.fillQA <false , false >(posChild);
267+ negChildHistos.fillQA <false , false >(negChild);
268+ }
269+
270+ // / Now build the combinations
271+ for (auto & [p1, p2] : combinations (CombinationsFullIndexPolicy (groupPartsTwo, groupPartsTwo))) {
272+ if (ConfIsCPR.value ) {
273+ if (pairCloseRejection.isClosePair (p1, p2, parts, magFieldTesla)) {
274+ continue ;
275+ }
276+ }
277+ // track cleaning
278+ if (!pairCleaner.isCleanPair (p1, p2, parts)) {
279+ continue ;
280+ }
281+ const auto & posChild = parts.iteratorAt (p2.index () - 2 );
282+ const auto & negChild = parts.iteratorAt (p2.index () - 1 );
283+ if ((ConfV0Type > 0 && !IsParticleTPC (posChild, 0 )) || (ConfV0Type < 0 && !IsParticleTPC (negChild, 0 )))
284+ continue ;
285+ sameEventCont.setPair <false >(p1, p2, multCol, ConfUse3D);
286+ }
287+ }
288+
289+ PROCESS_SWITCH (femtoUniversePairTaskTrackV0Extended, processSameEventV0, " Enable processing same event for V0 - V0" , false );
290+
291+ // / This function processes the mixed event for track - V0
248292 void processMixedEvent (o2::aod::FDCollisions& cols, FemtoFullParticles& parts)
249293 {
250294 ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultNtr> colBinning{{ConfVtxBins, ConfMultBins}, true };
@@ -285,7 +329,47 @@ struct femtoUniversePairTaskTrackV0Extended {
285329 }
286330 }
287331
288- PROCESS_SWITCH (femtoUniversePairTaskTrackV0Extended, processMixedEvent, " Enable processing mixed events" , true );
332+ PROCESS_SWITCH (femtoUniversePairTaskTrackV0Extended, processMixedEvent, " Enable processing mixed events for track - V0" , false );
333+
334+ // / This function processes the mixed event for V0 - V0
335+ void processMixedEventV0 (o2::aod::FDCollisions& cols, FemtoFullParticles& parts)
336+ {
337+ ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultNtr> colBinning{{ConfVtxBins, ConfMultBins}, true };
338+
339+ for (auto & [collision1, collision2] : soa::selfCombinations (colBinning, 5 , -1 , cols, cols)) {
340+
341+ const int multCol = collision1.multNtr ();
342+
343+ auto groupPartsOne = partsOne->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex (), cache);
344+ auto groupPartsTwo = partsTwo->sliceByCached (aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex (), cache);
345+
346+ const auto & magFieldTesla1 = collision1.magField ();
347+ const auto & magFieldTesla2 = collision2.magField ();
348+
349+ if (magFieldTesla1 != magFieldTesla2) {
350+ continue ;
351+ }
352+
353+ for (auto & [p1, p2] : combinations (CombinationsFullIndexPolicy (groupPartsTwo, groupPartsTwo))) {
354+ if (ConfIsCPR.value ) {
355+ if (pairCloseRejection.isClosePair (p1, p2, parts, magFieldTesla1)) {
356+ continue ;
357+ }
358+ }
359+ // track cleaning
360+ if (!pairCleaner.isCleanPair (p1, p2, parts)) {
361+ continue ;
362+ }
363+ const auto & posChild = parts.iteratorAt (p2.index () - 2 );
364+ const auto & negChild = parts.iteratorAt (p2.index () - 1 );
365+ if ((ConfV0Type > 0 && !IsParticleTPC (posChild, 0 )) || (ConfV0Type < 0 && !IsParticleTPC (negChild, 0 )))
366+ continue ;
367+ mixedEventCont.setPair <false >(p1, p2, multCol, ConfUse3D);
368+ }
369+ }
370+ }
371+
372+ PROCESS_SWITCH (femtoUniversePairTaskTrackV0Extended, processMixedEventV0, " Enable processing mixed events for V0 - V0" , false );
289373};
290374
291375WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments