99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111
12- // / \file twoPartCorrelationsMPI .cxx
12+ // / \file twoParticleCorrelationsMpi .cxx
1313// / \brief task for the MPI-proxy classification of correlation calculations with CF-filtered tracks for O2 analysis
1414// / \author Emil Gorm Dahlbæk Nielsen <emil.gorm.nielsen@cern.ch>
1515
@@ -75,7 +75,7 @@ using namespace constants::math;
7575
7676static constexpr float kCfgPairCutDefaults [1 ][5 ] = {{-1 , -1 , -1 , -1 , -1 }};
7777
78- struct twoPartCorrelationsMpi {
78+ struct twoParticleCorrelationsMpi {
7979 SliceCache cache;
8080
8181 // Configuration
@@ -122,7 +122,7 @@ struct twoPartCorrelationsMpi {
122122 ConfigurableAxis axisPtTrigger{" axisPtTrigger" , {VARIABLE_WIDTH , 0.5 , 1.0 , 1.5 , 2.0 , 3.0 , 4.0 , 6.0 , 10.0 }, " pt trigger axis for histograms" };
123123 ConfigurableAxis axisPtAssoc{" axisPtAssoc" , {VARIABLE_WIDTH , 0.5 , 1.0 , 1.5 , 2.0 , 3.0 , 4.0 , 6.0 }, " pt associated axis for histograms" };
124124 ConfigurableAxis axisMultiplicity{" axisMultiplicity" , {VARIABLE_WIDTH , 0 , 5 , 10 , 20 , 30 , 40 , 50 , 100.1 }, " multiplicity / centrality axis for histograms" };
125- ConfigurableAxis axisUncSeeds{" axisUncSeedsQuantiles " , {VARIABLE_WIDTH , 0 , 0.2 , 0.4 , 0.6 , 0.8 , 1 }, " uncorrelated seeds axes in quantiles" };
125+ ConfigurableAxis axisUncSeeds{" axisUncSeeds " , {VARIABLE_WIDTH , 0 , 0.2 , 0.4 , 0.6 , 0.8 , 1 }, " uncorrelated seeds axes in quantiles" };
126126
127127 ConfigurableAxis axisVertexEfficiency{" axisVertexEfficiency" , {10 , -10 , 10 }, " vertex axis for efficiency histograms" };
128128 ConfigurableAxis axisEtaEfficiency{" axisEtaEfficiency" , {20 , -1.0 , 1.0 }, " eta axis for efficiency histograms" };
@@ -174,6 +174,16 @@ struct twoPartCorrelationsMpi {
174174
175175 EventClassifier ec;
176176
177+ enum CorrelationMethod {
178+ All = 0 ,
179+ Dd,
180+ Ddbar
181+ };
182+ enum EventClassEstimatorMethod {
183+ BinLookup = 0 ,
184+ Interpolation
185+ };
186+
177187 HistogramRegistry registry{" registry" };
178188 PairCuts mPairCuts ;
179189
@@ -582,9 +592,9 @@ struct twoPartCorrelationsMpi {
582592 }
583593
584594 if constexpr (std::experimental::is_detected<HasDecay, typename TTracks1::iterator>::value && std::experimental::is_detected<HasDecay, typename TTracks2::iterator>::value) {
585- if (cfgCorrelationMethod == 1 && track1.decay () != track2.decay ())
595+ if (cfgCorrelationMethod == CorrelationMethod::Dd && track1.decay () != track2.decay ())
586596 continue ;
587- if (cfgCorrelationMethod == 2 && track1.decay () == track2.decay ())
597+ if (cfgCorrelationMethod == CorrelationMethod::Ddbar && track1.decay () == track2.decay ())
588598 continue ;
589599 }
590600
@@ -660,7 +670,7 @@ struct twoPartCorrelationsMpi {
660670 if (cfg.mEfficiencyTrigger == nullptr ) {
661671 LOGF (fatal, " Could not load efficiency histogram for trigger particles from %s" , cfgEfficiencyTrigger.value .c_str ());
662672 }
663- LOGF (info, " Loaded efficiency histogram for trigger particles from %s (%p) " , cfgEfficiencyTrigger.value .c_str (), ( void *)cfg. mEfficiencyTrigger );
673+ LOGF (info, " Loaded efficiency histogram for trigger particles from %s" , cfgEfficiencyTrigger.value .c_str ());
664674 }
665675 if (cfgEfficiencyAssociated.value .empty () == false ) {
666676 if (cfgLocalEfficiency > 0 ) {
@@ -672,7 +682,7 @@ struct twoPartCorrelationsMpi {
672682 if (cfg.mEfficiencyAssociated == nullptr ) {
673683 LOGF (fatal, " Could not load efficiency histogram for associated particles from %s" , cfgEfficiencyAssociated.value .c_str ());
674684 }
675- LOGF (info, " Loaded efficiency histogram for associated particles from %s (%p) " , cfgEfficiencyAssociated.value .c_str (), ( void *)cfg. mEfficiencyAssociated );
685+ LOGF (info, " Loaded efficiency histogram for associated particles from %s" , cfgEfficiencyAssociated.value .c_str ());
676686 }
677687 cfg.efficiencyLoaded = true ;
678688 }
@@ -699,17 +709,20 @@ struct twoPartCorrelationsMpi {
699709
700710 if (!list) {
701711 LOGF (fatal, " Could not load event-classifier calibration from CCDB path: %s" , cfgNuncSeedsCalibration.value .c_str ());
712+ return ;
702713 }
703714
704715 auto * hNunc = dynamic_cast <TH1D *>(list->FindObject (Form (" calibNuncSeedsVsNch_%d_%d" , trigBin, assocBin)));
705716 auto * hQuantiles = dynamic_cast <TH1D *>(list->FindObject (Form (" calibNuncSeedsQuantileBoundaries_%d_%d" , trigBin, assocBin)));
706717
707718 if (!hNunc) {
708719 LOGF (fatal, " Missing CCDB object calibNuncSeedsVsNch_%d_%d" , trigBin, assocBin);
720+ return ;
709721 }
710722
711723 if (!hQuantiles) {
712724 LOGF (fatal, " Missing CCDB object calibNuncSeedsQuantileBoundaries_%d_%d" , trigBin, assocBin);
725+ return ;
713726 }
714727
715728 const AxisSpec multAxis (axisMultiplicity);
@@ -718,6 +731,7 @@ struct twoPartCorrelationsMpi {
718731 " Multiplicity axis mismatch for event classifier: calibration has %d bins, axisMultiplicity has %d bins" ,
719732 hNunc->GetNbinsX (),
720733 multAxis.getNbins ());
734+ return ;
721735 }
722736
723737 ec.nuncSeedsByMultBin .clear ();
@@ -740,6 +754,7 @@ struct twoPartCorrelationsMpi {
740754
741755 if (!ec.isLoaded ) {
742756 LOGF (fatal, " Event-classifier calibration has fewer than two quantile boundaries" );
757+ return ;
743758 }
744759
745760 LOGF (info,
@@ -755,7 +770,8 @@ struct twoPartCorrelationsMpi {
755770 {
756771 const AxisSpec multAxis (axisMultiplicity);
757772 const auto & edges = multAxis.binEdges ;
758- if (edges.size () < 2 || multiplicity < edges.front () || multiplicity >= edges.back ()) {
773+ const int minEdges = 2 ;
774+ if (edges.size () < minEdges || multiplicity < edges.front () || multiplicity >= edges.back ()) {
759775 return -1 ;
760776 }
761777
@@ -765,7 +781,8 @@ struct twoPartCorrelationsMpi {
765781
766782 int classify (double s) const
767783 {
768- if (ec.quantileBoundaries .size () < 2 ) {
784+ const int minEdges = 2 ;
785+ if (ec.quantileBoundaries .size () < minEdges) {
769786 return -1 ;
770787 }
771788
@@ -786,7 +803,7 @@ struct twoPartCorrelationsMpi {
786803
787804 double s = -1.0 ;
788805
789- if (cfgNuncSeedEstimator.value == 0 ) {
806+ if (cfgNuncSeedEstimator.value == EventClassEstimatorMethod::BinLookup ) {
790807 const int multBin = findMultiplicityBin (multiplicity);
791808
792809 if (multBin < 0 || multBin >= static_cast <int >(ec.nuncSeedsByMultBin .size ())) {
@@ -796,15 +813,15 @@ struct twoPartCorrelationsMpi {
796813 s = ec.nuncSeedsByMultBin [multBin];
797814 }
798815
799- if (cfgNuncSeedEstimator.value == 1 ) {
816+ if (cfgNuncSeedEstimator.value == EventClassEstimatorMethod::Interpolation ) {
800817 if (!ec.interpolation ) {
801818 return -1 ;
802819 }
803820
804821 s = ec.interpolation ->Eval (multiplicity);
805822 }
806823
807- if (cfgNuncSeedEstimator.value != 0 && cfgNuncSeedEstimator.value != 1 ) {
824+ if (cfgNuncSeedEstimator.value != EventClassEstimatorMethod::BinLookup && cfgNuncSeedEstimator.value != EventClassEstimatorMethod::Interpolation ) {
808825 return -1 ;
809826 }
810827
@@ -847,7 +864,7 @@ struct twoPartCorrelationsMpi {
847864 fillQA (collision, multiplicity, tracks);
848865 fillCorrelations<CorrelationContainer::kCFStepReconstructed >(same, tracks, tracks, multiplicity, collision.posZ (), getMagneticField (bc.timestamp ()), 1 .0f );
849866 }
850- PROCESS_SWITCH (twoPartCorrelationsMpi , processSameAOD, " Process same event on AOD" , true );
867+ PROCESS_SWITCH (twoParticleCorrelationsMpi , processSameAOD, " Process same event on AOD" , true );
851868
852869 template <class CollType , class TTracks1 , class TTracks2 >
853870 void processSameDerivedT (CollType const & collision, TTracks1 const & tracks1, TTracks2 const & tracks2)
@@ -891,15 +908,15 @@ struct twoPartCorrelationsMpi {
891908 {
892909 processSameDerivedT (collision, tracks, tracks);
893910 }
894- PROCESS_SWITCH (twoPartCorrelationsMpi , processSameDerived, " Process same event on derived data" , false );
911+ PROCESS_SWITCH (twoParticleCorrelationsMpi , processSameDerived, " Process same event on derived data" , false );
895912
896913 void processSameDerivedMultSet (soa::Filtered<soa::Join<aod::CFCollisions, aod::CFMultSets>>::iterator const & collision, soa::Filtered<aod::CFTracks> const & tracks)
897914 {
898915 if (!passOutlier (collision))
899916 return ;
900917 processSameDerivedT (collision, tracks, tracks);
901918 }
902- PROCESS_SWITCH (twoPartCorrelationsMpi , processSameDerivedMultSet, " Process same event on derived data with multiplicity sets" , false );
919+ PROCESS_SWITCH (twoParticleCorrelationsMpi , processSameDerivedMultSet, " Process same event on derived data with multiplicity sets" , false );
903920
904921 using BinningTypeAOD = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentRun2V0M>;
905922 void processMixedAOD (AodCollisions const & collisions, AodTracks const & tracks, aod::BCsWithTimestamps const &)
@@ -942,7 +959,7 @@ struct twoPartCorrelationsMpi {
942959 fillCorrelations<CorrelationContainer::kCFStepReconstructed >(mixed, tracks1, tracks2, collision1.centRun2V0M (), collision1.posZ (), getMagneticField (bc.timestamp ()), 1 .0f / it.currentWindowNeighbours ());
943960 }
944961 }
945- PROCESS_SWITCH (twoPartCorrelationsMpi , processMixedAOD, " Process mixed events on AOD" , false );
962+ PROCESS_SWITCH (twoParticleCorrelationsMpi , processMixedAOD, " Process mixed events on AOD" , false );
946963
947964 template <class CollType , typename ... TrackTypes>
948965 void processMixedDerivedT (CollType const & collisions, TrackTypes&&... tracks)
@@ -1014,13 +1031,13 @@ struct twoPartCorrelationsMpi {
10141031 {
10151032 processMixedDerivedT (collisions, tracks);
10161033 }
1017- PROCESS_SWITCH (twoPartCorrelationsMpi , processMixedDerived, " Process mixed events on derived data" , false );
1034+ PROCESS_SWITCH (twoParticleCorrelationsMpi , processMixedDerived, " Process mixed events on derived data" , false );
10181035
10191036 void processMixedDerivedMultSet (soa::Filtered<soa::Join<aod::CFCollisions, aod::CFMultSets>> const & collisions, DerivedTracks const & tracks)
10201037 {
10211038 processMixedDerivedT (collisions, tracks);
10221039 }
1023- PROCESS_SWITCH (twoPartCorrelationsMpi , processMixedDerivedMultSet, " Process mixed events on derived data with multiplicity sets" , false );
1040+ PROCESS_SWITCH (twoParticleCorrelationsMpi , processMixedDerivedMultSet, " Process mixed events on derived data with multiplicity sets" , false );
10241041
10251042 int getSpecies (int pdgCode)
10261043 {
@@ -1088,7 +1105,7 @@ struct twoPartCorrelationsMpi {
10881105 }
10891106 }
10901107 }
1091- PROCESS_SWITCH (twoPartCorrelationsMpi , processMCEfficiency, " MC: Extract efficiencies" , false );
1108+ PROCESS_SWITCH (twoParticleCorrelationsMpi , processMCEfficiency, " MC: Extract efficiencies" , false );
10921109
10931110 template <class Particles1 , class Particles2 >
10941111 void processMCSameDerivedT (soa::Filtered<aod::CFMcCollisions>::iterator const & mcCollision, Particles1 const & mcParticles1, Particles2 const & mcParticles2, soa::SmallGroups<aod::CFCollisionsWithLabel> const & collisions)
@@ -1139,7 +1156,7 @@ struct twoPartCorrelationsMpi {
11391156 {
11401157 processMCSameDerivedT (mcCollision, mcParticles, mcParticles, collisions);
11411158 }
1142- PROCESS_SWITCH (twoPartCorrelationsMpi , processMCSameDerived, " Process MC same event on derived data" , false );
1159+ PROCESS_SWITCH (twoParticleCorrelationsMpi , processMCSameDerived, " Process MC same event on derived data" , false );
11431160
11441161 PresliceUnsorted<aod::CFCollisionsWithLabel> collisionPerMCCollision = aod::cfcollision::cfMcCollisionId;
11451162 template <typename ... ParticleTypes>
@@ -1208,12 +1225,12 @@ struct twoPartCorrelationsMpi {
12081225 {
12091226 processMCMixedDerivedT (mcCollisions, collisions, mcParticles);
12101227 }
1211- PROCESS_SWITCH (twoPartCorrelationsMpi , processMCMixedDerived,
1228+ PROCESS_SWITCH (twoParticleCorrelationsMpi , processMCMixedDerived,
12121229 " Process MC mixed events on derived data" , false );
12131230};
12141231
12151232WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
12161233{
12171234 return WorkflowSpec{
1218- adaptAnalysisTask<twoPartCorrelationsMpi >(cfgc)};
1235+ adaptAnalysisTask<twoParticleCorrelationsMpi >(cfgc)};
12191236}
0 commit comments