@@ -293,7 +293,7 @@ struct HfTreeCreatorDplusToPiKPi {
293293 }
294294
295295 template <bool doMc = false , bool doMl = false , typename T>
296- void fillCandidateTable (const T& candidate, float cent )
296+ void fillCandidateTable (const T& candidate)
297297 {
298298 int8_t flagMc = 0 ;
299299 int8_t originMc = 0 ;
@@ -317,6 +317,7 @@ struct HfTreeCreatorDplusToPiKPi {
317317 auto prong0 = candidate.template prong0_as <TracksWPid>();
318318 auto prong1 = candidate.template prong1_as <TracksWPid>();
319319 auto prong2 = candidate.template prong2_as <TracksWPid>();
320+ auto coll = candidate.template collision_as <CollisionsCent>();
320321
321322 if (fillCandidateLiteTable) {
322323 rowCandidateLite (
@@ -361,14 +362,14 @@ struct HfTreeCreatorDplusToPiKPi {
361362 candidate.eta (),
362363 candidate.phi (),
363364 hfHelper.yDplus (candidate),
364- cent ,
365+ getCentralityColl (coll, CentralityEstimator::FT0C) ,
365366 flagMc,
366367 originMc,
367368 channelMc);
368369 } else {
369370 rowCandidateFull (
370- candidate. collision () .bcId (),
371- candidate. collision () .numContrib (),
371+ coll .bcId (),
372+ coll .numContrib (),
372373 candidate.posX (),
373374 candidate.posY (),
374375 candidate.posZ (),
@@ -443,7 +444,7 @@ struct HfTreeCreatorDplusToPiKPi {
443444 candidate.phi (),
444445 hfHelper.yDplus (candidate),
445446 hfHelper.eDplus (candidate),
446- cent ,
447+ getCentralityColl (coll, CentralityEstimator::FT0C) ,
447448 flagMc,
448449 originMc,
449450 channelMc);
@@ -473,15 +474,13 @@ struct HfTreeCreatorDplusToPiKPi {
473474 continue ;
474475 }
475476 }
476- auto coll = candidate.template collision_as <CollisionsCent>();
477- float cent = getCentralityColl (coll, CentralityEstimator::FT0C);
478- fillCandidateTable (candidate, cent);
477+ fillCandidateTable (candidate);
479478 }
480479 }
481480
482481 PROCESS_SWITCH (HfTreeCreatorDplusToPiKPi, processData, " Process data" , true );
483482
484- void processMc (McRecoCollisionsCent const & collisions,
483+ void processMc (CollisionsCent const & collisions,
485484 aod::McCollisions const &,
486485 SelectedCandidatesMc const & candidates,
487486 MatchedGenCandidatesMc const & particles,
@@ -502,9 +501,7 @@ struct HfTreeCreatorDplusToPiKPi {
502501 rowCandidateFull.reserve (reconstructedCandSig.size ());
503502 }
504503 for (const auto & candidate : reconstructedCandSig) {
505- auto coll = candidate.template collision_as <McRecoCollisionsCent>();
506- float cent = getCentralityColl (coll, CentralityEstimator::FT0C);
507- fillCandidateTable<true >(candidate, cent);
504+ fillCandidateTable<true >(candidate);
508505 }
509506 } else if (fillOnlySignalMl) {
510507 rowCandidateMl.reserve (reconstructedCandSigMl.size ());
@@ -520,9 +517,7 @@ struct HfTreeCreatorDplusToPiKPi {
520517 continue ;
521518 }
522519 }
523- auto coll = candidate.template collision_as <McRecoCollisionsCent>();
524- float cent = getCentralityColl (coll, CentralityEstimator::FT0C);
525- fillCandidateTable<true , true >(candidate, cent);
520+ fillCandidateTable<true , true >(candidate);
526521 }
527522 } else if (fillOnlyBackground) {
528523 if (fillCandidateLiteTable) {
@@ -537,9 +532,7 @@ struct HfTreeCreatorDplusToPiKPi {
537532 continue ;
538533 }
539534 }
540- auto coll = candidate.template collision_as <McRecoCollisionsCent>();
541- float cent = getCentralityColl (coll, CentralityEstimator::FT0C);
542- fillCandidateTable<true >(candidate, cent);
535+ fillCandidateTable<true >(candidate);
543536 }
544537 } else {
545538 if (fillCandidateLiteTable) {
@@ -548,9 +541,7 @@ struct HfTreeCreatorDplusToPiKPi {
548541 rowCandidateFull.reserve (candidates.size ());
549542 }
550543 for (const auto & candidate : candidates) {
551- auto coll = candidate.template collision_as <McRecoCollisionsCent>();
552- float cent = getCentralityColl (coll, CentralityEstimator::FT0C);
553- fillCandidateTable<true >(candidate, cent);
544+ fillCandidateTable<true >(candidate);
554545 }
555546 }
556547
0 commit comments