Skip to content
Snippets Groups Projects
Commit 6d0de83e authored by Sergei Zharko's avatar Sergei Zharko Committed by Sergei Zharko
Browse files

CA: moving L1InputData and L1IODataManager: elimination of the L1IODataManager...

CA: moving L1InputData and L1IODataManager: elimination of the L1IODataManager dependency from L1Algo
parent e7027782
No related branches found
No related tags found
1 merge request!1364CA: Moving L1IODataManager and L1InputData into the CaCore library
......@@ -785,7 +785,7 @@ void CbmL1::ReadEvent(CbmEvent* event)
if (1 == fSTAPDataMode) { WriteSTAPAlgoInputData(nCalls); }
if (2 == fSTAPDataMode) { ReadSTAPAlgoInputData(nCalls); }
// TODO: SZh: If we read data from file, we don't need to collect them above. This should be addressed
fpIODataManager->SendInputData(fpAlgo);
fpAlgo->ReceiveInputData(fpIODataManager->TakeInputData());
if (fPerformance) {
if (fVerbose >= 10) cout << "HitMatch is done." << endl;
......
......@@ -14,20 +14,17 @@
#include <fstream>
#include "L1Algo.h"
// ---------------------------------------------------------------------------------------------------------------------
//
bool L1IODataManager::SendInputData(L1Algo* pAlgo)
bool L1IODataManager::SendInputData(L1InputData& destination)
{
// Set boundary hit indexes
InitData();
// Check data before input
if (CheckInputData<constants::control::InputDataQaLevel>()) {
assert(pAlgo);
pAlgo->ReceiveInputData(std::move(fInputData));
destination = std::move(fInputData);
assert(this->GetNofHits() == 0);
return true;
}
LOG(error) << "L1: Attempt to set up inconsistent input data";
......@@ -36,19 +33,19 @@ bool L1IODataManager::SendInputData(L1Algo* pAlgo)
// ---------------------------------------------------------------------------------------------------------------------
//
bool L1IODataManager::SendInputData(L1InputData& destination)
L1InputData&& L1IODataManager::TakeInputData()
{
// Set boundary hit indexes
// Init the input data
InitData();
// Check data before input
if (CheckInputData<constants::control::InputDataQaLevel>()) {
destination = std::move(fInputData);
assert(this->GetNofHits() == 0);
return true;
}
LOG(error) << "L1: Attempt to set up inconsistent input data";
return false;
// Check the input data
// TODO: Provide assertion
// if (CheckInputData<constants::control::InputDataQaLevel>()) {
// pAlgo->ReceiveInputData(std::move(fInputData));
//
// }
return std::move(fInputData);
}
// ---------------------------------------------------------------------------------------------------------------------
......
......@@ -93,6 +93,9 @@ public:
/// @param destination Destination object of input data
bool SendInputData(L1InputData& destination);
/// \brief Takes (moves) the instance of the input data object
L1InputData&& TakeInputData();
/// Writes input data object to boost-serialized binary file
/// \param fileName Name of input file
void WriteInputData(const std::string& fileName) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment