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"
3332
3433#include < CCDB/BasicCCDBManager.h>
3534#include < CommonConstants/MathConstants.h>
36- #include < CommonConstants/PhysicsConstants.h>
3735#include < Framework/ASoA.h>
3836#include < Framework/AnalysisDataModel.h>
3937#include < Framework/AnalysisHelpers.h>
@@ -157,7 +155,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
157155 void init (InitContext&)
158156 {
159157
160- hfEvSel.addHistograms (registry); // collision monitoring
158+ hfEvSel.init (registry);
159+
161160 ccdb->setURL (ccdbUrl);
162161 ccdb->setCaching (true );
163162 ccdb->setLocalObjectValidityChecking ();
@@ -176,7 +175,7 @@ struct HfDerivedDataCreatorCorrelationsReduced {
176175 return ;
177176 }
178177
179- hfcFlowHelper.init (ccdb, registry, classesMl, yCandMax.value );
178+ hfcFlowHelper.init (classesMl, yCandMax.value );
180179
181180 const AxisSpec axisTpcSignal = {binsTpcSignal, " TPC Signal" };
182181 const AxisSpec axisCent = {binsCent, " Centrality" };
@@ -209,32 +208,6 @@ struct HfDerivedDataCreatorCorrelationsReduced {
209208 }
210209 }; // end init
211210
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-
238211 // / Checks if the trigger cand-associated track pair can be accepted for SE correlation
239212 // / \param assTrk is the associated track
240213 // / \param cand is the trigger candidate
@@ -404,7 +377,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
404377 return ;
405378 }
406379 float cent{-1 .}, mult{-1 .};
407- if (!checkCollision (coll, cent, mult)) {
380+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
381+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
408382 return ;
409383 }
410384 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -421,7 +395,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
421395 return ;
422396 }
423397 float cent{-1 .}, mult{-1 .};
424- if (!checkCollision (coll, cent, mult)) {
398+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
399+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
425400 return ;
426401 }
427402 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -441,7 +416,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
441416 return ;
442417 }
443418 float cent{-1 .}, mult{-1 .};
444- if (!checkCollision (coll, cent, mult)) {
419+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
420+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
445421 return ;
446422 }
447423 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -461,7 +437,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
461437 return ;
462438 }
463439 float cent{-1 .}, mult{-1 .};
464- if (!checkCollision (coll, cent, mult)) {
440+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
441+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
465442 return ;
466443 }
467444 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -482,7 +459,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
482459 return ;
483460 }
484461 float cent{-1 .}, mult{-1 .};
485- if (!checkCollision (coll, cent, mult)) {
462+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
463+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
486464 return ;
487465 }
488466 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -502,7 +480,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
502480 return ;
503481 }
504482 float cent{-1 .}, mult{-1 .};
505- if (!checkCollision (coll, cent, mult)) {
483+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
484+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
506485 return ;
507486 }
508487 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -523,7 +502,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
523502 return ;
524503 }
525504 float cent{-1 .}, mult{-1 .};
526- if (!checkCollision (coll, cent, mult)) {
505+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
506+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
527507 return ;
528508 }
529509 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -543,7 +523,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
543523 return ;
544524 }
545525 float cent{-1 .}, mult{-1 .};
546- if (!checkCollision (coll, cent, mult)) {
526+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
527+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
547528 return ;
548529 }
549530 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -564,7 +545,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
564545 return ;
565546 }
566547 float cent{-1 .}, mult{-1 .};
567- if (!checkCollision (coll, cent, mult)) {
548+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
549+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
568550 return ;
569551 }
570552 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -582,7 +564,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
582564 return ;
583565 }
584566 float cent{-1 .}, mult{-1 .};
585- if (!checkCollision (coll, cent, mult)) {
567+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
568+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
586569 return ;
587570 }
588571 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -602,7 +585,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
602585 return ;
603586 }
604587 float cent{-1 .}, mult{-1 .};
605- if (!checkCollision (coll, cent, mult)) {
588+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
589+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
606590 return ;
607591 }
608592 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -622,7 +606,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
622606 return ;
623607 }
624608 float cent{-1 .}, mult{-1 .};
625- if (!checkCollision (coll, cent, mult)) {
609+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
610+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
626611 return ;
627612 }
628613 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -643,7 +628,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
643628 return ;
644629 }
645630 float cent{-1 .}, mult{-1 .};
646- if (!checkCollision (coll, cent, mult)) {
631+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
632+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
647633 return ;
648634 }
649635 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -663,7 +649,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
663649 return ;
664650 }
665651 float cent{-1 .}, mult{-1 .};
666- if (!checkCollision (coll, cent, mult)) {
652+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
653+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
667654 return ;
668655 }
669656 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -684,7 +671,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
684671 return ;
685672 }
686673 float cent{-1 .}, mult{-1 .};
687- if (!checkCollision (coll, cent, mult)) {
674+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
675+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
688676 return ;
689677 }
690678 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -704,7 +692,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
704692 return ;
705693 }
706694 float cent{-1 .}, mult{-1 .};
707- if (!checkCollision (coll, cent, mult)) {
695+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
696+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
708697 return ;
709698 }
710699 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -720,7 +709,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
720709 TracksData const & tracks)
721710 {
722711 float cent{-1 .}, mult{-1 .};
723- if (!checkCollision (coll, cent, mult)) {
712+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
713+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
724714 return ;
725715 }
726716 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -733,7 +723,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
733723 TracksData const & tracks)
734724 {
735725 float cent{-1 .}, mult{-1 .};
736- if (!checkCollision (coll, cent, mult)) {
726+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
727+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
737728 return ;
738729 }
739730 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -747,7 +738,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
747738 TracksMc const & tracks)
748739 {
749740 float cent{-1 .}, mult{-1 .};
750- if (!checkCollision (coll, cent, mult)) {
741+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
742+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
751743 return ;
752744 }
753745 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -760,7 +752,8 @@ struct HfDerivedDataCreatorCorrelationsReduced {
760752 TracksMc const & tracks)
761753 {
762754 float cent{-1 .}, mult{-1 .};
763- if (!checkCollision (coll, cent, mult)) {
755+ auto centDetector = static_cast <CentralityEstimator>(centEstimator.value );
756+ if (!hfcFlowHelper.selectRecoCollision (hfEvSel, ccdb, registry, coll, centDetector, cent, mult)) {
764757 return ;
765758 }
766759 rowCollisions (mult, coll.numContrib (), cent, coll.posZ ());
@@ -769,7 +762,7 @@ struct HfDerivedDataCreatorCorrelationsReduced {
769762 PROCESS_SWITCH (HfDerivedDataCreatorCorrelationsReduced, processMcHadronHadronME, " Process Mixed Event for hadron candidates" , false );
770763};
771764
772- WorkflowSpec defineDataProcessing (ConfigContext const & cfgc )
765+ WorkflowSpec defineDataProcessing (ConfigContext const & context )
773766{
774- return WorkflowSpec{adaptAnalysisTask<HfDerivedDataCreatorCorrelationsReduced>(cfgc )};
767+ return WorkflowSpec{adaptAnalysisTask<HfDerivedDataCreatorCorrelationsReduced>(context )};
775768}
0 commit comments