@@ -469,207 +469,169 @@ struct HfDerivedDataCreatorCorrelationsReduced {
469469 }
470470
471471 // Dplus with ML selections
472- void processDplusSameEvent (CollsWithCentMult const & colls ,
472+ void processDplusSameEvent (CollsWithCentMult::iterator const & coll ,
473473 CandDplusData const & candsDplus,
474474 TracksData const & tracks)
475475 {
476- for (const auto & coll : colls) {
477- auto thisCollId = coll.globalIndex ();
478- auto candsCThisColl = candsDplus.sliceBy (candsDplusPerColl, thisCollId);
479- if (forceCharmInCollision && candsCThisColl.size () < 1 ) {
480- continue ;
481- }
482- float cent{-1 .}, mult{-1 .};
483- if (!checkCollision (coll, cent, mult)) {
484- continue ;
485- }
486- rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
487- int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
488- registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
489- registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
490- auto trackIdsThisColl = tracks.sliceBy (trackIndicesPerColl, thisCollId);
491- fillSameEvent<CandType::DplusToPiKPi>(candsCThisColl, trackIdsThisColl, poolBin, cent);
476+ if (forceCharmInCollision && candsDplus.size () < 1 ) {
477+ return ;
478+ }
479+ float cent{-1 .}, mult{-1 .};
480+ if (!checkCollision (coll, cent, mult)) {
481+ return ;
492482 }
483+ rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
484+ int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
485+ registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
486+ registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
487+ fillSameEvent<CandType::DplusToPiKPi>(candsDplus, tracks, poolBin, cent);
493488 }
494489 PROCESS_SWITCH (HfDerivedDataCreatorCorrelationsReduced, processDplusSameEvent, " Process Same Event for Dplus candidates" , true );
495490
496491 // Dplus with ML selections
497- void processDplusMixedEvent (CollsWithCentMult const & colls ,
492+ void processDplusMixedEvent (CollsWithCentMult::iterator const & coll ,
498493 CandDplusData const & candsDplus,
499494 TracksData const & tracks)
500495 {
501- for (const auto & coll : colls) {
502- auto thisCollId = coll.globalIndex ();
503- auto candsCThisColl = candsDplus.sliceBy (candsDplusPerColl, thisCollId);
504- if (forceCharmInCollision && candsCThisColl.size () < 1 ) {
505- continue ;
506- }
507- float cent{-1 .}, mult{-1 .};
508- if (!checkCollision (coll, cent, mult)) {
509- continue ;
510- }
511- rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
512- int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
513- registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
514- registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
515- auto trackIdsThisColl = tracks.sliceBy (trackIndicesPerColl, thisCollId);
516- fillCharmMixedEvent<CandType::DplusToPiKPi>(candsCThisColl, poolBin);
517- fillTrackMixedEvent (trackIdsThisColl, poolBin, cent);
496+ if (forceCharmInCollision && candsDplus.size () < 1 ) {
497+ return ;
518498 }
499+ float cent{-1 .}, mult{-1 .};
500+ if (!checkCollision (coll, cent, mult)) {
501+ return ;
502+ }
503+ rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
504+ int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
505+ registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
506+ registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
507+ fillCharmMixedEvent<CandType::DplusToPiKPi>(candsDplus, poolBin);
508+ fillTrackMixedEvent (tracks, poolBin, cent);
519509 }
520510 PROCESS_SWITCH (HfDerivedDataCreatorCorrelationsReduced, processDplusMixedEvent, " Process Mixed Event for Dplus candidates" , false );
521511
522512 // Ds with ML selections
523- void processDsSameEvent (CollsWithCentMult const & colls ,
524- CandDsData const & candsDs ,
525- TracksData const & tracks )
513+ void processDsSameEvent (CollsWithCentMult::iterator const & coll ,
514+ TracksData const & tracks ,
515+ CandDsData const &)
526516 {
527- for (const auto & coll : colls) {
528- auto thisCollId = coll.globalIndex ();
529- auto candsCThisColl = candsDs.sliceBy (candsDsPerColl, thisCollId);
530- if (forceCharmInCollision && candsCThisColl.size () < 1 ) {
531- continue ;
532- }
533- float cent{-1 .}, mult{-1 .};
534- if (!checkCollision (coll, cent, mult)) {
535- continue ;
536- }
537- rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
538- int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
539- registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
540- registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
541- auto trackIdsThisColl = tracks.sliceBy (trackIndicesPerColl, thisCollId);
542- auto candsDsToPiKK = selectedDsToPiKK->sliceByCached (aod::hf_cand::collisionId, thisCollId, cache);
543- auto candsDsToKKPi = selectedDsToKKPi->sliceByCached (aod::hf_cand::collisionId, thisCollId, cache);
544- fillSameEvent<CandType::DsToPiKK>(candsDsToPiKK, trackIdsThisColl, poolBin, cent);
545- fillSameEvent<CandType::DsToKKPi>(candsDsToKKPi, trackIdsThisColl, poolBin, cent);
517+ auto candsDsToPiKK = selectedDsToPiKK->sliceByCached (aod::hf_cand::collisionId, coll.globalIndex (), cache);
518+ auto candsDsToKKPi = selectedDsToKKPi->sliceByCached (aod::hf_cand::collisionId, coll.globalIndex (), cache);
519+ if (forceCharmInCollision && candsDsToPiKK.size () < 1 && candsDsToKKPi.size () < 1 ) {
520+ return ;
546521 }
522+ float cent{-1 .}, mult{-1 .};
523+ if (!checkCollision (coll, cent, mult)) {
524+ return ;
525+ }
526+ rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
527+ int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
528+ registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
529+ registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
530+ fillSameEvent<CandType::DsToPiKK>(candsDsToPiKK, tracks, poolBin, cent);
531+ fillSameEvent<CandType::DsToKKPi>(candsDsToKKPi, tracks, poolBin, cent);
547532 }
548533 PROCESS_SWITCH (HfDerivedDataCreatorCorrelationsReduced, processDsSameEvent, " Process Same Event for Ds candidates" , false );
549534
550535 // Ds with ML selections
551- void processDsMixedEvent (CollsWithCentMult const & colls ,
552- CandDsData const & candsDs ,
553- TracksData const & tracks )
536+ void processDsMixedEvent (CollsWithCentMult::iterator const & coll ,
537+ TracksData const & tracks ,
538+ CandDsData const &)
554539 {
555- for (const auto & coll : colls) {
556- auto thisCollId = coll.globalIndex ();
557- auto candsCThisColl = candsDs.sliceBy (candsDsPerColl, thisCollId);
558- if (forceCharmInCollision && candsCThisColl.size () < 1 ) {
559- continue ;
560- }
561- float cent{-1 .}, mult{-1 .};
562- if (!checkCollision (coll, cent, mult)) {
563- continue ;
564- }
565- rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
566- int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
567- registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
568- registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
569- auto trackIdsThisColl = tracks.sliceBy (trackIndicesPerColl, thisCollId);
570- auto candsDsToPiKK = selectedDsToPiKK->sliceByCached (aod::hf_cand::collisionId, thisCollId, cache);
571- auto candsDsToKKPi = selectedDsToKKPi->sliceByCached (aod::hf_cand::collisionId, thisCollId, cache);
572- fillCharmMixedEvent<CandType::DsToPiKK>(candsDsToPiKK, poolBin);
573- fillCharmMixedEvent<CandType::DsToKKPi>(candsDsToKKPi, poolBin);
574- fillTrackMixedEvent (trackIdsThisColl, poolBin, cent);
540+ auto candsDsToPiKK = selectedDsToPiKK->sliceByCached (aod::hf_cand::collisionId, coll.globalIndex (), cache);
541+ auto candsDsToKKPi = selectedDsToKKPi->sliceByCached (aod::hf_cand::collisionId, coll.globalIndex (), cache);
542+ if (forceCharmInCollision && candsDsToPiKK.size () < 1 && candsDsToKKPi.size () < 1 ) {
543+ return ;
544+ }
545+ float cent{-1 .}, mult{-1 .};
546+ if (!checkCollision (coll, cent, mult)) {
547+ return ;
575548 }
549+ rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
550+ int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
551+ registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
552+ registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
553+ fillCharmMixedEvent<CandType::DsToPiKK>(candsDsToPiKK, poolBin);
554+ fillCharmMixedEvent<CandType::DsToKKPi>(candsDsToKKPi, poolBin);
555+ fillTrackMixedEvent (tracks, poolBin, cent);
576556 }
577557 PROCESS_SWITCH (HfDerivedDataCreatorCorrelationsReduced, processDsMixedEvent, " Process Mixed Event for Ds candidates" , false );
578558
579559 // D0 with ML selections
580- void processD0SameEvent (CollsWithCentMult const & colls ,
581- CandD0Data const & candsD0 ,
582- TracksData const & tracks )
560+ void processD0SameEvent (CollsWithCentMult::iterator const & coll ,
561+ TracksData const & tracks ,
562+ CandD0Data const &)
583563 {
584- for (const auto & coll : colls) {
585- auto thisCollId = coll.globalIndex ();
586- auto candsCThisColl = candsD0.sliceBy (candsD0PerColl, thisCollId);
587- if (forceCharmInCollision && candsCThisColl.size () < 1 ) {
588- continue ;
589- }
590- float cent{-1 .}, mult{-1 .};
591- if (!checkCollision (coll, cent, mult)) {
592- continue ;
593- }
594- rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
595- int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
596- registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
597- registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
598- auto trackIdsThisColl = tracks.sliceBy (trackIndicesPerColl, thisCollId);
599- auto candsD0ToPiK = selectedD0ToPiK->sliceByCached (aod::hf_cand::collisionId, thisCollId, cache);
600- auto candsD0ToKPi = selectedD0ToKPi->sliceByCached (aod::hf_cand::collisionId, thisCollId, cache);
601- fillSameEvent<CandType::D0ToPiK>(candsD0ToPiK, trackIdsThisColl, poolBin, cent);
602- fillSameEvent<CandType::D0ToKPi>(candsD0ToKPi, trackIdsThisColl, poolBin, cent);
564+ auto candsD0ToPiK = selectedD0ToPiK->sliceByCached (aod::hf_cand::collisionId, coll.globalIndex (), cache);
565+ auto candsD0ToKPi = selectedD0ToKPi->sliceByCached (aod::hf_cand::collisionId, coll.globalIndex (), cache);
566+ if (forceCharmInCollision && candsD0ToPiK.size () < 1 && candsD0ToKPi.size () < 1 ) {
567+ return ;
568+ }
569+ float cent{-1 .}, mult{-1 .};
570+ if (!checkCollision (coll, cent, mult)) {
571+ return ;
603572 }
573+ rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
574+ int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
575+ registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
576+ registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
577+ fillSameEvent<CandType::D0ToPiK>(candsD0ToPiK, tracks, poolBin, cent);
578+ fillSameEvent<CandType::D0ToKPi>(candsD0ToKPi, tracks, poolBin, cent);
604579 }
605580 PROCESS_SWITCH (HfDerivedDataCreatorCorrelationsReduced, processD0SameEvent, " Process Same Event for D0 candidates" , false );
606581
607582 // D0 with ML selections
608- void processD0MixedEvent (CollsWithCentMult const & colls ,
609- CandD0Data const & candsD0 ,
610- TracksData const & tracks )
583+ void processD0MixedEvent (CollsWithCentMult::iterator const & coll ,
584+ TracksData const & tracks ,
585+ CandD0Data const &)
611586 {
612- for (const auto & coll : colls) {
613- auto thisCollId = coll.globalIndex ();
614- auto candsCThisColl = candsD0.sliceBy (candsD0PerColl, thisCollId);
615- if (forceCharmInCollision && candsCThisColl.size () < 1 ) {
616- continue ;
617- }
618- float cent{-1 .}, mult{-1 .};
619- if (!checkCollision (coll, cent, mult)) {
620- continue ;
621- }
622- rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
623- int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
624- registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
625- registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
626- auto trackIdsThisColl = tracks.sliceBy (trackIndicesPerColl, thisCollId);
627- auto candsD0ToPiK = selectedD0ToPiK->sliceByCached (aod::hf_cand::collisionId, thisCollId, cache);
628- auto candsD0ToKPi = selectedD0ToKPi->sliceByCached (aod::hf_cand::collisionId, thisCollId, cache);
629- fillCharmMixedEvent<CandType::D0ToPiK>(candsD0ToPiK, poolBin);
630- fillCharmMixedEvent<CandType::D0ToKPi>(candsD0ToKPi, poolBin);
631- fillTrackMixedEvent (trackIdsThisColl, poolBin, cent);
587+ auto candsD0ToPiK = selectedD0ToPiK->sliceByCached (aod::hf_cand::collisionId, coll.globalIndex (), cache);
588+ auto candsD0ToKPi = selectedD0ToKPi->sliceByCached (aod::hf_cand::collisionId, coll.globalIndex (), cache);
589+ if (forceCharmInCollision && candsD0ToPiK.size () < 1 && candsD0ToKPi.size () < 1 ) {
590+ return ;
591+ }
592+ float cent{-1 .}, mult{-1 .};
593+ if (!checkCollision (coll, cent, mult)) {
594+ return ;
632595 }
596+ rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
597+ int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
598+ registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
599+ registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
600+ fillCharmMixedEvent<CandType::D0ToPiK>(candsD0ToPiK, poolBin);
601+ fillCharmMixedEvent<CandType::D0ToKPi>(candsD0ToKPi, poolBin);
602+ fillTrackMixedEvent (tracks, poolBin, cent);
633603 }
634604 PROCESS_SWITCH (HfDerivedDataCreatorCorrelationsReduced, processD0MixedEvent, " Process Mixed Event for D0 candidates" , false );
635605
636606 // Hadron Hadron Same Event
637- void processHadronHadronSameEvent (CollsWithCentMult const & colls ,
607+ void processHadronHadronSameEvent (CollsWithCentMult::iterator const & coll ,
638608 TracksData const & tracks)
639609 {
640- for (const auto & coll : colls) {
641- auto thisCollId = coll.globalIndex ();
642- float cent{-1 .}, mult{-1 .};
643- if (!checkCollision (coll, cent, mult)) {
644- continue ;
645- }
646- rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
647- int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
648- registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
649- registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
650- auto trackIdsThisColl = tracks.sliceBy (trackIndicesPerColl, thisCollId);
651- fillSameEvent<CandType::Hadron>(trackIdsThisColl, trackIdsThisColl, poolBin, cent);
610+ float cent{-1 .}, mult{-1 .};
611+ if (!checkCollision (coll, cent, mult)) {
612+ return ;
652613 }
614+ rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
615+ int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
616+ registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
617+ registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
618+ fillSameEvent<CandType::Hadron>(tracks, tracks, poolBin, cent);
653619 }
654620 PROCESS_SWITCH (HfDerivedDataCreatorCorrelationsReduced, processHadronHadronSameEvent, " Process Same Event for hadron candidates" , true );
655621
656622 // Hadron Hadron Mixed Event
657- void processHadronHadronMixedEvent (CollsWithCentMult const & colls ,
623+ void processHadronHadronMixedEvent (CollsWithCentMult::iterator const & coll ,
658624 TracksData const & tracks)
659625 {
660- for (const auto & coll : colls) {
661- auto thisCollId = coll.globalIndex ();
662- float cent{-1 .}, mult{-1 .};
663- if (!checkCollision (coll, cent, mult)) {
664- continue ;
665- }
666- rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
667- int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
668- registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
669- registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
670- auto trackIdsThisColl = tracks.sliceBy (trackIndicesPerColl, thisCollId);
671- fillTrackMixedEvent (trackIdsThisColl, poolBin, cent);
626+ float cent{-1 .}, mult{-1 .};
627+ if (!checkCollision (coll, cent, mult)) {
628+ return ;
672629 }
630+ rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
631+ int poolBin = useCentMixing ? getPoolBin<PoolBinningPolicy::Centrality, true >(coll, cent, mult) : getPoolBin<PoolBinningPolicy::Multiplicity, true >(coll, cent, mult);
632+ registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
633+ registry.fill (HIST (" hZVtx" ), coll.posZ (), poolBin);
634+ fillTrackMixedEvent (tracks, poolBin, cent);
673635 }
674636 PROCESS_SWITCH (HfDerivedDataCreatorCorrelationsReduced, processHadronHadronMixedEvent, " Process Mixed Event for hadron candidates" , false );
675637};
0 commit comments