1717
1818#include " PWGHF/Core/CentralityEstimation.h"
1919#include " PWGHF/Core/DecayChannels.h"
20- #include " PWGHF/Core/HfHelper.h"
2120#include " PWGHF/DataModel/AliasTables.h"
2221#include " PWGHF/DataModel/CandidateReconstructionTables.h"
2322#include " PWGHF/DataModel/CandidateSelectionTables.h"
@@ -157,7 +156,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
157156 void init (InitContext&)
158157 {
159158
160- hfEvSel.addHistograms (registry); // collision monitoring
159+ hfEvSel.init (registry);
160+
161161 ccdb->setURL (ccdbUrl);
162162 ccdb->setCaching (true );
163163 ccdb->setLocalObjectValidityChecking ();
@@ -176,7 +176,7 @@ struct HfDerivedDataCreatorCorrelationsReduced {
176176 return ;
177177 }
178178
179- hfcFlowHelper.init (ccdb, registry, classesMl, yCandMax.value );
179+ hfcFlowHelper.init (classesMl, yCandMax.value );
180180
181181 const AxisSpec axisTpcSignal = {binsTpcSignal, " TPC Signal" };
182182 const AxisSpec axisCent = {binsCent, " Centrality" };
@@ -209,32 +209,6 @@ struct HfDerivedDataCreatorCorrelationsReduced {
209209 }
210210 }; // end init
211211
212- // / Check event selections for collision and fill the collision table
213- // / \param collision is the collision
214- template <typename Coll>
215- bool checkCollision (Coll const & collision, float & cent, float & mult)
216- {
217- o2::hf_evsel::HfCollisionRejectionMask collRejMask{};
218- if (centEstimator == CentralityEstimator::FT0A ) {
219- collRejMask = hfEvSel.getHfCollisionRejectionMask <true , CentralityEstimator::FT0A , aod::BCsWithTimestamps>(collision, cent, ccdb, registry);
220- mult = collision.multFT0A ();
221- } else if (centEstimator == CentralityEstimator::FT0C ) {
222- collRejMask = hfEvSel.getHfCollisionRejectionMask <true , CentralityEstimator::FT0C , aod::BCsWithTimestamps>(collision, cent, ccdb, registry);
223- mult = collision.multFT0C ();
224- } else if (centEstimator == CentralityEstimator::FT0M ) {
225- collRejMask = hfEvSel.getHfCollisionRejectionMask <true , CentralityEstimator::FT0M , aod::BCsWithTimestamps>(collision, cent, ccdb, registry);
226- mult = collision.multFT0M ();
227- } else if (centEstimator == CentralityEstimator::FV0A ) {
228- collRejMask = hfEvSel.getHfCollisionRejectionMask <true , CentralityEstimator::FV0A , aod::BCsWithTimestamps>(collision, cent, ccdb, registry);
229- mult = collision.multFV0A ();
230- } else {
231- LOG (fatal) << " Centrality estimator not recognized for collision selection" ;
232- std::abort ();
233- }
234- hfEvSel.fillHistograms (collision, collRejMask, cent);
235- return collRejMask == 0 ;
236- }
237-
238212 // / Checks if the trigger cand-associated track pair can be accepted for SE correlation
239213 // / \param assTrk is the associated track
240214 // / \param cand is the trigger candidate
@@ -404,7 +378,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
404378 return ;
405379 }
406380 float cent{-1 .}, mult{-1 .};
407- if (!checkCollision (coll, cent, mult)) {
381+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
382+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
408383 return ;
409384 }
410385 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -421,7 +396,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
421396 return ;
422397 }
423398 float cent{-1 .}, mult{-1 .};
424- if (!checkCollision (coll, cent, mult)) {
399+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
400+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
425401 return ;
426402 }
427403 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -441,7 +417,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
441417 return ;
442418 }
443419 float cent{-1 .}, mult{-1 .};
444- if (!checkCollision (coll, cent, mult)) {
420+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
421+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
445422 return ;
446423 }
447424 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -461,7 +438,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
461438 return ;
462439 }
463440 float cent{-1 .}, mult{-1 .};
464- if (!checkCollision (coll, cent, mult)) {
441+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
442+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
465443 return ;
466444 }
467445 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -482,7 +460,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
482460 return ;
483461 }
484462 float cent{-1 .}, mult{-1 .};
485- if (!checkCollision (coll, cent, mult)) {
463+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
464+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
486465 return ;
487466 }
488467 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -502,7 +481,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
502481 return ;
503482 }
504483 float cent{-1 .}, mult{-1 .};
505- if (!checkCollision (coll, cent, mult)) {
484+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
485+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
506486 return ;
507487 }
508488 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -523,7 +503,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
523503 return ;
524504 }
525505 float cent{-1 .}, mult{-1 .};
526- if (!checkCollision (coll, cent, mult)) {
506+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
507+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
527508 return ;
528509 }
529510 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -543,7 +524,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
543524 return ;
544525 }
545526 float cent{-1 .}, mult{-1 .};
546- if (!checkCollision (coll, cent, mult)) {
527+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
528+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
547529 return ;
548530 }
549531 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -564,7 +546,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
564546 return ;
565547 }
566548 float cent{-1 .}, mult{-1 .};
567- if (!checkCollision (coll, cent, mult)) {
549+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
550+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
568551 return ;
569552 }
570553 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -582,7 +565,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
582565 return ;
583566 }
584567 float cent{-1 .}, mult{-1 .};
585- if (!checkCollision (coll, cent, mult)) {
568+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
569+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
586570 return ;
587571 }
588572 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -602,7 +586,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
602586 return ;
603587 }
604588 float cent{-1 .}, mult{-1 .};
605- if (!checkCollision (coll, cent, mult)) {
589+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
590+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
606591 return ;
607592 }
608593 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -622,7 +607,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
622607 return ;
623608 }
624609 float cent{-1 .}, mult{-1 .};
625- if (!checkCollision (coll, cent, mult)) {
610+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
611+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
626612 return ;
627613 }
628614 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -643,7 +629,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
643629 return ;
644630 }
645631 float cent{-1 .}, mult{-1 .};
646- if (!checkCollision (coll, cent, mult)) {
632+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
633+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
647634 return ;
648635 }
649636 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -663,7 +650,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
663650 return ;
664651 }
665652 float cent{-1 .}, mult{-1 .};
666- if (!checkCollision (coll, cent, mult)) {
653+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
654+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
667655 return ;
668656 }
669657 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -684,7 +672,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
684672 return ;
685673 }
686674 float cent{-1 .}, mult{-1 .};
687- if (!checkCollision (coll, cent, mult)) {
675+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
676+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
688677 return ;
689678 }
690679 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -704,7 +693,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
704693 return ;
705694 }
706695 float cent{-1 .}, mult{-1 .};
707- if (!checkCollision (coll, cent, mult)) {
696+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
697+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
708698 return ;
709699 }
710700 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -720,7 +710,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
720710 TracksData const & tracks)
721711 {
722712 float cent{-1 .}, mult{-1 .};
723- if (!checkCollision (coll, cent, mult)) {
713+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
714+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
724715 return ;
725716 }
726717 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -733,7 +724,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
733724 TracksData const & tracks)
734725 {
735726 float cent{-1 .}, mult{-1 .};
736- if (!checkCollision (coll, cent, mult)) {
727+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
728+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
737729 return ;
738730 }
739731 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -747,7 +739,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
747739 TracksMc const & tracks)
748740 {
749741 float cent{-1 .}, mult{-1 .};
750- if (!checkCollision (coll, cent, mult)) {
742+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
743+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
751744 return ;
752745 }
753746 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -760,7 +753,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
760753 TracksMc const & tracks)
761754 {
762755 float cent{-1 .}, mult{-1 .};
763- if (!checkCollision (coll, cent, mult)) {
756+ CentralityEstimator centDetector = static_cast <CentralityEstimator>(centEstimator.value );
757+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
764758 return ;
765759 }
766760 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
0 commit comments