diff --git a/algo/detectors/sts/Hitfinder.h b/algo/detectors/sts/Hitfinder.h index b7ef99499e7a39b5567d30b9648b866b7a048488..af0d6ac765473ece86662bc416810a1f8de59abc 100644 --- a/algo/detectors/sts/Hitfinder.h +++ b/algo/detectors/sts/Hitfinder.h @@ -108,6 +108,7 @@ namespace cbm::algo::sts using block_size = xpu::block_size<kFindHitsBlockSize>; using constants = xpu::cmem<TheHitfinder, Params>; using context = xpu::kernel_context<shared_memory, constants>; + using openmp = xpu::openmp_settings<xpu::schedule_dynamic, 128>; XPU_D void operator()(context&); }; diff --git a/algo/detectors/sts/HitfinderChain.cxx b/algo/detectors/sts/HitfinderChain.cxx index 27b6930658c6b9241fe9083eb90a670ad1fe688b..a2dcbbc3d55a1e7ec6283095e499e654044b358e 100644 --- a/algo/detectors/sts/HitfinderChain.cxx +++ b/algo/detectors/sts/HitfinderChain.cxx @@ -234,10 +234,13 @@ sts::HitfinderChain::Result sts::HitfinderChain::operator()(gsl::span<const CbmS << " hits were discarded!"; for (size_t m = 0; m < nModules; m++) { - if (static_cast<size_t>(nHits[m]) > hfc.maxHitsPerModule) { - L_(error) << "STS Hitfinder Chain: Hit bucket overflow in module " << m << " with " << *nHits[m] << " (of " - << hfc.maxHitsPerModule << " max)" - << " hits!"; + const size_t nHitsModule = nHits[m]; + const size_t nClustersModule = nClusters[m]; + const float hitsPerCluster = nClustersModule > 0 ? nHitsModule / float(nClustersModule) : 0; + if (nHitsModule > hfc.maxHitsPerModule) { + L_(error) << "STS Hitfinder Chain: Hit bucket overflow in module " << m << " with " << nHitsModule << " (of " + << hfc.maxHitsPerModule << " max) hits! " + << "Module has " << nClustersModule << " clusters. " << hitsPerCluster << " hits per cluster."; nHits[m] = hfc.maxHitsPerModule; } } @@ -249,8 +252,8 @@ sts::HitfinderChain::Result sts::HitfinderChain::operator()(gsl::span<const CbmS size_t nHitsTotal = std::accumulate(nHits.begin(), nHits.end(), 0); L_(info) << "Timeslice contains " << nHitsTotal << " STS hits and " << nClustersTotal << " STS clusters"; - result.hits = std::move(hits); - result.clusters = std::move(clusters); + result.hits = std::move(hits); + result.clusters = std::move(clusters); result.monitor.nClusterTotal = nClustersTotal; result.monitor.nHitsTotal = result.hits.NElements(); result.monitor.SetDeviceMon(monitor[0]); @@ -336,6 +339,9 @@ void sts::HitfinderChain::AllocateDynamic(size_t maxNDigisPerModule, size_t nDig // TODO: some of these buffers have a constant size and can be allocated statically. // Just the data they contain is static. + fPars->memory.maxNDigisPerModule = maxNDigisPerModule; + fPars->memory.maxNDigisPerTS = nDigisTotal; + // Shorthands for common constants const int nChannels = fPars->setup.nChannels / 2; // Only count channels on one side of the module const int nModules = fPars->setup.modules.size(); @@ -418,6 +424,8 @@ sts::HitfinderChain::DigiMap sts::HitfinderChain::CountDigisPerModules(gsl::span u16 moduleIndex = digiMap.ModuleIndex(digi); if (moduleIndex == InvalidModule) continue; + // if (moduleIndex == InvalidModule || digi.GetAddress() == 0x10000002) continue; + bool isFront = digi.GetChannel() < nChannelsPerSide; nDigis[moduleIndex + (isFront ? 0 : nModules)]++; diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 58ca0dcfbf411543f75c4ca186eddb105c51a6a7..15fee5f0d73dea12223ab6d667ef381b1aecb080 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -53,7 +53,7 @@ if(DOWNLOAD_EXTERNALS) if (NOT ${CBM_XPU_DEV}) download_project_if_needed(PROJECT xpu GIT_REPOSITORY "https://github.com/fweig/xpu.git" - GIT_TAG "5d00ebf33a33334bf6631aef6b545a2759f46816" # 2024-02-05 + GIT_TAG "f444797545b010923688dcb364003b3e4e1e2275" # 2024-05-02 SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xpu CONFIGURE_COMMAND "" BUILD_COMMAND ""