Skip to content
Snippets Groups Projects
Commit d11da396 authored by Dominik Smith's avatar Dominik Smith Committed by Dominik Smith
Browse files

Merged two std::vector::erase calls in cbm::tof::Clusterizer. Makes the algorithm a bit faster.

parent c0422ac6
No related branches found
No related tags found
1 merge request!1462Various small optimizations to online TOF code.
......@@ -231,9 +231,10 @@ namespace cbm::algo::tof
ROOT::Math::XYZVector pos(posX, posY, 0.);
cluster.add(pos, time, totSum, totSum, i1->second, i2->second);
// remove selected digis from pool
storDigi.erase(i2);
storDigi.erase(i1);
// remove digis at positions i1 and i2 from pool in efficient way (replaces two vector::erase calls).
std::copy(i1 + 1, i2, i1);
std::copy(i2 + 1, storDigi.end(), i2 - 1);
storDigi.resize(storDigi.size() - 2);
if (AddNextChan(input, chan, cluster, clustersOut)) {
return true; // signal hit was already added
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment