Skip to content

Commit 7826dc6

Browse files
ddobrigkalibuild
andauthored
[Common] add extra MFT counters to mult table (#8980)
Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent f60e2b9 commit 7826dc6

File tree

2 files changed

+41
-26
lines changed

2 files changed

+41
-26
lines changed

Common/DataModel/Multiplicity.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(IsInelGt1, isInelGt1, //! is INEL > 1
4747
[](int multPveta1) -> bool { return multPveta1 > 1; });
4848

4949
// forward track counters
50-
DECLARE_SOA_COLUMN(MFTNtracks, mftNtracks, int); //!
50+
DECLARE_SOA_COLUMN(MFTNalltracks, mftNalltracks, int); //! overall counter, uses AO2D coll assoc
51+
DECLARE_SOA_COLUMN(MFTNtracks, mftNtracks, int); //! reassigned, uses mult group software
5152

5253
// MC
5354
DECLARE_SOA_COLUMN(MultMCFT0A, multMCFT0A, int); //!
@@ -113,7 +114,7 @@ DECLARE_SOA_TABLE(PVMults, "AOD", "PVMULT", //! Multiplicity from the PV contrib
113114
mult::IsInelGt0<mult::MultNTracksPVeta1>,
114115
mult::IsInelGt1<mult::MultNTracksPVeta1>);
115116
DECLARE_SOA_TABLE(MFTMults, "AOD", "MFTMULT", //! Multiplicity with MFT
116-
mult::MFTNtracks);
117+
mult::MFTNalltracks, mult::MFTNtracks);
117118
using BarrelMults = soa::Join<TrackletMults, TPCMults, PVMults>;
118119
using Mults = soa::Join<BarrelMults, FV0Mults, FT0Mults, FDDMults, ZDCMults>;
119120
using FT0Mult = FT0Mults::iterator;

Common/TableProducer/multiplicityTable.cxx

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "TableHelper.h"
2929
#include "MetadataHelper.h"
3030
#include "TList.h"
31+
#include "PWGMM/Mult/DataModel/bestCollisionTable.h"
3132

3233
using namespace o2;
3334
using namespace o2::framework;
@@ -49,8 +50,7 @@ static constexpr int kFT0MultZeqs = 10;
4950
static constexpr int kFDDMultZeqs = 11;
5051
static constexpr int kPVMultZeqs = 12;
5152
static 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
5656
static_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
7776
static 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

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

765779
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)