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

#include <Hitfinder.h>

Collaboration diagram for cbm::algo::sts::Hitfinder:
[legend]

Public Member Functions

XPU_D void SortDigisInSpaceAndTime (SortDigis::context &) const
 
XPU_D void FindClustersSingleStep (FindClusters::context &) const
 
XPU_D void SortClusters (SortClusters::context &) const
 
XPU_D void FindHits (FindHits::context &) const
 
XPU_D void CalculateOffsetsParallel (FindClusters::context &) const
 
XPU_D void FindClustersParallel (FindClusters::context &) const
 
XPU_D void CalculateClustersParallel (FindClusters::context &) const
 

Public Attributes

int nModules
 
int nChannels
 
sts::HitfinderPars::Asic asic
 
int landauTableSize
 
float landauStepSize
 
xpu::buffer< float > landauTable
 
xpu::buffer< float > localToGlobalTranslationByModule
 
xpu::buffer< float > localToGlobalRotationByModule
 
xpu::buffer< SensorParsensorPars
 
xpu::buffer< HitfinderMonDevicemonitor
 
xpu::buffer< size_t > digiOffsetPerModule
 
xpu::buffer< CbmStsDigidigisPerModule
 
xpu::buffer< CbmStsDigidigisPerModuleTmp
 
xpu::buffer< DigiConnectordigiConnectorsPerModule
 
xpu::buffer< unsigned int > channelOffsetPerModule
 
size_t maxClustersPerModule
 
xpu::buffer< ClusterIdxclusterIdxPerModule
 
xpu::buffer< ClusterIdxclusterIdxPerModuleTmp
 
xpu::buffer< ClusterIdx * > clusterIdxSortedPerModule
 
xpu::buffer< sts::ClusterclusterDataPerModule
 
xpu::buffer< PaddedToCacheLine< int > > nClustersPerModule
 
xpu::buffer< PaddedToCacheLine< float > > maxClusterTimeErrorByModuleSide
 
size_t hitsAllocatedPerModule
 
size_t maxHitsPerModule
 
xpu::buffer< sts::HithitsPerModule
 
xpu::buffer< PaddedToCacheLine< int > > nHitsPerModule
 
size_t hitsFlatCapacity
 
xpu::buffer< sts::HithitsFlat
 

Private Member Functions

XPU_D void CalculateChannelOffsets (FindClusters::context &ctx, CbmStsDigi *digis, unsigned int *channelOffsets, unsigned int nDigis) const
 
XPU_D void FindClusterConnectionsDigiWise (FindClusters::context &ctx, CbmStsDigi *digis, DigiConnector *digiConnector, unsigned int *channelOffsets, unsigned int nDigis) const
 
XPU_D void CalculateClustersDigiWise (FindClusters::context &ctx, CbmStsDigi *digis, DigiConnector *digiConnector, unsigned int const nDigis) const
 
XPU_D void CreateClusterFromConnectors1 (int const iModule, const CbmStsDigi *digis, int const digiIndex) const
 
XPU_D void CreateClusterFromConnectors2 (int const iModule, const CbmStsDigi *digis, DigiConnector *digiConnector, int const digiIndex) const
 
XPU_D void CreateClusterFromConnectorsN (int const iModule, const CbmStsDigi *digis, DigiConnector *digiConnector, int const digiIndex) const
 
XPU_D unsigned int GetNDigis (int iModule) const
 
XPU_D float GetTimeResolution (int, int) const
 
XPU_D bool IsActive (int *channelStatus, int channel) const
 
XPU_D int ChanLeft (int channel) const
 
XPU_D int ChanRight (int channel) const
 
XPU_D int ChanDist (int c1, int c2) const
 
XPU_D void AddCluster (int iModule, uint32_t time, const sts::Cluster &cls) const
 
XPU_D bool IsBackside (int iModule) const
 
XPU_D float LandauWidth (float charge) const
 
XPU_D void ToGlobal (int iModule, float lx, float ly, float lz, float &gx, float &gy, float &gz) const
 
XPU_D void IntersectClusters (int iBlock, const HitfinderCache &pars, const ClusterIdx &idxF, const sts::Cluster &clsF, const ClusterIdx &idxB, const sts::Cluster &clsB) const
 
XPU_D float GetClusterPosition (const HitfinderCache &pars, float centre, bool isFront) const
 
XPU_D bool Intersect (const HitfinderCache &pars, float xF, float exF, float xB, float exB, float &x, float &y, float &varX, float &varY, float &varXY) const
 
XPU_D bool IsInside (const HitfinderCache &pars, float x, float y) const
 
XPU_D void CreateHit (int iBlocks, float xLocal, float yLocal, float varX, float varY, float varXY, const ClusterIdx &idxF, const Cluster &clsF, const ClusterIdx &idxB, const sts::Cluster &clsB, float du, float dv) const
 
XPU_D float GetTimeDiff (const CbmStsDigi &d1, const CbmStsDigi &d2) const
 
XPU_D float GetTimeDiff (const ClusterIdx &d1, const ClusterIdx &d2) const
 
XPU_D void SaveMaxError (float errorValue, int iModule) const
 

Detailed Description

Definition at line 198 of file Hitfinder.h.

Member Function Documentation

◆ AddCluster()

XPU_D void cbm::algo::sts::Hitfinder::AddCluster ( int iModule,
uint32_t time,
const sts::Cluster & cls ) const
inlineprivate

◆ CalculateChannelOffsets()

XPU_D void sts::Hitfinder::CalculateChannelOffsets ( FindClusters::context & ctx,
CbmStsDigi * digis,
unsigned int * channelOffsets,
unsigned int nDigis ) const
private

sts::Hitfinder::calculateChannelOffsets Calculates the Offsest of every channel. digis-Array is sorted in Channel and Time. If a channelChange is detected it is stored in channelOffsetsPerModule.

Parameters
digisAll Digis that are relevant for this Block
channelOffsetsThe Array where all offsets are written to
nDigisAmount of digis in digis-Array

Definition at line 92 of file Hitfinder.cxx.

References CbmStsDigi::GetChannel(), nChannels, and pos.

Referenced by CalculateOffsetsParallel().

◆ CalculateClustersDigiWise()

XPU_D void sts::Hitfinder::CalculateClustersDigiWise ( FindClusters::context & ctx,
CbmStsDigi * digis,
sts::DigiConnector * digiConnector,
unsigned int const nDigis ) const
private

sts::Hitfinder::calculateClustersDigiWise

Each Thread one Channel

ChannelId: 00000 11111 DigiIndex: 01234 56789 ThreadId: 01234 56789

Calculates the Clustercharges of all found ClusterConnections. Each Thread takes on digi and looks for connections. When the thread is done, it takes the next digi. If one Digi does not have a previous one it's a cluster start and may be the start of either a single-element-cluster, double-element-cluster or multi-element-cluster.

Parameters
digisAll Digis that are relevant for this Block
digiConnectorArray where the connection between 2 digis is sotred in.(next Digi; has Previous)
iModuleThe Module that the curren Block is working on
threadIdId of the thrad currently working

Definition at line 282 of file Hitfinder.cxx.

◆ CalculateClustersParallel()

XPU_D void sts::Hitfinder::CalculateClustersParallel ( FindClusters::context & ctx) const

sts::Hitfinder::calculateClustersParallel This function calculates clusters form an sts-Digi Array inserted. It runs the calculating process highly parallel.

Parameters
iBlockis the Block/Module that is currently worked on

Definition at line 218 of file Hitfinder.cxx.

References CreateClusterFromConnectors1(), CreateClusterFromConnectors2(), CreateClusterFromConnectorsN(), digiConnectorsPerModule, digiOffsetPerModule, digisPerModule, GetNDigis(), and nModules.

Referenced by FindClustersSingleStep().

◆ CalculateOffsetsParallel()

XPU_D void sts::Hitfinder::CalculateOffsetsParallel ( FindClusters::context & ctx) const

sts::Hitfinder::calculateOffsetsParallel This function calculates the channeloffsets in a certain module. An Offset is the Startingpoint of a Channel in a sorted array of Digis.

Parameters
iBlockis the Block/Module that is currently worked on

Definition at line 120 of file Hitfinder.cxx.

References CalculateChannelOffsets(), channelOffsetPerModule, digiOffsetPerModule, digisPerModule, GetNDigis(), and nChannels.

Referenced by FindClustersSingleStep().

◆ ChanDist()

XPU_D int cbm::algo::sts::Hitfinder::ChanDist ( int c1,
int c2 ) const
inlineprivate

Definition at line 350 of file Hitfinder.h.

Referenced by CreateClusterFromConnectorsN().

◆ ChanLeft()

XPU_D int cbm::algo::sts::Hitfinder::ChanLeft ( int channel) const
inlineprivate

Definition at line 346 of file Hitfinder.h.

◆ ChanRight()

XPU_D int cbm::algo::sts::Hitfinder::ChanRight ( int channel) const
inlineprivate

Definition at line 348 of file Hitfinder.h.

◆ CreateClusterFromConnectors1()

XPU_D void sts::Hitfinder::CreateClusterFromConnectors1 ( int const iModule,
const CbmStsDigi * digis,
int const digiIndex ) const
private

◆ CreateClusterFromConnectors2()

XPU_D void sts::Hitfinder::CreateClusterFromConnectors2 ( int const iModule,
const CbmStsDigi * digis,
sts::DigiConnector * digiConnector,
int const digiIndex ) const
private

◆ CreateClusterFromConnectorsN()

◆ CreateHit()

XPU_D void sts::Hitfinder::CreateHit ( int iBlocks,
float xLocal,
float yLocal,
float varX,
float varY,
float varXY,
const ClusterIdx & idxF,
const Cluster & clsF,
const ClusterIdx & idxB,
const sts::Cluster & clsB,
float du,
float dv ) const
private

◆ FindClusterConnectionsDigiWise()

XPU_D void cbm::algo::sts::Hitfinder::FindClusterConnectionsDigiWise ( FindClusters::context & ctx,
CbmStsDigi * digis,
DigiConnector * digiConnector,
unsigned int * channelOffsets,
unsigned int nDigis ) const
private

◆ FindClustersParallel()

XPU_D void sts::Hitfinder::FindClustersParallel ( FindClusters::context & ctx) const

sts::Hitfinder::findClustersParallel This function finds clusters form an sts-Digi Array inserted. It runs the finding process highly parallel.

Parameters
iBlockis the Block/Module that is currently worked on

Definition at line 141 of file Hitfinder.cxx.

References channelOffsetPerModule, digiConnectorsPerModule, digiOffsetPerModule, digisPerModule, CbmStsDigi::GetChannel(), GetNDigis(), GetTimeDiff(), GetTimeResolution(), nChannels, nModules, cbm::algo::RecoParams::STS::timeCutDigiAbs, and cbm::algo::RecoParams::STS::timeCutDigiSig.

Referenced by FindClustersSingleStep().

◆ FindClustersSingleStep()

XPU_D void sts::Hitfinder::FindClustersSingleStep ( FindClusters::context & ctx) const

◆ FindHits()

◆ GetClusterPosition()

XPU_D float sts::Hitfinder::GetClusterPosition ( const HitfinderCache & pars,
float centre,
bool isFront ) const
private

◆ GetNDigis()

XPU_D unsigned int cbm::algo::sts::Hitfinder::GetNDigis ( int iModule) const
inlineprivate

◆ GetTimeDiff() [1/2]

XPU_D float cbm::algo::sts::Hitfinder::GetTimeDiff ( const CbmStsDigi & d1,
const CbmStsDigi & d2 ) const
inlineprivate

Definition at line 390 of file Hitfinder.h.

References CbmStsDigi::GetTimeU32().

Referenced by FindClustersParallel(), and FindHits().

◆ GetTimeDiff() [2/2]

XPU_D float cbm::algo::sts::Hitfinder::GetTimeDiff ( const ClusterIdx & d1,
const ClusterIdx & d2 ) const
inlineprivate

Definition at line 397 of file Hitfinder.h.

References cbm::algo::sts::ClusterIdx::fTime.

◆ GetTimeResolution()

XPU_D float cbm::algo::sts::Hitfinder::GetTimeResolution ( int ,
int  ) const
inlineprivate

Definition at line 335 of file Hitfinder.h.

References asic.

Referenced by FindClustersParallel().

◆ Intersect()

XPU_D bool sts::Hitfinder::Intersect ( const HitfinderCache & pars,
float xF,
float exF,
float xB,
float exB,
float & x,
float & y,
float & varX,
float & varY,
float & varXY ) const
private

◆ IntersectClusters()

◆ IsActive()

XPU_D bool cbm::algo::sts::Hitfinder::IsActive ( int * channelStatus,
int channel ) const
inlineprivate

Definition at line 337 of file Hitfinder.h.

References nChannels.

◆ IsBackside()

XPU_D bool cbm::algo::sts::Hitfinder::IsBackside ( int iModule) const
inlineprivate

◆ IsInside()

XPU_D bool sts::Hitfinder::IsInside ( const HitfinderCache & pars,
float x,
float y ) const
private

Definition at line 819 of file Hitfinder.cxx.

References cbm::algo::sts::HitfinderCache::dX, cbm::algo::sts::SensorPar::dY, x, and y.

Referenced by Intersect().

◆ LandauWidth()

XPU_D float sts::Hitfinder::LandauWidth ( float charge) const
private

◆ SaveMaxError()

XPU_D void cbm::algo::sts::Hitfinder::SaveMaxError ( float errorValue,
int iModule ) const
inlineprivate

◆ SortClusters()

◆ SortDigisInSpaceAndTime()

XPU_D void sts::Hitfinder::SortDigisInSpaceAndTime ( SortDigis::context & ctx) const

sts::Hitfinder::sortDigisKhun Sorts digis channelwise. Inside a channel all digis are sorted in time.

Parameters
smemis the shared memory it is worked in
iBlockis the Block/Module that is currenty running

Definition at line 52 of file Hitfinder.cxx.

References digiOffsetPerModule, digisPerModule, digisPerModuleTmp, CbmStsDigi::GetChannel(), GetNDigis(), and CbmStsDigi::GetTimeU32().

◆ ToGlobal()

XPU_D void sts::Hitfinder::ToGlobal ( int iModule,
float lx,
float ly,
float lz,
float & gx,
float & gy,
float & gz ) const
private

Definition at line 889 of file Hitfinder.cxx.

References localToGlobalRotationByModule, and localToGlobalTranslationByModule.

Referenced by CreateHit().

Member Data Documentation

◆ asic

◆ channelOffsetPerModule

xpu::buffer<unsigned int> cbm::algo::sts::Hitfinder::channelOffsetPerModule

Definition at line 242 of file Hitfinder.h.

Referenced by CalculateOffsetsParallel(), and FindClustersParallel().

◆ clusterDataPerModule

xpu::buffer<sts::Cluster> cbm::algo::sts::Hitfinder::clusterDataPerModule

Definition at line 265 of file Hitfinder.h.

Referenced by AddCluster(), and FindHits().

◆ clusterIdxPerModule

xpu::buffer<ClusterIdx> cbm::algo::sts::Hitfinder::clusterIdxPerModule

Definition at line 251 of file Hitfinder.h.

Referenced by AddCluster(), and SortClusters().

◆ clusterIdxPerModuleTmp

xpu::buffer<ClusterIdx> cbm::algo::sts::Hitfinder::clusterIdxPerModuleTmp

Definition at line 255 of file Hitfinder.h.

Referenced by SortClusters().

◆ clusterIdxSortedPerModule

xpu::buffer<ClusterIdx*> cbm::algo::sts::Hitfinder::clusterIdxSortedPerModule

Definition at line 260 of file Hitfinder.h.

Referenced by FindHits(), and SortClusters().

◆ digiConnectorsPerModule

xpu::buffer<DigiConnector> cbm::algo::sts::Hitfinder::digiConnectorsPerModule

Definition at line 237 of file Hitfinder.h.

Referenced by CalculateClustersParallel(), and FindClustersParallel().

◆ digiOffsetPerModule

xpu::buffer<size_t> cbm::algo::sts::Hitfinder::digiOffsetPerModule

◆ digisPerModule

xpu::buffer<CbmStsDigi> cbm::algo::sts::Hitfinder::digisPerModule

◆ digisPerModuleTmp

xpu::buffer<CbmStsDigi> cbm::algo::sts::Hitfinder::digisPerModuleTmp

Definition at line 232 of file Hitfinder.h.

Referenced by SortDigisInSpaceAndTime().

◆ hitsAllocatedPerModule

size_t cbm::algo::sts::Hitfinder::hitsAllocatedPerModule

Definition at line 279 of file Hitfinder.h.

Referenced by CreateHit().

◆ hitsFlat

xpu::buffer<sts::Hit> cbm::algo::sts::Hitfinder::hitsFlat

Definition at line 299 of file Hitfinder.h.

◆ hitsFlatCapacity

size_t cbm::algo::sts::Hitfinder::hitsFlatCapacity

Definition at line 298 of file Hitfinder.h.

◆ hitsPerModule

xpu::buffer<sts::Hit> cbm::algo::sts::Hitfinder::hitsPerModule

Definition at line 290 of file Hitfinder.h.

Referenced by CreateHit().

◆ landauStepSize

float cbm::algo::sts::Hitfinder::landauStepSize

Definition at line 210 of file Hitfinder.h.

Referenced by LandauWidth().

◆ landauTable

xpu::buffer<float> cbm::algo::sts::Hitfinder::landauTable

Definition at line 212 of file Hitfinder.h.

Referenced by LandauWidth().

◆ landauTableSize

int cbm::algo::sts::Hitfinder::landauTableSize

Definition at line 209 of file Hitfinder.h.

Referenced by LandauWidth().

◆ localToGlobalRotationByModule

xpu::buffer<float> cbm::algo::sts::Hitfinder::localToGlobalRotationByModule

Definition at line 217 of file Hitfinder.h.

Referenced by ToGlobal().

◆ localToGlobalTranslationByModule

xpu::buffer<float> cbm::algo::sts::Hitfinder::localToGlobalTranslationByModule

Definition at line 216 of file Hitfinder.h.

Referenced by ToGlobal().

◆ maxClustersPerModule

size_t cbm::algo::sts::Hitfinder::maxClustersPerModule

Definition at line 245 of file Hitfinder.h.

Referenced by AddCluster(), FindHits(), and SortClusters().

◆ maxClusterTimeErrorByModuleSide

xpu::buffer<PaddedToCacheLine<float> > cbm::algo::sts::Hitfinder::maxClusterTimeErrorByModuleSide

Definition at line 274 of file Hitfinder.h.

Referenced by FindHits(), and SaveMaxError().

◆ maxHitsPerModule

size_t cbm::algo::sts::Hitfinder::maxHitsPerModule

Definition at line 285 of file Hitfinder.h.

Referenced by CreateHit(), and FindHits().

◆ monitor

xpu::buffer<HitfinderMonDevice> cbm::algo::sts::Hitfinder::monitor

Definition at line 224 of file Hitfinder.h.

Referenced by AddCluster(), and CreateHit().

◆ nChannels

◆ nClustersPerModule

xpu::buffer<PaddedToCacheLine<int> > cbm::algo::sts::Hitfinder::nClustersPerModule

Definition at line 270 of file Hitfinder.h.

Referenced by AddCluster(), FindHits(), and SortClusters().

◆ nHitsPerModule

xpu::buffer<PaddedToCacheLine<int> > cbm::algo::sts::Hitfinder::nHitsPerModule

Definition at line 295 of file Hitfinder.h.

Referenced by CreateHit(), and FindHits().

◆ nModules

int cbm::algo::sts::Hitfinder::nModules

◆ sensorPars

xpu::buffer<SensorPar> cbm::algo::sts::Hitfinder::sensorPars

Definition at line 221 of file Hitfinder.h.

Referenced by FindHits().


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