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
 
MonitorGetMonitor () 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 346 of file HitfinderChain.cxx.

References EnsureParameters(), fHitfinder, fPars, and L_.

Referenced by operator()(), and 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 283 of file HitfinderChain.cxx.

References EnsureParameters(), fHitfinder, and fPars.

Referenced by SetParameters().

◆ CountDigisPerModules()

◆ EnsureChannelOffsets()

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

Definition at line 780 of file HitfinderChain.cxx.

References fHitfinder, and fPars.

Referenced by operator()().

◆ EnsureClustersSane()

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

Definition at line 823 of file HitfinderChain.cxx.

References fHitfinder, fPars, and L_.

Referenced by operator()().

◆ 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 745 of file HitfinderChain.cxx.

References fHitfinder, fPars, and L_.

Referenced by operator()().

◆ EnsureHitsSorted()

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

Definition at line 859 of file HitfinderChain.cxx.

References hits, and L_.

Referenced by operator()().

◆ EnsureParameters()

void sts::HitfinderChain::EnsureParameters ( )
private

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

Definition at line 278 of file HitfinderChain.cxx.

References fPars.

Referenced by AllocateDynamic(), AllocateStatic(), and operator()().

◆ Finalize()

void sts::HitfinderChain::Finalize ( )

Teardown chain.

Definition at line 43 of file HitfinderChain.cxx.

References fHitfinder.

◆ FlattenClusters()

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

Copy Clusters back to host into a flat array.

Definition at line 615 of file HitfinderChain.cxx.

References fHitfinder, fPars, and L_.

Referenced by operator()().

◆ 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 541 of file HitfinderChain.cxx.

References CBM_PARALLEL_FOR, fAddresses, fHitfinder, fHitOffsets, fPars, GetNHits(), hits, and L_.

Referenced by operator()().

◆ GetContext()

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

Definition at line 16 of file SubChain.h.

References fContext.

◆ 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 652 of file HitfinderChain.cxx.

References fHitfinder.

Referenced by FlattenHits().

◆ GetParameters()

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

Definition at line 56 of file HitfinderChain.h.

References fPars.

◆ HasMonitor()

◆ operator()()

◆ Opts()

◆ Params()

const RecoParams & cbm::algo::SubChain::Params ( ) const
inlineinherited

◆ SetContext()

void cbm::algo::SubChain::SetContext ( const ChainContext * ctx)
inlineinherited

Definition at line 18 of file SubChain.h.

References fContext.

Referenced by cbm::algo::Reco::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 716 of file HitfinderChain.cxx.

References CBM_PARALLEL_FOR, and hits.

Referenced by operator()().

◆ 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 657 of file HitfinderChain.cxx.

References fHitStreamOffsets, fStreamAddresses, hits, and x.

Referenced by operator()().

Member Data Documentation

◆ fAddresses

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

Definition at line 157 of file HitfinderChain.h.

Referenced by FlattenHits().

◆ fContext

const ChainContext* cbm::algo::SubChain::fContext = nullptr
privateinherited

Definition at line 34 of file SubChain.h.

Referenced by GetContext(), GetMonitor(), HasMonitor(), Opts(), Params(), and SetContext().

◆ fHitfinder

◆ fHitOffsets

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

Definition at line 158 of file HitfinderChain.h.

Referenced by FlattenHits().

◆ fHitStreamOffsets

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

Definition at line 160 of file HitfinderChain.h.

Referenced by SplitHitsIntoStreams().

◆ fPars

◆ fStreamAddresses

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

Definition at line 159 of file HitfinderChain.h.

Referenced by SplitHitsIntoStreams().

◆ InvalidModule

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

Definition at line 66 of file HitfinderChain.h.

Referenced by CountDigisPerModules(), and FlattenDigis().


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