2828#include " TableHelper.h"
2929#include " MetadataHelper.h"
3030#include " TList.h"
31+ #include " PWGMM/Mult/DataModel/bestCollisionTable.h"
3132
3233using namespace o2 ;
3334using namespace o2 ::framework;
@@ -49,8 +50,7 @@ static constexpr int kFT0MultZeqs = 10;
4950static constexpr int kFDDMultZeqs = 11 ;
5051static constexpr int kPVMultZeqs = 12 ;
5152static constexpr int kMultMCExtras = 13 ;
52- static constexpr int kMFTMults = 14 ;
53- static constexpr int nTables = 15 ;
53+ static constexpr int nTables = 14 ;
5454
5555// Checking that the Zeq tables are after the normal ones
5656static_assert (kFV0Mults < kFV0MultZeqs );
@@ -72,10 +72,9 @@ static const std::vector<std::string> tableNames{"FV0Mults", // 0
7272 " FT0MultZeqs" , // 10
7373 " FDDMultZeqs" , // 11
7474 " PVMultZeqs" , // 12
75- " MultMCExtras" , // 13
76- " MFTMults" }; // 14
75+ " MultMCExtras" }; // 13
7776static const std::vector<std::string> parameterNames{" Enable" };
78- static const int defaultParameters[nTables][nParameters]{{-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {- 1 } };
77+ static const int defaultParameters[nTables][nParameters]{{-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }};
7978
8079struct MultiplicityTable {
8180 SliceCache cache;
@@ -94,7 +93,7 @@ struct MultiplicityTable {
9493 Produces<aod::PVMultZeqs> tablePVZeqs; // 12
9594 Produces<aod::MultMCExtras> tableExtraMc; // 13
9695 Produces<aod::Mult2MCExtras> tableExtraMult2MCExtras;
97- Produces<aod::MFTMults> mftMults; // 14
96+ Produces<aod::MFTMults> mftMults; // Not accounted for, produced using custom process function to avoid dependencies
9897 Produces<aod::MultsGlobal> multsGlobal; // Not accounted for, produced based on process function processGlobalTrackingCounters
9998
10099 // For vertex-Z corrections in calibration
@@ -301,8 +300,7 @@ struct MultiplicityTable {
301300 aod::Zdcs const &,
302301 aod::FV0As const &,
303302 aod::FT0s const &,
304- aod::FDDs const &,
305- aod::MFTTracks const & mftTracks)
303+ aod::FDDs const &)
306304 {
307305 // reserve memory
308306 for (auto i : mEnabledTables ) {
@@ -348,9 +346,6 @@ struct MultiplicityTable {
348346 break ;
349347 case kMultMCExtras : // MC extra information (nothing to do in the data)
350348 break ;
351- case kMFTMults : // Equalized multiplicity for PV
352- mftMults.reserve (collisions.size ());
353- break ;
354349 default :
355350 LOG (fatal) << " Unknown table requested: " << i;
356351 break ;
@@ -629,19 +624,6 @@ struct MultiplicityTable {
629624 case kMultMCExtras : // MC only (nothing to do)
630625 {
631626 } break ;
632- case kMFTMults : {
633- // for centrality estimation with the MFT if desired
634- // step 1: produce proper grouping
635- const uint64_t collIdx = collision.globalIndex ();
636- auto mftTracksGrouped = mftTracks.sliceBy (perCollisionMFT, collIdx);
637- int nTracks = 0 ;
638- for (auto & track : mftTracksGrouped) {
639- if (track.nClusters () >= 5 ) { // hardcoded on purpose to avoid trouble
640- nTracks++;
641- }
642- }
643- mftMults (nTracks);
644- } break ;
645627 default : // Default
646628 {
647629 LOG (fatal) << " Unknown table requested: " << i;
@@ -754,12 +736,44 @@ struct MultiplicityTable {
754736 multsGlobal (nGlobalTracks, multNContribsEta08_kGlobalTrackWoDCA, multNContribsEta10_kGlobalTrackWoDCA, multNContribsEta05_kGlobalTrackWoDCA);
755737 }
756738
739+ void processRun3MFT (soa::Join<aod::Collisions, aod::EvSels>::iterator const &,
740+ o2::aod::MFTTracks const & mftTracks,
741+ soa::SmallGroups<aod::BestCollisionsFwd> const & retracks)
742+ {
743+ int nAllTracks = 0 ;
744+ int nTracks = 0 ;
745+
746+ for (auto & track : mftTracks) {
747+ if (track.nClusters () >= 5 ) { // hardcoded for now
748+ nAllTracks++;
749+ }
750+ }
751+
752+ if (retracks.size () > 0 ) {
753+ for (auto & retrack : retracks) {
754+ auto track = retrack.mfttrack ();
755+ if (track.nClusters () < 5 ) {
756+ continue ; // min cluster requirement
757+ }
758+ if ((track.eta () > -2 .0f ) && (track.eta () < -3 .9f )) {
759+ continue ; // too far to be of true interest
760+ }
761+ if (std::abs (retrack.bestDCAXY ()) > 2 .0f ) {
762+ continue ; // does not point to PV properly
763+ }
764+ nTracks++;
765+ }
766+ }
767+ mftMults (nAllTracks, nTracks);
768+ }
769+
757770 // Process switches
758771 PROCESS_SWITCH (MultiplicityTable, processRun2, " Produce Run 2 multiplicity tables" , false );
759772 PROCESS_SWITCH (MultiplicityTable, processRun3, " Produce Run 3 multiplicity tables" , true );
760773 PROCESS_SWITCH (MultiplicityTable, processGlobalTrackingCounters, " Produce Run 3 global counters" , false );
761774 PROCESS_SWITCH (MultiplicityTable, processMC, " Produce MC multiplicity tables" , false );
762775 PROCESS_SWITCH (MultiplicityTable, processMC2Mults, " Produce MC -> Mult map" , false );
776+ PROCESS_SWITCH (MultiplicityTable, processRun3MFT, " Produce MFT mult tables" , false );
763777};
764778
765779WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments