@@ -416,20 +416,21 @@ struct HfTaskCorrelationsEfficiencies {
416416 }
417417 int assTrkOrigin = mcParticle.isPhysicalPrimary () ? 0 : 1 ; // 0 for primary, 1 for secondary
418418
419- std::vector<double > values = {assTrk .pt (), assTrk .eta (), assTrk .phi (), mcCollision.posZ (), static_cast <double >(matchedSpecie), static_cast <double >(assTrkOrigin)};
419+ std::vector<double > values = {mcParticle .pt (), mcParticle .eta (), mcParticle .phi (), mcCollision.posZ (), static_cast <double >(matchedSpecie), static_cast <double >(assTrkOrigin)};
420420
421421 // Fill histograms for associated tracks
422422 registry.get <THnSparse>(HIST (" hAssTrackReco" ))->Fill (values.data ());
423423
424424 if (fillRecoTrees) {
425425 // Downsample tracks based on pt
426426 if (downSampleTracks < 1 .) {
427- float const pseudoRndm = assTrk.pt () * 1000 . - static_cast <int64_t >(assTrk.pt () * 1000 );
428- if (assTrk.pt () < ptMaxDownSampleTracks && pseudoRndm >= downSampleTracks) {
427+ // Generate a pseudo-random number between 0 and 1
428+ float const pseudoRndm = mcParticle.pt () * 1000 . - static_cast <int64_t >(mcParticle.pt () * 1000 );
429+ if (mcParticle.pt () < ptMaxDownSampleTracks && pseudoRndm >= downSampleTracks) {
429430 continue ;
430431 }
431432 }
432- rowAssocMc (assTrk .pt (), assTrk .eta (), assTrk .phi (), mcCollision.posZ (), matchedSpecie, assTrkOrigin);
433+ rowAssocMc (mcParticle .pt (), mcParticle .eta (), mcParticle .phi (), mcCollision.posZ (), matchedSpecie, assTrkOrigin);
433434 rowAssocTrkSels (assTrk.tpcNClsCrossedRows (), assTrk.itsClusterMap (), assTrk.itsNCls (), assTrk.dcaXY (), assTrk.dcaZ ());
434435 }
435436 }
0 commit comments