CbmRoot
|
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. | |
DataManager & | operator= (const DataManager &other)=delete |
Copy assignment operator. | |
DataManager & | operator= (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 | |
A manager for the input-output data of the CA tracking algorithm.
|
default |
Default constructor.
|
default |
Destructor.
|
delete |
Copy constructor.
|
delete |
Move constructor.
|
inlineprivate |
Provides quick QA for input data
Level | The level of the checks. The values of the parameter:
|
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().
|
inline |
Gets number of hits stored.
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().
|
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().
|
delete |
Copy assignment operator.
|
delete |
Move assignment operator.
|
inline |
Pushes back a hit.
hit | An 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().
void DataManager::ReadInputData | ( | const std::string & | fileName | ) |
Reads input data object from boost-serialized binary file.
fileName | Name of input file |
Definition at line 56 of file CaDataManager.cxx.
References fInputData, and ResetInputData().
|
inline |
Reserve number of hits.
nHits | Number of hits to be stored |
Definition at line 51 of file CaDataManager.h.
References fInputData, and cbm::algo::ca::InputData::fvHits.
|
noexcept |
Resets the input data block.
nHits | Number 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().
bool DataManager::SendInputData | ( | InputData & | destination | ) |
Sends (moves) input data to an object (alternative method of data sending)
destination | Destination object of input data |
Definition at line 22 of file CaDataManager.cxx.
References CheckInputData(), fInputData, GetNofHits(), and InitData().
|
inline |
Sets the number of hit keys.
nKeys | Number 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().
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().
void DataManager::WriteInputData | ( | const std::string & | fileName | ) | const |
Writes input data object to boost-serialized binary file.
fileName | Name of input file |
Definition at line 112 of file CaDataManager.cxx.
References CheckInputData(), and fInputData.
|
private |
Object of input data.
Definition at line 106 of file CaDataManager.h.
Referenced by CheckInputData(), GetNofHits(), InitData(), PushBackHit(), ReadInputData(), ReserveNhits(), SendInputData(), SetNhitKeys(), TakeInputData(), and WriteInputData().
|
private |
data stream Id of the last hit added
Definition at line 107 of file CaDataManager.h.
Referenced by PushBackHit().