@@ -49,7 +49,8 @@ static constexpr int kFT0MultZeqs = 10;
4949static constexpr int kFDDMultZeqs = 11 ;
5050static constexpr int kPVMultZeqs = 12 ;
5151static constexpr int kMultMCExtras = 13 ;
52- static constexpr int nTables = 14 ;
52+ static constexpr int kMFTMults = 14 ;
53+ static constexpr int nTables = 15 ;
5354
5455// Checking that the Zeq tables are after the normal ones
5556static_assert (kFV0Mults < kFV0MultZeqs );
@@ -71,9 +72,10 @@ static const std::vector<std::string> tableNames{"FV0Mults", // 0
7172 " FT0MultZeqs" , // 10
7273 " FDDMultZeqs" , // 11
7374 " PVMultZeqs" , // 12
74- " MultMCExtras" }; // 13
75+ " MultMCExtras" , // 13
76+ " MFTMults" }; // 14
7577static const std::vector<std::string> parameterNames{" Enable" };
76- static const int defaultParameters[nTables][nParameters]{{-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }};
78+ static const int defaultParameters[nTables][nParameters]{{-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {- 1 } };
7779
7880struct MultiplicityTable {
7981 SliceCache cache;
@@ -92,6 +94,7 @@ struct MultiplicityTable {
9294 Produces<aod::PVMultZeqs> tablePVZeqs; // 12
9395 Produces<aod::MultMCExtras> tableExtraMc; // 13
9496 Produces<aod::Mult2MCExtras> tableExtraMult2MCExtras;
97+ Produces<aod::MFTMults> mftMults; // 14
9598 Produces<aod::MultsGlobal> multsGlobal; // Not accounted for, produced based on process function processGlobalTrackingCounters
9699
97100 // For vertex-Z corrections in calibration
@@ -105,6 +108,7 @@ struct MultiplicityTable {
105108 Partition<Run2Tracks> pvContribTracksEta1 = (nabs(aod::track::eta) < 1 .0f ) && ((aod::track::flags & (uint32_t )o2::aod::track::PVContributor) == (uint32_t )o2::aod::track::PVContributor);
106109 Preslice<aod::Tracks> perCol = aod::track::collisionId;
107110 Preslice<aod::TracksIU> perColIU = aod::track::collisionId;
111+ Preslice<aod::MFTTracks> perCollisionMFT = o2::aod::fwdtrack::collisionId;
108112
109113 using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Timestamps, aod::Run3MatchedToBCSparse>;
110114
@@ -297,7 +301,8 @@ struct MultiplicityTable {
297301 aod::Zdcs const &,
298302 aod::FV0As const &,
299303 aod::FT0s const &,
300- aod::FDDs const &)
304+ aod::FDDs const &,
305+ aod::MFTTracks const & mftTracks)
301306 {
302307 // reserve memory
303308 for (auto i : mEnabledTables ) {
@@ -343,6 +348,9 @@ struct MultiplicityTable {
343348 break ;
344349 case kMultMCExtras : // MC extra information (nothing to do in the data)
345350 break ;
351+ case kMFTMults : // Equalized multiplicity for PV
352+ mftMults.reserve (collisions.size ());
353+ break ;
346354 default :
347355 LOG (fatal) << " Unknown table requested: " << i;
348356 break ;
@@ -621,6 +629,19 @@ struct MultiplicityTable {
621629 case kMultMCExtras : // MC only (nothing to do)
622630 {
623631 } 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 ;
624645 default : // Default
625646 {
626647 LOG (fatal) << " Unknown table requested: " << i;
0 commit comments