Skip to content

Commit 5b9f1ea

Browse files
ddobrigkalibuild
andauthored
[Common] Preparations for MFT track-based centrality (#8885)
Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent 6358059 commit 5b9f1ea

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

Common/DataModel/Multiplicity.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(IsInelGt0, isInelGt0, //! is INEL > 0
4545
[](int multPveta1) -> bool { return multPveta1 > 0; });
4646
DECLARE_SOA_DYNAMIC_COLUMN(IsInelGt1, isInelGt1, //! is INEL > 1
4747
[](int multPveta1) -> bool { return multPveta1 > 1; });
48+
49+
// forward track counters
50+
DECLARE_SOA_COLUMN(MFTNtracks, mftNtracks, int); //!
51+
4852
// MC
4953
DECLARE_SOA_COLUMN(MultMCFT0A, multMCFT0A, int); //!
5054
DECLARE_SOA_COLUMN(MultMCFT0C, multMCFT0C, int); //!
@@ -108,9 +112,12 @@ DECLARE_SOA_TABLE(PVMults, "AOD", "PVMULT", //! Multiplicity from the PV contrib
108112
mult::MultNTracksPVetaHalf,
109113
mult::IsInelGt0<mult::MultNTracksPVeta1>,
110114
mult::IsInelGt1<mult::MultNTracksPVeta1>);
115+
DECLARE_SOA_TABLE(MFTMults, "AOD", "MFTMULT", //! Multiplicity with MFT
116+
mult::MFTNtracks);
111117
using BarrelMults = soa::Join<TrackletMults, TPCMults, PVMults>;
112118
using Mults = soa::Join<BarrelMults, FV0Mults, FT0Mults, FDDMults, ZDCMults>;
113119
using FT0Mult = FT0Mults::iterator;
120+
using MFTMult = MFTMults::iterator;
114121
using Mult = Mults::iterator;
115122

116123
DECLARE_SOA_TABLE(MultsExtra_000, "AOD", "MULTEXTRA", //!

Common/TableProducer/multiplicityTable.cxx

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ static constexpr int kFT0MultZeqs = 10;
4949
static constexpr int kFDDMultZeqs = 11;
5050
static constexpr int kPVMultZeqs = 12;
5151
static 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
5556
static_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
7577
static 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

7880
struct 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

Comments
 (0)