Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion PWGMM/Mult/TableProducer/particles2tracks.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,28 @@ struct ParticlesToTracks {

void process(aod::McParticles const& particles)
{
if (doprocessIndexingCentral) {
if (doprocessIndexingCentral || doprocessIndexingCentralFast) {
p2t.reserve(particles.size());
}
if (doprocessIndexingFwd) {
p2tmft.reserve(particles.size());
}
}

void processIndexingCentralFast(aod::McParticles const& mcParticles, LabeledTracks const& tracks)
{
// faster version, but will use more memory due to pre-allocation
std::vector<std::vector<int>> part2track(mcParticles.size());
for (auto& track : tracks) {
if (track.has_mcParticle())
part2track[track.mcParticleId()].push_back(track.globalIndex());
}
for (auto& mcParticle : mcParticles) {
p2t(part2track[mcParticle.globalIndex()]);
}
}
PROCESS_SWITCH(ParticlesToTracks, processIndexingCentralFast, "Create reverse index from particles to tracks: more memory use but potentially faster", false);

void processIndexingCentral(aod::McParticle const&, soa::SmallGroups<LabeledTracks> const& tracks)
{
trackIds.clear();
Expand Down