21 :
WriterT(cfg.inputParticles,
"RootParticleWriter", lvl), m_cfg(cfg) {
24 throw std::invalid_argument(
"Missing file path");
27 throw std::invalid_argument(
"Missing tree name");
33 throw std::ios_base::failure(
"Could not open '" +
m_cfg.
filePath +
"'");
38 throw std::bad_alloc();
67 m_outputFile->Close();
74 m_outputTree->Write();
75 ACTS_INFO(
"Wrote particles to tree '" << m_cfg.treeName <<
"' in '"
76 << m_cfg.filePath <<
"'");
83 if (not m_outputFile) {
85 return ProcessCode::ABORT;
89 std::lock_guard<std::mutex> lock(m_writeMutex);
92 for (
const auto&
particle : particles) {
93 m_particleId =
particle.particleId().value();
95 m_process =
static_cast<decltype(m_process)
>(
particle.process());
114 m_vertexPrimary =
particle.particleId().vertexPrimary();
115 m_vertexSecondary =
particle.particleId().vertexSecondary();
116 m_particle =
particle.particleId().particle();
117 m_generation =
particle.particleId().generation();
118 m_subParticle =
particle.particleId().subParticle();
119 m_outputTree->Fill();