diff --git a/algo/detectors/trd/Clusterizer.cxx b/algo/detectors/trd/Clusterizer.cxx index 3332d6d22168f84934fb01bf0bd260b725d91fec..962ed2fdd19ec5d2a705ec112f76bd80285fdb8d 100644 --- a/algo/detectors/trd/Clusterizer.cxx +++ b/algo/detectors/trd/Clusterizer.cxx @@ -78,6 +78,14 @@ namespace cbm::algo::trd bool sealtopcol = false; bool sealbotcol = false; + // already seal the cluster if the main trigger is already at the right or left padrow border + if (channel % ncols == ncols - 1) { + sealtopcol = true; + } + if (channel % ncols == 0) { + sealbotcol = true; + } + // //vector which contains the actual cluster std::vector<std::pair<int, const CbmTrdDigi*>> cluster; cluster.emplace_back(digiId, digi); @@ -93,7 +101,7 @@ namespace cbm::algo::trd const size_t oldSize = cluster.size(); const int col = channel % ncols; - if (col == ncols) sealtopcol = true; ///// Axel comment: change to ncols - 1, also for main!! + if (col == ncols - 1) sealtopcol = true; if (col == 0) sealbotcol = true; if (!sealbotcol && 0 <= lowcol - 1) { diff --git a/algo/detectors/trd/HitFinder.cxx b/algo/detectors/trd/HitFinder.cxx index 4faeaf608ea5fbfd854dc5322ed2c95975ffe52f..236dd779a95b357eb02cde7b4ae24d7748422ecb 100644 --- a/algo/detectors/trd/HitFinder.cxx +++ b/algo/detectors/trd/HitFinder.cxx @@ -175,6 +175,8 @@ namespace cbm::algo::trd { int colMin = fParams.rowPar[0].padPar.size(); //numCols int rowMin = fParams.rowPar.size(); //numRows + int colMax = 0; + int rowMax = 0; for (int i = 0; i < cluster->GetNofDigis(); ++i) { // const CbmTrdDigi* digi = CbmDigiManager::Instance()->Get<CbmTrdDigi>(cluster->GetDigi(i)); @@ -185,10 +187,12 @@ namespace cbm::algo::trd if (digiCol < colMin) colMin = digiCol; if (digiRow < rowMin) rowMin = digiRow; + if (digiCol > colMax) colMax = digiCol; + if (digiRow > rowMax) rowMax = digiRow; } - const uint16_t nCols = cluster->GetNCols(); - const uint16_t nRows = cluster->GetNRows(); + const uint16_t nCols = colMax - colMin + 1; + const uint16_t nRows = rowMax - rowMin + 1; CbmTrdDigi* digiMap[nRows][nCols]; //create array on stack for optimal performance memset(digiMap, 0, sizeof(CbmTrdDigi*) * nCols * nRows); //init with nullpointers