12#include <boost/archive/binary_iarchive.hpp>
13#include <boost/archive/binary_oarchive.hpp>
33 LOG(error) <<
"L1: Attempt to set up inconsistent input data";
60 LOG(info) <<
"L1: Input data will be read from file \"" << fileName <<
"\"";
63 std::ifstream ifs(fileName, std::ios::binary);
65 LOG(fatal) <<
"L1: input data reader: data file \"" << fileName <<
"\" was not found";
70 boost::archive::binary_iarchive ia(ifs);
73 catch (
const std::exception&) {
74 LOG(fatal) <<
"L1: input data reader: data file \"" << fileName <<
"\" has incorrect data format or was corrupted";
85 fInputData.fvStreamStartIndices.reserve(2000);
86 fInputData.fvStreamStopIndices.reserve(2000);
87 fInputData.fvHits.reserve(nHits);
97 LOG(warning) <<
"ca::DataManager: unexpected order of input data: too many data streams!!! ";
102 for (
int i = 0; i < nStreams - 1; i++) {
116 LOG(error) <<
"ca::DataManager: input data writer: attempt to write invalid input data object to file \""
122 std::ofstream ofs(fileName, std::ios::binary);
124 LOG(error) <<
"ca::DataManager: input data writer: failed opening file \"" << fileName
125 <<
" for writing input data\"";
130 boost::archive::binary_oarchive oa(ofs);
Input-output data manager for L1 tracking algorithm.
A manager for the input-output data of the CA tracking algorithm.
void ReadInputData(const std::string &fileName)
Reads input data object from boost-serialized binary file.
void WriteInputData(const std::string &fileName) const
Writes input data object to boost-serialized binary file.
InputData && TakeInputData()
Takes (moves) the instance of the input data object.
InputData fInputData
Object of input data.
void InitData()
Initializes data object.
void ResetInputData(HitIndex_t nHits=0) noexcept
Resets the input data block.
int GetNofHits()
Gets number of hits stored.
bool CheckInputData() const
bool SendInputData(InputData &destination)
Sends (moves) input data to an object (alternative method of data sending)
void shrink(std::size_t count)
Reduces the vector to a given size.
void reset(std::size_t count, Tinput... value)
Clears vector and resizes it to the selected size with selected values.
unsigned int HitIndex_t
Index of ca::Hit.