CbmRoot
Loading...
Searching...
No Matches
cbm::algo::ca::DataManager Class Reference

A manager for the input-output data of the CA tracking algorithm. More...

#include <CaDataManager.h>

Public Member Functions

 DataManager ()=default
 Default constructor.
 
 ~DataManager ()=default
 Destructor.
 
 DataManager (const DataManager &other)=delete
 Copy constructor.
 
 DataManager (DataManager &&other)=delete
 Move constructor.
 
DataManageroperator= (const DataManager &other)=delete
 Copy assignment operator.
 
DataManageroperator= (DataManager &&other)=delete
 Move assignment operator.
 
int GetNofHits ()
 Gets number of hits stored.
 
void ReadInputData (const std::string &fileName)
 Reads input data object from boost-serialized binary file.
 
void ReserveNhits (HitIndex_t nHits)
 Reserve number of hits.
 
void ResetInputData (HitIndex_t nHits=0) noexcept
 Resets the input data block.
 
void PushBackHit (const Hit &hit, int64_t streamId)
 Pushes back a hit.
 
void SetNhitKeys (int nKeys)
 Sets the number of hit keys.
 
bool SendInputData (InputData &destination)
 Sends (moves) input data to an object (alternative method of data sending)
 
InputData && TakeInputData ()
 Takes (moves) the instance of the input data object.
 
void WriteInputData (const std::string &fileName) const
 Writes input data object to boost-serialized binary file.
 

Private Member Functions

void InitData ()
 Initializes data object.
 
template<int Level>
bool CheckInputData () const
 

Private Attributes

InputData fInputData {}
 Object of input data.
 
int64_t fLastStreamId {-1}
 data stream Id of the last hit added
 

Detailed Description

A manager for the input-output data of the CA tracking algorithm.

Constructor & Destructor Documentation

◆ DataManager() [1/3]

cbm::algo::ca::DataManager::DataManager ( )
default

Default constructor.

◆ ~DataManager()

cbm::algo::ca::DataManager::~DataManager ( )
default

Destructor.

◆ DataManager() [2/3]

cbm::algo::ca::DataManager::DataManager ( const DataManager & other)
delete

Copy constructor.

◆ DataManager() [3/3]

cbm::algo::ca::DataManager::DataManager ( DataManager && other)
delete

Move constructor.

Member Function Documentation

◆ CheckInputData()

template<int Level>
bool cbm::algo::ca::DataManager::CheckInputData ( ) const
inlineprivate

Provides quick QA for input data

Template Parameters
LevelThe level of the checks. The values of the parameter:
  • 0: no checks will be done
  • 1: only number of hits and strips as well as validity of hits first and last indexes will be checked
  • 2: hits sorting is checked
  • 3: every hit is checked for consistency
Note
The larger Level corresponds to more precise checks, but is followed by larger time penalty

Definition at line 120 of file CaDataManager.h.

References fInputData, cbm::algo::ca::InputData::fNhitKeys, and cbm::algo::ca::InputData::fvHits.

Referenced by SendInputData(), and WriteInputData().

◆ GetNofHits()

int cbm::algo::ca::DataManager::GetNofHits ( )
inline

Gets number of hits stored.

Returns
Number of hits

Definition at line 42 of file CaDataManager.h.

References fInputData, and cbm::algo::ca::InputData::fvHits.

Referenced by cbm::algo::TrackingChain::PrepareInput(), cbm::algo::TrackingChain::ReadHits(), and SendInputData().

◆ InitData()

void DataManager::InitData ( )
private

Initializes data object.

Sorts hits by stations (complexity O(n)) and defines bordering hit index for station

Definition at line 92 of file CaDataManager.cxx.

References fInputData, cbm::algo::ca::InputData::fvHits, cbm::algo::ca::InputData::fvStreamStartIndices, cbm::algo::ca::InputData::fvStreamStopIndices, cbm::algo::ca::Vector< T >::reset(), and cbm::algo::ca::Vector< T >::shrink().

Referenced by SendInputData(), and TakeInputData().

◆ operator=() [1/2]

DataManager & cbm::algo::ca::DataManager::operator= ( const DataManager & other)
delete

Copy assignment operator.

◆ operator=() [2/2]

DataManager & cbm::algo::ca::DataManager::operator= ( DataManager && other)
delete

Move assignment operator.

◆ PushBackHit()

void cbm::algo::ca::DataManager::PushBackHit ( const Hit & hit,
int64_t streamId )
inline

Pushes back a hit.

Parameters
hitAn ca::Hit object

Definition at line 59 of file CaDataManager.h.

References fInputData, fLastStreamId, cbm::algo::ca::InputData::fvHits, and cbm::algo::ca::InputData::fvStreamStartIndices.

Referenced by cbm::algo::TrackingChain::ReadHits().

◆ ReadInputData()

void DataManager::ReadInputData ( const std::string & fileName)

Reads input data object from boost-serialized binary file.

Parameters
fileNameName of input file

Definition at line 56 of file CaDataManager.cxx.

References fInputData, and ResetInputData().

◆ ReserveNhits()

void cbm::algo::ca::DataManager::ReserveNhits ( HitIndex_t nHits)
inline

Reserve number of hits.

Parameters
nHitsNumber of hits to be stored
Note
If one does not call this method, the underlying vector of hits will be filled with the time penalty

Definition at line 51 of file CaDataManager.h.

References fInputData, and cbm::algo::ca::InputData::fvHits.

◆ ResetInputData()

void DataManager::ResetInputData ( HitIndex_t nHits = 0)
noexcept

Resets the input data block.

Parameters
nHitsNumber of hits to reserve

Definition at line 80 of file CaDataManager.cxx.

References cbm::algo::ca::InputData::Swap().

Referenced by cbm::algo::TrackingChain::PrepareInput(), and ReadInputData().

◆ SendInputData()

bool DataManager::SendInputData ( InputData & destination)

Sends (moves) input data to an object (alternative method of data sending)

Parameters
destinationDestination object of input data

Definition at line 22 of file CaDataManager.cxx.

References CheckInputData(), fInputData, GetNofHits(), and InitData().

◆ SetNhitKeys()

void cbm::algo::ca::DataManager::SetNhitKeys ( int nKeys)
inline

Sets the number of hit keys.

Parameters
nKeysNumber of hit keys

Definition at line 72 of file CaDataManager.h.

References fInputData, and cbm::algo::ca::InputData::fNhitKeys.

Referenced by cbm::algo::TrackingChain::PrepareInput().

◆ TakeInputData()

InputData && DataManager::TakeInputData ( )

Takes (moves) the instance of the input data object.

Definition at line 39 of file CaDataManager.cxx.

References fInputData, and InitData().

Referenced by cbm::algo::TrackingChain::PrepareInput().

◆ WriteInputData()

void DataManager::WriteInputData ( const std::string & fileName) const

Writes input data object to boost-serialized binary file.

Parameters
fileNameName of input file

Definition at line 112 of file CaDataManager.cxx.

References CheckInputData(), and fInputData.

Member Data Documentation

◆ fInputData

InputData cbm::algo::ca::DataManager::fInputData {}
private

◆ fLastStreamId

int64_t cbm::algo::ca::DataManager::fLastStreamId {-1}
private

data stream Id of the last hit added

Definition at line 107 of file CaDataManager.h.

Referenced by PushBackHit().


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