Skip to content

Commit dd352a4

Browse files
committed
Propagate changes
1 parent bc0ad5d commit dd352a4

9 files changed

Lines changed: 152 additions & 128 deletions

PWGHF/TableProducer/derivedDataCreatorB0ToDPi.cxx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ struct HfDerivedDataCreatorB0ToDPi {
9494

9595
SliceCache cache;
9696
static constexpr double Mass{o2::constants::physics::MassB0};
97+
static constexpr int NHypothesesCand{1}; // Number of possible selection hypotheses per candidate.
9798

9899
using CollisionsWCentMult = soa::Join<aod::Collisions, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
99100
using CollisionsWMcCentMult = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
@@ -139,6 +140,7 @@ struct HfDerivedDataCreatorB0ToDPi {
139140
void fillTablesCandidate(const T& candidate, const U& prongCharm, const V& prongBachelor, int candFlag, double invMass,
140141
double ct, double y, int8_t flagMc, int8_t origin, float mlScore, const std::vector<float>& mlScoresCharm)
141142
{
143+
LOGF(debug, "Filling candidate at derived index %d", rowsCommon.rowCandidateBase.lastIndex() + 1);
142144
rowsCommon.fillTablesCandidate(candidate, invMass, y);
143145
if (fillCandidatePar) {
144146
rowCandidatePar(
@@ -249,38 +251,39 @@ struct HfDerivedDataCreatorB0ToDPi {
249251
rowsCommon.matchedCollisions.clear();
250252
}
251253
}
252-
// auto sizeTableColl = collisions.size();
254+
// const auto sizeTableColl = collisions.size();
253255
// rowsCommon.reserveTablesColl(sizeTableColl);
256+
const auto sizeTableCand = candidates.size() * NHypothesesCand;
257+
rowsCommon.reserveTablesCandidates(sizeTableCand);
258+
reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand);
259+
reserveTable(rowCandidateParDplus, fillCandidateParDplus, sizeTableCand);
260+
reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand);
261+
reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand);
262+
reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand);
263+
reserveTable(rowCandidateMlDplus, fillCandidateMlDplus, sizeTableCand);
264+
reserveTable(rowCandidateId, fillCandidateId, sizeTableCand);
265+
if constexpr (IsMc) {
266+
reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand);
267+
}
254268
for (const auto& collision : collisions) {
255-
auto thisCollId = collision.globalIndex();
256-
auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME
257-
auto sizeTableCand = candidatesThisColl.size();
258-
LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand);
269+
const auto thisCollId = collision.globalIndex();
270+
const auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME
271+
const auto sizeTableCandThisColl = candidatesThisColl.size();
272+
LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCandThisColl);
259273
// Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions)
260274
bool mcCollisionHasMcParticles{false};
261275
if constexpr (IsMc) {
262276
mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()];
263277
LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no");
264278
}
265-
if (sizeTableCand == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) {
279+
if (sizeTableCandThisColl == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) {
266280
LOGF(debug, "Skipping rec. collision %d", thisCollId);
267281
continue;
268282
}
269283
LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1);
270284
rowsCommon.fillTablesCollision<IsMc>(collision);
271285

272286
// Fill candidate properties
273-
rowsCommon.reserveTablesCandidates(sizeTableCand);
274-
reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand);
275-
reserveTable(rowCandidateParDplus, fillCandidateParDplus, sizeTableCand);
276-
reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand);
277-
reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand);
278-
reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand);
279-
reserveTable(rowCandidateMlDplus, fillCandidateMlDplus, sizeTableCand);
280-
reserveTable(rowCandidateId, fillCandidateId, sizeTableCand);
281-
if constexpr (IsMc) {
282-
reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand);
283-
}
284287
int8_t flagMcRec = 0, origin = 0;
285288
for (const auto& candidate : candidatesThisColl) {
286289
if constexpr (IsMl) {

PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ struct HfDerivedDataCreatorBplusToD0Pi {
9797

9898
SliceCache cache;
9999
static constexpr double Mass{o2::constants::physics::MassBPlus};
100+
static constexpr int NHypothesesCand{1}; // Number of possible selection hypotheses per candidate.
100101

101102
using CollisionsWCentMult = soa::Join<aod::Collisions, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
102103
using CollisionsWMcCentMult = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
@@ -142,6 +143,7 @@ struct HfDerivedDataCreatorBplusToD0Pi {
142143
void fillTablesCandidate(const T& candidate, const U& prongCharm, const V& prongBachelor, int candFlag, double invMass,
143144
double ct, double y, int8_t flagMc, int8_t origin, float mlScore, const std::vector<float>& mlScoresCharm)
144145
{
146+
LOGF(debug, "Filling candidate at derived index %d", rowsCommon.rowCandidateBase.lastIndex() + 1);
145147
rowsCommon.fillTablesCandidate(candidate, invMass, y);
146148
if (fillCandidatePar) {
147149
rowCandidatePar(
@@ -284,39 +286,40 @@ struct HfDerivedDataCreatorBplusToD0Pi {
284286
rowsCommon.matchedCollisions.clear();
285287
}
286288
}
287-
// auto sizeTableColl = collisions.size();
289+
// const auto sizeTableColl = collisions.size();
288290
// rowsCommon.reserveTablesColl(sizeTableColl);
291+
const auto sizeTableCand = candidates.size() * NHypothesesCand;
292+
rowsCommon.reserveTablesCandidates(sizeTableCand);
293+
reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand);
294+
reserveTable(rowCandidateParD0, fillCandidateParD0, sizeTableCand);
295+
reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand);
296+
reserveTable(rowCandidateParD0E, fillCandidateParD0E, sizeTableCand);
297+
reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand);
298+
reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand);
299+
reserveTable(rowCandidateMlD0, fillCandidateMlD0, sizeTableCand);
300+
reserveTable(rowCandidateId, fillCandidateId, sizeTableCand);
301+
if constexpr (IsMc) {
302+
reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand);
303+
}
289304
for (const auto& collision : collisions) {
290-
auto thisCollId = collision.globalIndex();
291-
auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME
292-
auto sizeTableCand = candidatesThisColl.size();
293-
LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand);
305+
const auto thisCollId = collision.globalIndex();
306+
const auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME
307+
const auto sizeTableCandThisColl = candidatesThisColl.size();
308+
LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCandThisColl);
294309
// Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions)
295310
bool mcCollisionHasMcParticles{false};
296311
if constexpr (IsMc) {
297312
mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()];
298313
LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no");
299314
}
300-
if (sizeTableCand == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) {
315+
if (sizeTableCandThisColl == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) {
301316
LOGF(debug, "Skipping rec. collision %d", thisCollId);
302317
continue;
303318
}
304319
LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1);
305320
rowsCommon.fillTablesCollision<IsMc>(collision);
306321

307322
// Fill candidate properties
308-
rowsCommon.reserveTablesCandidates(sizeTableCand);
309-
reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand);
310-
reserveTable(rowCandidateParD0, fillCandidateParD0, sizeTableCand);
311-
reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand);
312-
reserveTable(rowCandidateParD0E, fillCandidateParD0E, sizeTableCand);
313-
reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand);
314-
reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand);
315-
reserveTable(rowCandidateMlD0, fillCandidateMlD0, sizeTableCand);
316-
reserveTable(rowCandidateId, fillCandidateId, sizeTableCand);
317-
if constexpr (IsMc) {
318-
reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand);
319-
}
320323
int8_t flagMcRec = 0, origin = 0;
321324
for (const auto& candidate : candidatesThisColl) {
322325
if constexpr (IsMl) {

PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,15 @@ struct HfDerivedDataCreatorD0ToKPi {
265265
for (const auto& collision : collisions) {
266266
const auto thisCollId = collision.globalIndex();
267267
const auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME
268-
const auto sizeTableCand = candidatesThisColl.size();
269-
LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand);
268+
const auto sizeTableCandThisColl = candidatesThisColl.size();
269+
LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCandThisColl);
270270
// Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions)
271271
bool mcCollisionHasMcParticles{false};
272272
if constexpr (IsMc) {
273273
mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()];
274274
LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no");
275275
}
276-
if (sizeTableCand == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) {
276+
if (sizeTableCandThisColl == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) {
277277
LOGF(debug, "Skipping rec. collision %d", thisCollId);
278278
continue;
279279
}

PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ struct HfDerivedDataCreatorDplusToPiKPi {
9090

9191
SliceCache cache;
9292
static constexpr double Mass{o2::constants::physics::MassDPlus};
93+
static constexpr int NHypothesesCand{1}; // Number of possible selection hypotheses per candidate.
9394

9495
using CollisionsWCentMult = soa::Join<aod::Collisions, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
9596
using CollisionsWMcCentMult = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
@@ -134,6 +135,7 @@ struct HfDerivedDataCreatorDplusToPiKPi {
134135
void fillTablesCandidate(const T& candidate, int candFlag, double invMass,
135136
double ct, double y, int8_t flagMc, int8_t origin, int8_t swapping, int8_t flagDecayChan, const std::vector<float>& mlScores)
136137
{
138+
LOGF(debug, "Filling candidate at derived index %d", rowsCommon.rowCandidateBase.lastIndex() + 1);
137139
rowsCommon.fillTablesCandidate(candidate, invMass, y);
138140
if (fillCandidatePar) {
139141
rowCandidatePar(
@@ -246,36 +248,37 @@ struct HfDerivedDataCreatorDplusToPiKPi {
246248
rowsCommon.matchedCollisions.clear();
247249
}
248250
}
249-
// auto sizeTableColl = collisions.size();
251+
// const auto sizeTableColl = collisions.size();
250252
// rowsCommon.reserveTablesColl(sizeTableColl);
253+
const auto sizeTableCand = candidates.size() * NHypothesesCand;
254+
rowsCommon.reserveTablesCandidates(sizeTableCand);
255+
reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand);
256+
reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand);
257+
reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand);
258+
reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand);
259+
reserveTable(rowCandidateId, fillCandidateId, sizeTableCand);
260+
if constexpr (IsMc) {
261+
reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand);
262+
}
251263
for (const auto& collision : collisions) {
252-
auto thisCollId = collision.globalIndex();
253-
auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME
254-
auto sizeTableCand = candidatesThisColl.size();
255-
LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand);
264+
const auto thisCollId = collision.globalIndex();
265+
const auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME
266+
const auto sizeTableCandThisColl = candidatesThisColl.size();
267+
LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCandThisColl);
256268
// Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions)
257269
bool mcCollisionHasMcParticles{false};
258270
if constexpr (IsMc) {
259271
mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()];
260272
LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no");
261273
}
262-
if (sizeTableCand == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) {
274+
if (sizeTableCandThisColl == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) {
263275
LOGF(debug, "Skipping rec. collision %d", thisCollId);
264276
continue;
265277
}
266278
LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1);
267279
rowsCommon.fillTablesCollision<IsMc>(collision);
268280

269281
// Fill candidate properties
270-
rowsCommon.reserveTablesCandidates(sizeTableCand);
271-
reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand);
272-
reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand);
273-
reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand);
274-
reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand);
275-
reserveTable(rowCandidateId, fillCandidateId, sizeTableCand);
276-
if constexpr (IsMc) {
277-
reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand);
278-
}
279282
int8_t flagMcRec = 0, origin = 0, swapping = 0, flagDecayChanRec = 0;
280283
for (const auto& candidate : candidatesThisColl) {
281284
if constexpr (IsMl) {

PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ struct HfDerivedDataCreatorDsToKKPi {
8888

8989
SliceCache cache;
9090
static constexpr double Mass{o2::constants::physics::MassDS};
91+
static constexpr int NHypothesesCand{1}; // Number of possible selection hypotheses per candidate.
9192

9293
using CollisionsWCentMult = soa::Join<aod::Collisions, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
9394
using CollisionsWMcCentMult = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
@@ -132,6 +133,7 @@ struct HfDerivedDataCreatorDsToKKPi {
132133
void fillTablesCandidate(const T& candidate, int candFlag, double invMass,
133134
double ct, double y, int8_t flagMc, int8_t origin, int8_t swapping, int8_t flagDecayChan, const std::vector<float>& mlScores)
134135
{
136+
LOGF(debug, "Filling candidate at derived index %d", rowsCommon.rowCandidateBase.lastIndex() + 1);
135137
rowsCommon.fillTablesCandidate(candidate, invMass, y);
136138
if (fillCandidatePar) {
137139
rowCandidatePar(
@@ -229,36 +231,37 @@ struct HfDerivedDataCreatorDsToKKPi {
229231
rowsCommon.matchedCollisions.clear();
230232
}
231233
}
232-
// auto sizeTableColl = collisions.size();
234+
// const auto sizeTableColl = collisions.size();
233235
// rowsCommon.reserveTablesColl(sizeTableColl);
236+
const auto sizeTableCand = candidates.size() * NHypothesesCand;
237+
rowsCommon.reserveTablesCandidates(sizeTableCand);
238+
reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand);
239+
reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand);
240+
reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand);
241+
reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand);
242+
reserveTable(rowCandidateId, fillCandidateId, sizeTableCand);
243+
if constexpr (IsMc) {
244+
reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand);
245+
}
234246
for (const auto& collision : collisions) {
235-
auto thisCollId = collision.globalIndex();
236-
auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME
237-
auto sizeTableCand = candidatesThisColl.size();
238-
LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand);
247+
const auto thisCollId = collision.globalIndex();
248+
const auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME
249+
const auto sizeTableCandThisColl = candidatesThisColl.size();
250+
LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCandThisColl);
239251
// Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions)
240252
bool mcCollisionHasMcParticles{false};
241253
if constexpr (IsMc) {
242254
mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()];
243255
LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no");
244256
}
245-
if (sizeTableCand == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) {
257+
if (sizeTableCandThisColl == 0 && (!confDerData.fillMcRCollId || !mcCollisionHasMcParticles)) {
246258
LOGF(debug, "Skipping rec. collision %d", thisCollId);
247259
continue;
248260
}
249261
LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1);
250262
rowsCommon.fillTablesCollision<IsMc>(collision);
251263

252264
// Fill candidate properties
253-
rowsCommon.reserveTablesCandidates(sizeTableCand);
254-
reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand);
255-
reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand);
256-
reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand);
257-
reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand);
258-
reserveTable(rowCandidateId, fillCandidateId, sizeTableCand);
259-
if constexpr (IsMc) {
260-
reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand);
261-
}
262265
int8_t flagMcRec = 0, origin = 0, swapping = 0, flagDecayChanRec = 0;
263266
for (const auto& candidate : candidatesThisColl) {
264267
if constexpr (IsMl) {

0 commit comments

Comments
 (0)