Skip to content

Commit 18bf88d

Browse files
ddobrigkalibuild
andauthored
Common: interlink MC extras with reco coll info (#7633)
* Common: interlink MC extras with reco coll info * Please consider the following formatting changes (#342) --------- Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent 9f394a8 commit 18bf88d

2 files changed

Lines changed: 30 additions & 10 deletions

File tree

Common/DataModel/Multiplicity.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ DECLARE_SOA_TABLE(MultsGlobal, "AOD", "MULTGLOBAL", //! counters that use Track
130130
DECLARE_SOA_TABLE(MultSelections, "AOD", "MULTSELECTIONS", //!
131131
evsel::Selection); // for derived data / QA studies
132132
using MultExtra = MultsExtra::iterator;
133-
DECLARE_SOA_TABLE(MultsExtraMC, "AOD", "MULTEXTRAMC", //! Table for the MC information
133+
134+
// mc collisions table - indexed to Mult
135+
DECLARE_SOA_TABLE(MultMCExtras, "AOD", "MULTMCEXTRA", //! Table for the MC information
134136
mult::MultMCFT0A,
135137
mult::MultMCFT0C,
136138
mult::MultMCNParticlesEta05,
@@ -140,7 +142,17 @@ DECLARE_SOA_TABLE(MultsExtraMC, "AOD", "MULTEXTRAMC", //! Table for the MC infor
140142
mult::IsInelGt0<mult::MultMCNParticlesEta10>,
141143
mult::IsInelGt1<mult::MultMCNParticlesEta10>,
142144
o2::soa::Marker<1>);
143-
using MultExtraMC = MultsExtraMC::iterator;
145+
using MultMCExtra = MultMCExtras::iterator;
146+
using MultsExtraMC = MultMCExtras; // for backwards compatibility with previous naming scheme
147+
148+
// crosslinks
149+
namespace mult
150+
{
151+
DECLARE_SOA_INDEX_COLUMN(MultMCExtra, multMCExtra);
152+
}
153+
154+
DECLARE_SOA_TABLE(MC2Mults, "AOD", "MC2MULTS", //! Relate BC -> mult
155+
o2::soa::Index<>, mult::MultMCExtraId);
144156

145157
namespace multZeq
146158
{

Common/TableProducer/multiplicityTable.cxx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static constexpr int kFV0MultZeqs = 9;
4343
static constexpr int kFT0MultZeqs = 10;
4444
static constexpr int kFDDMultZeqs = 11;
4545
static constexpr int kPVMultZeqs = 12;
46-
static constexpr int kMultsExtraMC = 13;
46+
static constexpr int kMultMCExtras = 13;
4747
static constexpr int nTables = 14;
4848

4949
// Checking that the Zeq tables are after the normal ones
@@ -66,7 +66,7 @@ static const std::vector<std::string> tableNames{"FV0Mults", // 0
6666
"FT0MultZeqs", // 10
6767
"FDDMultZeqs", // 11
6868
"PVMultZeqs", // 12
69-
"MultsExtraMC"}; // 13
69+
"MultMCExtras"}; // 13
7070
static const std::vector<std::string> parameterNames{"Enable"};
7171
static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}};
7272

@@ -85,7 +85,8 @@ struct MultiplicityTable {
8585
Produces<aod::FT0MultZeqs> tableFT0Zeqs; // 10
8686
Produces<aod::FDDMultZeqs> tableFDDZeqs; // 11
8787
Produces<aod::PVMultZeqs> tablePVZeqs; // 12
88-
Produces<aod::MultsExtraMC> tableExtraMc; // 13
88+
Produces<aod::MultMCExtras> tableExtraMc; // 13
89+
Produces<aod::MC2Mults> tableExtraMc2Mults;
8990
Produces<aod::MultsGlobal> multsGlobal; // Not accounted for, produced based on process function processGlobalTrackingCounters
9091

9192
// For vertex-Z corrections in calibration
@@ -163,10 +164,11 @@ struct MultiplicityTable {
163164
}
164165
}
165166
// Handle the custom cases.
166-
if (tEnabled[kMultsExtraMC]) {
167-
if (enabledTables->get(tableNames[kMultsExtraMC].c_str(), "Enable") == -1) {
167+
if (tEnabled[kMultMCExtras]) {
168+
if (enabledTables->get(tableNames[kMultMCExtras].c_str(), "Enable") == -1) {
168169
doprocessMC.value = true;
169-
LOG(info) << "Enabling MC processing due to " << tableNames[kMultsExtraMC] << " table being enabled.";
170+
doprocessMC2Mults.value = true;
171+
LOG(info) << "Enabling MC processing due to " << tableNames[kMultMCExtras] << " table being enabled.";
170172
}
171173
}
172174

@@ -335,7 +337,7 @@ struct MultiplicityTable {
335337
case kPVMultZeqs: // Equalized multiplicity for PV
336338
tablePVZeqs.reserve(collisions.size());
337339
break;
338-
case kMultsExtraMC: // MC extra information (nothing to do in the data)
340+
case kMultMCExtras: // MC extra information (nothing to do in the data)
339341
break;
340342
default:
341343
LOG(fatal) << "Unknown table requested: " << i;
@@ -609,7 +611,7 @@ struct MultiplicityTable {
609611
}
610612
tablePVZeqs(multZeqNContribs);
611613
} break;
612-
case kMultsExtraMC: // MC only (nothing to do)
614+
case kMultMCExtras: // MC only (nothing to do)
613615
{
614616
} break;
615617
default: // Default
@@ -665,6 +667,11 @@ struct MultiplicityTable {
665667
tableExtraMc(multFT0A, multFT0C, multBarrelEta05, multBarrelEta08, multBarrelEta10, mcCollision.posZ());
666668
}
667669

670+
void processMC2Mults(soa::Join<aod::McCollisionLabels, aod::Collisions>::iterator const& collision)
671+
{
672+
tableExtraMc2Mults(collision.mcCollisionId()); // interlink
673+
}
674+
668675
Configurable<float> min_pt_globaltrack{"min_pt_globaltrack", 0.15, "min. pT for global tracks"};
669676
Configurable<float> max_pt_globaltrack{"max_pt_globaltrack", 1e+10, "max. pT for global tracks"};
670677
Configurable<int> min_ncluster_its_globaltrack{"min_ncluster_its_globaltrack", 5, "min. number of ITS clusters for global tracks"};
@@ -715,6 +722,7 @@ struct MultiplicityTable {
715722
PROCESS_SWITCH(MultiplicityTable, processRun3, "Produce Run 3 multiplicity tables", true);
716723
PROCESS_SWITCH(MultiplicityTable, processGlobalTrackingCounters, "Produce Run 3 global counters", false);
717724
PROCESS_SWITCH(MultiplicityTable, processMC, "Produce MC multiplicity tables", false);
725+
PROCESS_SWITCH(MultiplicityTable, processMC2Mults, "Produce MC -> Mult map", false);
718726
};
719727

720728
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)