CbmRoot
Loading...
Searching...
No Matches
cbm::algo::sts::HitfinderChain Class Reference

#include <HitfinderChain.h>

Inheritance diagram for cbm::algo::sts::HitfinderChain:
[legend]
Collaboration diagram for cbm::algo::sts::HitfinderChain:
[legend]

Classes

struct  DigiMap
 
struct  Result
 

Public Member Functions

void SetParameters (const HitfinderChainPars &parameters)
 
const HitfinderChainParsGetParameters () const
 
void Finalize ()
 
Result operator() (gsl::span< const CbmStsDigi >, bool storeClusters=false)
 
const ChainContextGetContext ()
 
void SetContext (const ChainContext *ctx)
 
const OptionsOpts () const
 
const RecoParamsParams () 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::HitFlattenHits (xpu::queue)
 
PartitionedVector< sts::ClusterFlattenClusters (xpu::queue)
 
size_t GetNHits (xpu::h_view< PaddedToCacheLine< int > > nHitsPerModule, int module)
 Returns the number of hits of a module.
 
PartitionedSpan< sts::HitSplitHitsIntoStreams (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::HitfinderChainParsfPars
 
Hitfinder fHitfinder
 
std::vector< u32fAddresses
 
std::vector< size_t > fHitOffsets
 
std::vector< u32fStreamAddresses
 
std::vector< size_t > fHitStreamOffsets
 
const ChainContextfContext = nullptr
 

Static Private Attributes

static constexpr u16 InvalidModule = 0xFFFF
 

Detailed Description

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.

Member Function Documentation

◆ AllocateDynamic()

void sts::HitfinderChain::AllocateDynamic ( size_t maxNDigisPerModule,
size_t nDigisTotal )
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().

◆ AllocateStatic()

void sts::HitfinderChain::AllocateStatic ( )
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().

◆ CountDigisPerModules()

◆ EnsureChannelOffsets()

void sts::HitfinderChain::EnsureChannelOffsets ( gsl::span< u32 > channelOffsetsByModule)
private

Definition at line 778 of file HitfinderChain.cxx.

◆ EnsureClustersSane()

void sts::HitfinderChain::EnsureClustersSane ( gsl::span< ClusterIdx > hClusterIdx,
gsl::span< PaddedToCacheLine< int > > hNClusters )
private

Definition at line 821 of file HitfinderChain.cxx.

References L_.

◆ EnsureClustersSorted()

void cbm::algo::sts::HitfinderChain::EnsureClustersSorted ( )
private

◆ EnsureDigiOffsets()

void sts::HitfinderChain::EnsureDigiOffsets ( DigiMap & digi)
private

◆ EnsureDigisSorted()

void sts::HitfinderChain::EnsureDigisSorted ( )
private

Definition at line 743 of file HitfinderChain.cxx.

References L_.

◆ EnsureHitsSorted()

void sts::HitfinderChain::EnsureHitsSorted ( PartitionedSpan< sts::Hit > hits)
private

Definition at line 857 of file HitfinderChain.cxx.

References hits, and L_.

◆ EnsureParameters()

void sts::HitfinderChain::EnsureParameters ( )
private

Ensure parameters were set. Raises log(fatal) otherwise.

Definition at line 276 of file HitfinderChain.cxx.

◆ Finalize()

void sts::HitfinderChain::Finalize ( )

Teardown chain.

Definition at line 41 of file HitfinderChain.cxx.

◆ FlattenClusters()

PartitionedVector< sts::Cluster > sts::HitfinderChain::FlattenClusters ( xpu::queue queue)
private

Copy Clusters back to host into a flat array.

Definition at line 613 of file HitfinderChain.cxx.

References L_.

◆ FlattenDigis()

void sts::HitfinderChain::FlattenDigis ( gsl::span< const CbmStsDigi > digis,
DigiMap & digiMap )
private

◆ FlattenHits()

PartitionedSpan< sts::Hit > sts::HitfinderChain::FlattenHits ( xpu::queue queue)
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_.

◆ GetContext()

const ChainContext * cbm::algo::SubChain::GetContext ( )
inlineinherited

◆ GetMonitor()

◆ GetNHits()

size_t sts::HitfinderChain::GetNHits ( xpu::h_view< PaddedToCacheLine< int > > nHitsPerModule,
int module )
private

Returns the number of hits of a module.

Note
: Wrapper method required as buckets might overflow. This corrects for that.

Definition at line 650 of file HitfinderChain.cxx.

◆ GetParameters()

const HitfinderChainPars & cbm::algo::sts::HitfinderChain::GetParameters ( ) const
inline

Definition at line 56 of file HitfinderChain.h.

References fPars.

Referenced by CbmRecoSts::ForwardGpuClusterAndHits().

◆ HasMonitor()

◆ operator()()

◆ Opts()

◆ Params()

const RecoParams & cbm::algo::SubChain::Params ( ) const
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().

◆ SetContext()

void cbm::algo::SubChain::SetContext ( const ChainContext * ctx)
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().

◆ SetParameters()

void sts::HitfinderChain::SetParameters ( const HitfinderChainPars & parameters)

◆ SortHitsWithinPartition()

void sts::HitfinderChain::SortHitsWithinPartition ( PartitionedSpan< sts::Hit > hits)
private

Sort Hits by time in each partition.

Definition at line 714 of file HitfinderChain.cxx.

References CBM_PARALLEL_FOR, and hits.

◆ SplitHitsIntoStreams()

PartitionedSpan< sts::Hit > sts::HitfinderChain::SplitHitsIntoStreams ( PartitionedSpan< sts::Hit > hits,
int nstreamsMax )
private

Divide Hits into streams.

Parameters
hitsHits to sort. Expects one partition per sensor.
nstreamsMaxmax number of streams to create.
Note
: Creates 'nstreamsMax / nSensors' streams per sensor. Rounds down if nstreamsMax isn't divisble by nSensors. So fewer streams in total could be created.

Definition at line 655 of file HitfinderChain.cxx.

References hits, cbm::algo::PartitionedSpan< T >::NPartitions(), and x.

Member Data Documentation

◆ fAddresses

std::vector<u32> cbm::algo::sts::HitfinderChain::fAddresses
private

Definition at line 157 of file HitfinderChain.h.

◆ fContext

◆ fHitfinder

Hitfinder cbm::algo::sts::HitfinderChain::fHitfinder
private

Definition at line 154 of file HitfinderChain.h.

◆ fHitOffsets

std::vector<size_t> cbm::algo::sts::HitfinderChain::fHitOffsets
private

Definition at line 158 of file HitfinderChain.h.

◆ fHitStreamOffsets

std::vector<size_t> cbm::algo::sts::HitfinderChain::fHitStreamOffsets
private

Definition at line 160 of file HitfinderChain.h.

◆ fPars

std::optional<sts::HitfinderChainPars> cbm::algo::sts::HitfinderChain::fPars
private

Definition at line 152 of file HitfinderChain.h.

Referenced by GetParameters(), and SetParameters().

◆ fStreamAddresses

std::vector<u32> cbm::algo::sts::HitfinderChain::fStreamAddresses
private

Definition at line 159 of file HitfinderChain.h.

◆ InvalidModule

u16 cbm::algo::sts::HitfinderChain::InvalidModule = 0xFFFF
staticconstexprprivate

Definition at line 66 of file HitfinderChain.h.


The documentation for this class was generated from the following files: