diff --git a/reco/steer/CbmSourceTsArchive.cxx b/reco/steer/CbmSourceTsArchive.cxx index 90fa59a0f9b516ba0d1dec7f69ad53216d4d9599..0e657fbd895ad7f55f48ef3cbd1811ab01c84a9d 100644 --- a/reco/steer/CbmSourceTsArchive.cxx +++ b/reco/steer/CbmSourceTsArchive.cxx @@ -7,8 +7,7 @@ #include "CbmSourceTsArchive.h" -#include <TimesliceMultiInputArchive.hpp> -#include <TimesliceMultiSubscriber.hpp> +#include <TimesliceAutoSource.hpp> #include <FairSource.h> #include <Logger.h> @@ -46,56 +45,8 @@ void CbmSourceTsArchive::Close() // ----- Initialisation --------------------------------------------------- Bool_t CbmSourceTsArchive::Init() { + fTsSource = new fles::TimesliceAutoSource(fFileNames); - switch (fCbmSourceType) { - // Use again when kFILE does not skipp the first TS by default anymore - // case Source_Type::kONLINE: { - case eCbmSourceType::kOnline: { - // Create a ";" separated string with all host/port combinations - // Build a semicolon-separated list of file names for TimesliceMultiInputArchive - string fileList; - for (const auto& fileName : fFileNames) { - fileList += fileName; - fileList += ";"; - } - fileList.pop_back(); // Remove last semicolon after last file name - - fTsSource = new fles::TimesliceMultiSubscriber(fileList, fHighWaterMark); - - /// Initialize the Multisubscriber - /// (This restores the original behavior after modifications needed to make the MQ version - dynamic_cast<fles::TimesliceMultiSubscriber*>(fTsSource)->InitTimesliceSubscriber(); - - if (!fTsSource) { - LOG(fatal) << "Could not connect to the TS publisher."; - return kFALSE; - } - break; - } - // Se above - // case Source_Type::kFILE: { - case eCbmSourceType::kOffline: { - // Return error for empty file list and an offline run - if (fFileNames.empty()) return kFALSE; - - - // Build a semicolon-separated list of file names for TimesliceMultiInputArchive - string fileList; - for (const auto& fileName : fFileNames) { - fileList += fileName; - fileList += ";"; - } - fileList.pop_back(); // Remove last semicolon after last file name - - // Create the proper TS source - fTsSource = new fles::TimesliceMultiInputArchive(fileList); - if (!fTsSource) { - LOG(error) << "SourceTsArchive: Failed to create TSMultiInputArchive!"; - return kFALSE; - } - break; - } - } // Initialise unpacker fUnpack.Init(); LOG(info) << "Source: Init done"; diff --git a/reco/steer/CbmSourceTsArchive.h b/reco/steer/CbmSourceTsArchive.h index c67cba991cc9c1633d150a37252bd40cbae747e3..aa8f8534771474f862f2cb42c77cdb6e87a81fd6 100644 --- a/reco/steer/CbmSourceTsArchive.h +++ b/reco/steer/CbmSourceTsArchive.h @@ -24,7 +24,7 @@ ** @since 2 June 2021 ** ** This class allows to read time-slice data from file(s) and hands them to - ** the unpacking stage. It interfaces fles::TimesliceMultiInputArchive to cbmroot. + ** the unpacking stage. It interfaces fles::TimesliceAutoSource to cbmroot. **/ class CbmSourceTsArchive : public FairSource { @@ -106,9 +106,6 @@ public: /** @brief Reset clear the output vectors as preparation for the next timeslice. Forwarded to CbmRecoUnpack **/ virtual void Reset() { fUnpack.Reset(); } - /** @brief Set the high water mark (limit of buffered timeslice by the publisher) */ - void SetHighWaterMark(std::uint32_t value) { fHighWaterMark = value; } - /** @brief Set unpacker parameters (forced by base class) **/ virtual void SetParUnpackers() {} @@ -125,9 +122,6 @@ private: /** List of input file names **/ std::vector<std::string> fFileNames = {}; - /** @brief Amount of Timeslices buffered before the publisher starts dropping new ones, if the old are not digested yet.*/ - std::uint32_t fHighWaterMark = 1; - /** @brief type of source that is currently used @remark currently we use kONLINE as default, since, kFILE skipps the first TS probably due to obsolete reasons (to be checked PR072021) */ Source_Type fSourceType = Source_Type::kONLINE;