Skip to content
Snippets Groups Projects
Commit 18ea1a19 authored by Dominik Smith's avatar Dominik Smith Committed by Felix Weiglhofer
Browse files

cbm::algo::tof:Clusterizer: Performance optimizations.

parent 6e641866
No related branches found
No related tags found
1 merge request!1391Online-capable TOF hitfinder.
...@@ -144,6 +144,7 @@ namespace cbm::algo::tof ...@@ -144,6 +144,7 @@ namespace cbm::algo::tof
uint8_t offset = 0; uint8_t offset = 0;
/* D.Smith 14.8.23: This condition is never needed due to time-sorted input (check with PAL and VF) /* D.Smith 14.8.23: This condition is never needed due to time-sorted input (check with PAL and VF)
//D. Smith 8.9.23: Theoretically, this could matter for two digis with identical time stamp but different TOT. Can this even happen?
// use digi that is closer to the last one // use digi that is closer to the last one
if (storDigi.size() > 2 && storDigi[2].first->GetSide() != storDigi[0].first->GetSide() if (storDigi.size() > 2 && storDigi[2].first->GetSide() != storDigi[0].first->GetSide()
&& storDigi[2].first->GetTime() - storDigi[0].first->GetTime() && storDigi[2].first->GetTime() - storDigi[0].first->GetTime()
...@@ -151,6 +152,7 @@ namespace cbm::algo::tof ...@@ -151,6 +152,7 @@ namespace cbm::algo::tof
offset++; offset++;
} }
*/ */
storDigi.erase(storDigi.begin() + offset); storDigi.erase(storDigi.begin() + offset);
if (2 > storDigi.size()) { break; } if (2 > storDigi.size()) { break; }
} // same condition side end } // same condition side end
...@@ -258,7 +260,7 @@ namespace cbm::algo::tof ...@@ -258,7 +260,7 @@ namespace cbm::algo::tof
{ {
//D.Smith 25.8.23: Why are "C" digis (position "2") not considered here? //D.Smith 25.8.23: Why are "C" digis (position "2") not considered here?
//const int32_t iDetId = CbmTofAddress::GetUniqueAddress(iSm, iRpc, 0, 0, iSmType); //const int32_t iDetId = CbmTofAddress::GetUniqueAddress(iSm, iRpc, 0, 0, iSmType); //Kept for reference
size_t numChan = fParams.fChanPar.size(); size_t numChan = fParams.fChanPar.size();
int32_t chan = lastChan + 1; int32_t chan = lastChan + 1;
...@@ -276,6 +278,7 @@ namespace cbm::algo::tof ...@@ -276,6 +278,7 @@ namespace cbm::algo::tof
auto i2 = i1; auto i2 = i1;
//D.Smith 7.9.23: Do we really need to loop through all remaining digis? //D.Smith 7.9.23: Do we really need to loop through all remaining digis?
//Maybe break at i2 == i1 + 2 ? //Maybe break at i2 == i1 + 2 ?
//D.Smith 8.9.23: Adding the break condition below probably makes this redundant.
while (++i2 < storDigi.end()) { while (++i2 < storDigi.end()) {
const CbmTofDigi* xDigiA = i1->first; const CbmTofDigi* xDigiA = i1->first;
...@@ -284,7 +287,15 @@ namespace cbm::algo::tof ...@@ -284,7 +287,15 @@ namespace cbm::algo::tof
const double time = 0.5 * (xDigiA->GetTime() + xDigiB->GetTime()); const double time = 0.5 * (xDigiA->GetTime() + xDigiB->GetTime());
if (std::abs(time - cluster.weightedTime / cluster.weightsSum) >= fParams.fdMaxTimeDist) { continue; } //D.Smith 8.9.23: Original continue statement, in general much slower (replaced by the conditions below).
// The optimization relies on time-order.
//if (std::abs(time - cluster.weightedTime / cluster.weightsSum) >= fParams.fdMaxTimeDist) { continue; }
//Break if digis are in the future of cluster time
if (time - cluster.weightedTime / cluster.weightsSum >= fParams.fdMaxTimeDist) { break; }
//Continue if digis are in the past of cluster time
if (cluster.weightedTime / cluster.weightsSum - time >= fParams.fdMaxTimeDist) { continue; }
const double timeDif = xDigiA->GetTime() - xDigiB->GetTime(); const double timeDif = xDigiA->GetTime() - xDigiB->GetTime();
double posY = fParams.fSigVel * timeDif * 0.5; double posY = fParams.fSigVel * timeDif * 0.5;
......
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