Skip to content

Commit 2cae455

Browse files
abylinkinalibuild
andauthored
[PWGUD] SGCandProducer updated for proper BC in MC (#8406)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent c25bb5b commit 2cae455

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

PWGUD/TableProducer/SGCandProducer.cxx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ struct McSGCandProducer {
303303
{}};
304304

305305
template <typename TMcCollision>
306-
void updateUDMcCollisions(TMcCollision const& mccol)
306+
void updateUDMcCollisions(TMcCollision const& mccol, uint64_t globBC)
307307
{
308308
// save mccol
309-
outputMcCollisions(mccol.bcId(),
309+
outputMcCollisions(globBC,
310310
mccol.generatorsID(),
311311
mccol.posX(),
312312
mccol.posY(),
@@ -504,6 +504,9 @@ struct McSGCandProducer {
504504
bool goon = !sgcandAtEnd || !mccolAtEnd;
505505
int counter = 0;
506506
while (goon) {
507+
auto bcIter = mccol.bc_as<BCs>();
508+
uint64_t globBC = bcIter.globalBC();
509+
// uint64_t globBC = 0;
507510
// check if dgcand has an associated McCollision
508511
if (sgcand.has_collision()) {
509512
auto sgcandCol = sgcand.collision_as<CCs>();
@@ -538,7 +541,7 @@ struct McSGCandProducer {
538541
LOGF(info, " Saving McCollision %d", mcsgId);
539542
// update UDMcCollisions
540543
auto sgcandMcCol = sgcand.collision_as<CCs>().mcCollision();
541-
updateUDMcCollisions(sgcandMcCol);
544+
updateUDMcCollisions(sgcandMcCol, globBC);
542545
mcColIsSaved[mcsgId] = outputMcCollisions.lastIndex();
543546
}
544547

@@ -593,7 +596,7 @@ struct McSGCandProducer {
593596
if (mcColIsSaved.find(mccolId) == mcColIsSaved.end()) {
594597
LOGF(info, " Saving McCollision %d", mccolId);
595598
// update UDMcCollisions
596-
updateUDMcCollisions(mccol);
599+
updateUDMcCollisions(mccol, globBC);
597600
mcColIsSaved[mccolId] = outputMcCollisions.lastIndex();
598601

599602
// update UDMcParticles

0 commit comments

Comments
 (0)