20 :
WriterT(cfg.inputSimulatedHits,
"RootSimHitWriter", lvl), m_cfg(cfg) {
23 throw std::invalid_argument(
"Missing file path");
26 throw std::invalid_argument(
"Missing tree name");
32 throw std::ios_base::failure(
"Could not open '" +
m_cfg.
filePath +
"'");
37 throw std::bad_alloc();
66 m_outputFile->Close();
73 m_outputTree->Write();
74 ACTS_VERBOSE(
"Wrote hits to tree '" << m_cfg.treeName <<
"' in '"
75 << m_cfg.filePath <<
"'");
82 if (not m_outputFile) {
84 return ProcessCode::ABORT;
88 std::lock_guard<std::mutex> lock(m_writeMutex);
92 for (
const auto& hit : hits) {
93 m_particleId = hit.particleId().value();
94 m_geometryId = hit.geometryId().value();
106 const auto delta4 = hit.momentum4After() - hit.momentum4Before();
112 m_index = hit.index();
114 m_volumeId = hit.geometryId().volume();
115 m_boundaryId = hit.geometryId().boundary();
116 m_layerId = hit.geometryId().layer();
117 m_approachId = hit.geometryId().approach();
118 m_sensitiveId = hit.geometryId().sensitive();
120 m_outputTree->Fill();