diff --git a/algo/detectors/tof/Clusterizer.cxx b/algo/detectors/tof/Clusterizer.cxx index 1ad2d527e1cc31096a3af7bdad9713e0a547158c..312cc160e54e46e64dc48cad1667da507f44bfba 100644 --- a/algo/detectors/tof/Clusterizer.cxx +++ b/algo/detectors/tof/Clusterizer.cxx @@ -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;