diff --git a/reco/L1/CbmL1ReadEvent.cxx b/reco/L1/CbmL1ReadEvent.cxx index 241bec19dab91cbe17ed8bbd3113bc3160468e9f..82f19b74009ab33d1ff50c51c8c1d104c8c672c0 100644 --- a/reco/L1/CbmL1ReadEvent.cxx +++ b/reco/L1/CbmL1ReadEvent.cxx @@ -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; diff --git a/reco/L1/L1Algo/L1IODataManager.cxx b/reco/L1/L1Algo/L1IODataManager.cxx index ca2719d1598e3549cb44f5c25e93a80001b6de02..66bffd2d4f9a1000357e07547f2004bda76d3e04 100644 --- a/reco/L1/L1Algo/L1IODataManager.cxx +++ b/reco/L1/L1Algo/L1IODataManager.cxx @@ -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); } // --------------------------------------------------------------------------------------------------------------------- diff --git a/reco/L1/L1Algo/L1IODataManager.h b/reco/L1/L1Algo/L1IODataManager.h index b37d409eda66b8d494e75acd0ae20e810fed184f..2c80b3c86c4b06fe14a84a20d9ee5b0f4164fb92 100644 --- a/reco/L1/L1Algo/L1IODataManager.h +++ b/reco/L1/L1Algo/L1IODataManager.h @@ -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;