21 :
WriterT(cfg.inputSimulatedHits,
"RootSimHitWriter", 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_VERBOSE(
"Wrote hits 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);
93 for (
const auto& hit : hits) {
94 m_particleId = hit.particleId().value();
95 m_geometryId = hit.geometryId().value();
107 const auto delta4 = hit.momentum4After() - hit.momentum4Before();
113 m_index = hit.index();
115 m_volumeId = hit.geometryId().volume();
116 m_boundaryId = hit.geometryId().boundary();
117 m_layerId = hit.geometryId().layer();
118 m_approachId = hit.geometryId().approach();
119 m_sensitiveId = hit.geometryId().sensitive();
121 m_outputTree->Fill();