9#include "GaudiKernel/IInterface.h"
22 return StatusCode::FAILURE;
35 return StatusCode::FAILURE;
45 std::optional<std::uint32_t> evt{0ul};
46 std::size_t procEvts{0ul};
60 ATH_MSG_INFO(
"Skipped " << procEvts <<
" events. Corresponding to "
65 return StatusCode::FAILURE;
69 <<
" material events per athena event. Until "
71 <<
" events are processed or the tree is finished");
72 return StatusCode::SUCCESS;
78 "Not all entries / events have been processed. Processed entries: "
82 return StatusCode::SUCCESS;
92 std::make_unique<ActsTrk::RecordedMaterialTrackCollection>()));
97 return StatusCode::SUCCESS;
100 std::size_t nProcEvents{0ul};
101 std::size_t nCurrentEvt{
m_accessor.eventId()};
109 std::optional<Acts::RecordedMaterialTrack> pendingTrack{};
110 auto flushPending = [&]() {
112 materialTracks->push_back(std::move(*pendingTrack));
113 pendingTrack.reset();
122 Acts::RecordedMaterialTrack rmTrack =
m_accessor.read();
141 return StatusCode::SUCCESS;
145 ATH_MSG_DEBUG(
"Batch processing " << nProcEvents <<
" completed. ");
151 pendingTrack = std::move(rmTrack);
153 auto& interactions = pendingTrack->second.materialInteractions;
156 std::make_move_iterator(rmTrack.second.materialInteractions.begin()),
157 std::make_move_iterator(rmTrack.second.materialInteractions.end()));
158 pendingTrack->second.materialInX0 += rmTrack.second.materialInX0;
159 pendingTrack->second.materialInL0 += rmTrack.second.materialInL0;
164 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_INFO(x,...)
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
std::unique_ptr< TChain > m_inputChain
The input chain of entries.
Gaudi::Property< std::size_t > m_batchSize
The batch size (number of track per events).
ActsPlugins::RootMaterialTrackIo m_accessor
The read - write payload.
Gaudi::Property< std::size_t > m_skipEvents
The number of events in the file to skip.
virtual StatusCode initialize() override
Gaudi::Property< std::size_t > m_maxEvents
The number of events in the processed.
virtual StatusCode finalize() override
Gaudi::Property< std::vector< std::string > > m_fileNames
The list of input filenames.
Gaudi::Property< std::string > m_treeName
The name of the input tree.
virtual ~MaterialTrackReader()
std::size_t m_nTreeEntries
The number of entries in the tree to read.
SG::WriteHandleKey< RecordedMaterialTrackCollection > m_materialTrackCollectionKey
The RecordedMaterialTrackCollection to write.
std::size_t m_currEntry
The current processed tree entry.
std::size_t m_procEvents
The number of processed tree events.
bool isPresent() const
Is the referenced object present in SG?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.