6#include "GaudiKernel/IInterface.h"
13#include "util/RootExCellWriter.h"
16: base_class(name, svc) {
30 = std::make_shared<RootExCellWriter<Acts::TrackParameters>>(
37 return StatusCode::SUCCESS;
48 return StatusCode::SUCCESS;
55 const auto& ctx = Gaudi::Hive::currentContext();
59 for(
size_t i=0;i<ecells.size();++i) {
60 m_queue.emplace_back(ctx.eventID().event_number(), std::move(ecells[i]));
67 using namespace std::chrono_literals;
70 std::this_thread::sleep_for(2s);
80 std::this_thread::sleep_for(0.5s);
83 ATH_MSG_INFO(
"Writer thread caught termination signal. Shutting down.");
94 size_t eventNum = queue_item.first;
std::deque< queue_item_t > m_queue
std::thread m_writeThread
void store(std::vector< Acts::ExtrapolationCell< Acts::TrackParameters > > &ecells) override
virtual StatusCode initialize() override
Gaudi::Property< bool > m_writeMaterial
Gaudi::Property< bool > m_writeBoundary
std::mutex m_chargedMutex
Acts::ExtrapolationCell< Acts::TrackParameters > ExCellCharged
std::shared_ptr< RootExCellWriter< Acts::TrackParameters > > m_rootEccWriter
std::atomic< bool > m_doEnd
Gaudi::Property< std::string > m_treeName
Gaudi::Property< bool > m_writeSensitive
ActsExCellWriterSvc(const std::string &name, ISvcLocator *svc)
Gaudi::Property< bool > m_writePassive
Gaudi::Property< std::string > m_filePath
virtual StatusCode finalize() override
std::pair< size_t, ExCellCharged > queue_item_t