CbmRoot
|
#include <HitfinderChain.h>
Classes | |
struct | DigiMap |
struct | Result |
Public Member Functions | |
void | SetParameters (const HitfinderChainPars ¶meters) |
const HitfinderChainPars & | GetParameters () const |
void | Finalize () |
Result | operator() (gsl::span< const CbmStsDigi >, bool storeClusters=false) |
const ChainContext * | GetContext () |
void | SetContext (const ChainContext *ctx) |
const Options & | Opts () const |
const RecoParams & | Params () const |
bool | HasMonitor () const |
Monitor & | GetMonitor () const |
Private Member Functions | |
void | EnsureParameters () |
void | AllocateStatic () |
void | AllocateDynamic (size_t, size_t) |
DigiMap | CountDigisPerModules (gsl::span< const CbmStsDigi > digis) |
void | FlattenDigis (gsl::span< const CbmStsDigi > digis, DigiMap &digiMap) |
PartitionedSpan< sts::Hit > | FlattenHits (xpu::queue) |
PartitionedVector< sts::Cluster > | FlattenClusters (xpu::queue) |
size_t | GetNHits (xpu::h_view< PaddedToCacheLine< int > > nHitsPerModule, int module) |
Returns the number of hits of a module. | |
PartitionedSpan< sts::Hit > | SplitHitsIntoStreams (PartitionedSpan< sts::Hit > hits, int nstreamsMax) |
void | SortHitsWithinPartition (PartitionedSpan< sts::Hit > hits) |
void | EnsureDigiOffsets (DigiMap &) |
void | EnsureDigisSorted () |
void | EnsureChannelOffsets (gsl::span< u32 >) |
void | EnsureClustersSane (gsl::span< ClusterIdx >, gsl::span< PaddedToCacheLine< int > >) |
void | EnsureClustersSorted () |
void | EnsureHitsSorted (PartitionedSpan< sts::Hit >) |
Private Attributes | |
std::optional< sts::HitfinderChainPars > | fPars |
Hitfinder | fHitfinder |
std::vector< u32 > | fAddresses |
std::vector< size_t > | fHitOffsets |
std::vector< u32 > | fStreamAddresses |
std::vector< size_t > | fHitStreamOffsets |
const ChainContext * | fContext = nullptr |
Static Private Attributes | |
static constexpr u16 | InvalidModule = 0xFFFF |
Sts Hitfinder Chain. This class is responsible for all memory allocations on the GPU required by the hitfinder. It executes the hitfinder kernels and handles memory transfer for input / output data and conversion to the regular CBM STS types.
Definition at line 46 of file HitfinderChain.h.
|
private |
Allocate memory that depends on input Data stays on GPU until next timeslice is processed
Definition at line 344 of file HitfinderChain.cxx.
References L_.
Referenced by SetParameters().
|
private |
Allocate memory that doesn't depend on input Data stays on GPU for the entire duration the hitfinder is alive
Definition at line 281 of file HitfinderChain.cxx.
Referenced by SetParameters().
|
private |
Count Digis per module.
Definition at line 397 of file HitfinderChain.cxx.
References cbm::algo::sts::HitfinderChain::DigiMap::addrToIndex, CBM_OMP, CBM_PARALLEL, cbm::algo::openmp::GetMaxThreads(), cbm::algo::openmp::GetThreadNum(), L_, cbm::algo::sts::HitfinderChain::DigiMap::maxNDigisPerModule, cbm::algo::sts::HitfinderChain::DigiMap::ModuleIndex(), cbm::algo::sts::HitfinderChain::DigiMap::nDigisPerModule, cbm::algo::sts::HitfinderChain::DigiMap::nDigisPerThread, CbmStsAddress::PackDigiAddress(), and v.
|
private |
Definition at line 778 of file HitfinderChain.cxx.
|
private |
Definition at line 821 of file HitfinderChain.cxx.
References L_.
|
private |
|
private |
Definition at line 723 of file HitfinderChain.cxx.
References cbm::algo::sts::HitfinderChain::DigiMap::nDigisPerModule.
|
private |
Definition at line 743 of file HitfinderChain.cxx.
References L_.
|
private |
Definition at line 857 of file HitfinderChain.cxx.
|
private |
Ensure parameters were set. Raises log(fatal) otherwise.
Definition at line 276 of file HitfinderChain.cxx.
void sts::HitfinderChain::Finalize | ( | ) |
Teardown chain.
Definition at line 41 of file HitfinderChain.cxx.
|
private |
Copy Clusters back to host into a flat array.
Definition at line 613 of file HitfinderChain.cxx.
References L_.
|
private |
Copy Digis into flat array that can be copied to the GPU.
Definition at line 475 of file HitfinderChain.cxx.
References CBM_OMP, CBM_PARALLEL, CBM_PARALLEL_FOR, cbm::algo::openmp::GetMaxThreads(), cbm::algo::openmp::GetThreadNum(), L_, cbm::algo::sts::HitfinderChain::DigiMap::ModuleIndex(), cbm::algo::sts::HitfinderChain::DigiMap::nDigisPerModule, cbm::algo::sts::HitfinderChain::DigiMap::nDigisPerThread, and v.
|
private |
Copy Hits back to host into a flat array.
Definition at line 539 of file HitfinderChain.cxx.
References CBM_PARALLEL_FOR, hits, and L_.
|
inlineinherited |
Definition at line 16 of file SubChain.h.
References cbm::algo::SubChain::fContext.
Referenced by cbm::algo::tof::TrackingInterface::Init(), and cbm::algo::TrackingSetup::Init().
|
inlineinherited |
Definition at line 25 of file SubChain.h.
References cbm::algo::SubChain::fContext, and cbm::algo::SubChain::HasMonitor().
Referenced by cbm::algo::Reco::QueueEvbuildMetrics(), cbm::algo::Reco::QueueProcessingExtraMetrics(), cbm::algo::Reco::QueueProcessingMetrics(), cbm::algo::Reco::QueueStsRecoMetrics(), cbm::algo::Reco::QueueTofCalibMetrics(), cbm::algo::Reco::QueueTofRecoMetrics(), cbm::algo::Reco::QueueTrackingMetrics(), cbm::algo::Reco::QueueTrdRecoMetrics(), and cbm::algo::Reco::QueueUnpackerMetricsDet().
|
private |
Returns the number of hits of a module.
Definition at line 650 of file HitfinderChain.cxx.
|
inline |
Definition at line 56 of file HitfinderChain.h.
References fPars.
Referenced by CbmRecoSts::ForwardGpuClusterAndHits().
|
inlineinherited |
Definition at line 23 of file SubChain.h.
References cbm::algo::SubChain::fContext.
Referenced by cbm::algo::SubChain::GetMonitor(), cbm::algo::Reco::QueueEvbuildMetrics(), cbm::algo::Reco::QueueProcessingExtraMetrics(), cbm::algo::Reco::QueueProcessingMetrics(), cbm::algo::Reco::QueueStsRecoMetrics(), cbm::algo::Reco::QueueTofCalibMetrics(), cbm::algo::Reco::QueueTofRecoMetrics(), cbm::algo::Reco::QueueTrackingMetrics(), cbm::algo::Reco::QueueTrdRecoMetrics(), and cbm::algo::Reco::QueueUnpackerMetricsDet().
sts::HitfinderChain::Result sts::HitfinderChain::operator() | ( | gsl::span< const CbmStsDigi > | digis, |
bool | storeClusters = false ) |
Definition at line 49 of file HitfinderChain.cxx.
References cbm::algo::sts::HitfinderChain::Result::clusters, cbm::algo::sts::HitfinderChain::Result::hits, hits, cbm::algo::kFindHitsChunksPerModule, L_, cbm::algo::sts::HitfinderChain::DigiMap::maxNDigisPerModule, cbm::algo::sts::HitfinderChain::Result::monitor, cbm::algo::sts::HitfinderMon::nClusterTotal, cbm::algo::sts::HitfinderMon::nHitsTotal, and cbm::algo::sts::HitfinderMon::SetDeviceMon().
|
inlineinherited |
Definition at line 20 of file SubChain.h.
References cbm::algo::SubChain::fContext.
Referenced by cbm::algo::Reco::Finalize(), cbm::algo::Reco::Init(), cbm::algo::tof::TrackingInterface::Init(), cbm::algo::TrackingChain::Init(), cbm::algo::Reco::PrintTimings(), cbm::algo::Reco::QueueEvbuildMetrics(), cbm::algo::Reco::QueueProcessingExtraMetrics(), cbm::algo::Reco::QueueProcessingMetrics(), cbm::algo::Reco::QueueStsRecoMetrics(), cbm::algo::Reco::QueueTofCalibMetrics(), cbm::algo::Reco::QueueTofRecoMetrics(), cbm::algo::Reco::QueueTrackingMetrics(), cbm::algo::Reco::QueueTrdRecoMetrics(), cbm::algo::Reco::QueueUnpackerMetricsDet(), and cbm::algo::Reco::Run().
|
inlineinherited |
Definition at line 21 of file SubChain.h.
References cbm::algo::SubChain::fContext.
Referenced by cbm::algo::Reco::Init(), and cbm::algo::Reco::Run().
|
inlineinherited |
Definition at line 18 of file SubChain.h.
References cbm::algo::SubChain::fContext.
Referenced by cbm::algo::Reco::Init(), and cbm::algo::TrackingSetup::Init().
void sts::HitfinderChain::SetParameters | ( | const HitfinderChainPars & | parameters | ) |
Definition at line 16 of file HitfinderChain.cxx.
References AllocateDynamic(), AllocateStatic(), cbm::algo::RecoParams::Dynamic, fPars, cbm::algo::RecoParams::Static, and cbm::algo::ToString().
Referenced by CbmRecoSts::CreateModules().
|
private |
Sort Hits by time in each partition.
Definition at line 714 of file HitfinderChain.cxx.
References CBM_PARALLEL_FOR, and hits.
|
private |
Divide Hits into streams.
hits | Hits to sort. Expects one partition per sensor. |
nstreamsMax | max number of streams to create. |
Definition at line 655 of file HitfinderChain.cxx.
References hits, cbm::algo::PartitionedSpan< T >::NPartitions(), and x.
|
private |
Definition at line 157 of file HitfinderChain.h.
|
privateinherited |
Definition at line 34 of file SubChain.h.
Referenced by cbm::algo::SubChain::GetContext(), cbm::algo::SubChain::GetMonitor(), cbm::algo::SubChain::HasMonitor(), cbm::algo::SubChain::Opts(), cbm::algo::SubChain::Params(), and cbm::algo::SubChain::SetContext().
|
private |
Definition at line 154 of file HitfinderChain.h.
|
private |
Definition at line 158 of file HitfinderChain.h.
|
private |
Definition at line 160 of file HitfinderChain.h.
|
private |
Definition at line 152 of file HitfinderChain.h.
Referenced by GetParameters(), and SetParameters().
|
private |
Definition at line 159 of file HitfinderChain.h.
|
staticconstexprprivate |
Definition at line 66 of file HitfinderChain.h.