27 :
WriterT(config.inputSimHits,
"RootSimHitWriter", level),
m_cfg(config) {
30 throw std::invalid_argument(
"Missing file path");
33 throw std::invalid_argument(
"Missing tree name");
39 throw std::ios_base::failure(
"Could not open '" +
m_cfg.
filePath +
"'");
44 throw std::bad_alloc();
72 if (m_outputFile !=
nullptr) {
73 m_outputFile->Close();
79 m_outputTree->Write();
80 m_outputFile->Close();
83 <<
m_cfg.filePath <<
"'");
91 std::lock_guard<std::mutex> lock(m_writeMutex);
95 for (
const auto& hit : hits) {
96 m_particleId = hit.particleId().value();
97 m_geometryId = hit.geometryId().value();
109 const auto delta4 = hit.momentum4After() - hit.momentum4Before();
115 m_index = hit.index();
117 m_volumeId = hit.geometryId().volume();
118 m_boundaryId = hit.geometryId().boundary();
119 m_layerId = hit.geometryId().layer();
120 m_approachId = hit.geometryId().approach();
121 m_sensitiveId = hit.geometryId().sensitive();
123 m_outputTree->Fill();