Skip to content

Commit

Permalink
[Common] Preparations for MFT track-based centrality (#8885)
Browse files Browse the repository at this point in the history
Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
  • Loading branch information
ddobrigk and alibuild authored Dec 9, 2024
1 parent 6358059 commit 5b9f1ea
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
7 changes: 7 additions & 0 deletions Common/DataModel/Multiplicity.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(IsInelGt0, isInelGt0, //! is INEL > 0
[](int multPveta1) -> bool { return multPveta1 > 0; });
DECLARE_SOA_DYNAMIC_COLUMN(IsInelGt1, isInelGt1, //! is INEL > 1
[](int multPveta1) -> bool { return multPveta1 > 1; });

// forward track counters
DECLARE_SOA_COLUMN(MFTNtracks, mftNtracks, int); //!

// MC
DECLARE_SOA_COLUMN(MultMCFT0A, multMCFT0A, int); //!
DECLARE_SOA_COLUMN(MultMCFT0C, multMCFT0C, int); //!
Expand Down Expand Up @@ -108,9 +112,12 @@ DECLARE_SOA_TABLE(PVMults, "AOD", "PVMULT", //! Multiplicity from the PV contrib
mult::MultNTracksPVetaHalf,
mult::IsInelGt0<mult::MultNTracksPVeta1>,
mult::IsInelGt1<mult::MultNTracksPVeta1>);
DECLARE_SOA_TABLE(MFTMults, "AOD", "MFTMULT", //! Multiplicity with MFT
mult::MFTNtracks);
using BarrelMults = soa::Join<TrackletMults, TPCMults, PVMults>;
using Mults = soa::Join<BarrelMults, FV0Mults, FT0Mults, FDDMults, ZDCMults>;
using FT0Mult = FT0Mults::iterator;
using MFTMult = MFTMults::iterator;
using Mult = Mults::iterator;

DECLARE_SOA_TABLE(MultsExtra_000, "AOD", "MULTEXTRA", //!
Expand Down
29 changes: 25 additions & 4 deletions Common/TableProducer/multiplicityTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ static constexpr int kFT0MultZeqs = 10;
static constexpr int kFDDMultZeqs = 11;
static constexpr int kPVMultZeqs = 12;
static constexpr int kMultMCExtras = 13;
static constexpr int nTables = 14;
static constexpr int kMFTMults = 14;
static constexpr int nTables = 15;

// Checking that the Zeq tables are after the normal ones
static_assert(kFV0Mults < kFV0MultZeqs);
Expand All @@ -71,9 +72,10 @@ static const std::vector<std::string> tableNames{"FV0Mults", // 0
"FT0MultZeqs", // 10
"FDDMultZeqs", // 11
"PVMultZeqs", // 12
"MultMCExtras"}; // 13
"MultMCExtras", // 13
"MFTMults"}; // 14
static const std::vector<std::string> parameterNames{"Enable"};
static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}};
static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}};

struct MultiplicityTable {
SliceCache cache;
Expand All @@ -92,6 +94,7 @@ struct MultiplicityTable {
Produces<aod::PVMultZeqs> tablePVZeqs; // 12
Produces<aod::MultMCExtras> tableExtraMc; // 13
Produces<aod::Mult2MCExtras> tableExtraMult2MCExtras;
Produces<aod::MFTMults> mftMults; // 14
Produces<aod::MultsGlobal> multsGlobal; // Not accounted for, produced based on process function processGlobalTrackingCounters

// For vertex-Z corrections in calibration
Expand All @@ -105,6 +108,7 @@ struct MultiplicityTable {
Partition<Run2Tracks> pvContribTracksEta1 = (nabs(aod::track::eta) < 1.0f) && ((aod::track::flags & (uint32_t)o2::aod::track::PVContributor) == (uint32_t)o2::aod::track::PVContributor);
Preslice<aod::Tracks> perCol = aod::track::collisionId;
Preslice<aod::TracksIU> perColIU = aod::track::collisionId;
Preslice<aod::MFTTracks> perCollisionMFT = o2::aod::fwdtrack::collisionId;

using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Timestamps, aod::Run3MatchedToBCSparse>;

Expand Down Expand Up @@ -297,7 +301,8 @@ struct MultiplicityTable {
aod::Zdcs const&,
aod::FV0As const&,
aod::FT0s const&,
aod::FDDs const&)
aod::FDDs const&,
aod::MFTTracks const& mftTracks)
{
// reserve memory
for (auto i : mEnabledTables) {
Expand Down Expand Up @@ -343,6 +348,9 @@ struct MultiplicityTable {
break;
case kMultMCExtras: // MC extra information (nothing to do in the data)
break;
case kMFTMults: // Equalized multiplicity for PV
mftMults.reserve(collisions.size());
break;
default:
LOG(fatal) << "Unknown table requested: " << i;
break;
Expand Down Expand Up @@ -621,6 +629,19 @@ struct MultiplicityTable {
case kMultMCExtras: // MC only (nothing to do)
{
} break;
case kMFTMults: {
// for centrality estimation with the MFT if desired
// step 1: produce proper grouping
const uint64_t collIdx = collision.globalIndex();
auto mftTracksGrouped = mftTracks.sliceBy(perCollisionMFT, collIdx);
int nTracks = 0;
for (auto& track : mftTracksGrouped) {
if (track.nClusters() >= 5) { // hardcoded on purpose to avoid trouble
nTracks++;
}
}
mftMults(nTracks);
} break;
default: // Default
{
LOG(fatal) << "Unknown table requested: " << i;
Expand Down

0 comments on commit 5b9f1ea

Please sign in to comment.