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

Small improvements to cbm::algo::tof::Clusterizer.

parent 1184b1f3
No related branches found
No related tags found
1 merge request!1496Small improvements to cbm::algo::tof::Clusterizer.
Pipeline #25634 passed
......@@ -54,10 +54,7 @@ namespace cbm::algo::tof
// Output variables
resultType result;
std::vector<Hit>& clustersOut = std::get<0>(result); // Hits
std::vector<size_t>& chanSizes = std::get<1>(result); // nClusters per channel
std::vector<u32>& chanAddresses = std::get<2>(result); // channel addresses
std::vector<int32_t>& digiIndRef = std::get<3>(result); // digi indices of clusters
auto& [clustersOut, chanSizes, chanAddresses, digiIndRef] = result;
// Reference cell of a cluster
TofCell* cell = nullptr;
......@@ -81,8 +78,11 @@ namespace cbm::algo::tof
chanSizes.push_back(clustersOut.size());
chanAddresses.push_back(fParams.fChanPar[chan].address);
if (fParams.fDeadStrips & (1 << chan)) { continue; } // skip over dead channels
// skip over dead channels
if (fParams.fDeadStrips & (1 << chan)) {
chanSizes.back() = 0;
continue;
}
inputType& storDigi = input[chan];
auto digiIt = storDigi.begin();
......@@ -102,7 +102,7 @@ namespace cbm::algo::tof
// use local coordinates, (0,0,0) is in the center of counter ?
ROOT::Math::XYZVector pos(((-(double) numChan / 2. + (double) chan) + 0.5) * cell->sizeX, 0., 0.);
double timeDif = xDigiA->GetTime() - xDigiB->GetTime();
const double timeDif = xDigiA->GetTime() - xDigiB->GetTime();
pos.SetY(fParams.fSigVel * timeDif * 0.5); // A is the top side, B is the bottom side
if (xDigiA->GetSide() != 1.) { pos.SetY(-pos.Y()); } // B is the bottom side, A is the top side
......@@ -132,10 +132,10 @@ namespace cbm::algo::tof
continue;
}
// The "Strip" time is the mean time between each end
double time = 0.5 * (xDigiA->GetTime() + xDigiB->GetTime());
const double time = 0.5 * (xDigiA->GetTime() + xDigiB->GetTime());
// Weight is the total charge => sum of both ends ToT
double totSum = xDigiA->GetTot() + xDigiB->GetTot();
const double totSum = xDigiA->GetTot() + xDigiB->GetTot();
// Now check if a hit/cluster is already started
if (0 < cluster.numChan()) {
......@@ -154,7 +154,6 @@ namespace cbm::algo::tof
cluster.add(pos, time, totSum, totSum);
digiIndRef.push_back(digiIt->second);
digiIndRef.push_back(std::next(digiIt)->second);
digiIt += 2;
lastChan = chan;
......
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