CbmRoot
Loading...
Searching...
No Matches
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 (const DataManager &other)=delete
 Copy constructor.
 
 DataManager (DataManager &&other)=delete
 Move constructor.
 
 ~DataManager ()=default
 Destructor.
 
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 (with a data stream info)
 
void PushBackHit (const Hit &hit)
 Pushes back a hit.
 
void SetNhitKeys (int nKeys)
 Sets the number of hit keys.
 
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.

Definition at line 20 of file CaDataManager.h.

Constructor & Destructor Documentation

◆ DataManager() [1/3]

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

Default constructor.

◆ 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.

◆ ~DataManager()

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

Destructor.

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 121 of file CaDataManager.h.

◆ 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.

◆ 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 75 of file CaDataManager.cxx.

◆ 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() [1/2]

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

Pushes back a hit.

Parameters
hitAn ca::Hit object

Definition at line 73 of file CaDataManager.h.

◆ PushBackHit() [2/2]

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

Pushes back a hit (with a data stream info)

Parameters
hitAn ca::Hit object
streamIdIndex of a data stream

Definition at line 60 of file CaDataManager.h.

◆ 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 39 of file CaDataManager.cxx.

◆ 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.

◆ ResetInputData()

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

Resets the input data block.

Parameters
nHitsNumber of hits to reserve

Definition at line 63 of file CaDataManager.cxx.

◆ SetNhitKeys()

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

Sets the number of hit keys.

Parameters
nKeysNumber of hit keys

Definition at line 77 of file CaDataManager.h.

◆ TakeInputData()

InputData && DataManager::TakeInputData ( )

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

Definition at line 22 of file CaDataManager.cxx.

◆ 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 100 of file CaDataManager.cxx.

Member Data Documentation

◆ fInputData

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

Object of input data.

Definition at line 107 of file CaDataManager.h.

◆ fLastStreamId

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

data stream Id of the last hit added

Definition at line 108 of file CaDataManager.h.


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