27 :
WriterT(cfg.collection,
"RootPropagationStepsWriter", level),
29 m_outputFile(cfg.rootFile) {
32 throw std::invalid_argument(
"Missing input collection");
34 throw std::invalid_argument(
"Missing tree name");
41 throw std::ios_base::failure(
"Could not open '" +
m_cfg.
filePath);
47 "TTree from RootPropagationStepsWriter");
49 throw std::bad_alloc();
73 if (m_cfg.rootFile ==
nullptr) {
74 m_outputFile->Close();
81 m_outputTree->Write();
82 ACTS_VERBOSE(
"Wrote particles to tree '" << m_cfg.treeName <<
"' in '"
83 << m_cfg.filePath <<
"'");
89 const std::vector<PropagationSteps>& stepCollection) {
91 std::lock_guard<std::mutex> lock(m_writeMutex);
97 for (
auto&
steps : stepCollection) {
100 m_boundaryID.clear();
102 m_approachID.clear();
103 m_sensitiveID.clear();
126 auto geoID =
step.surface->geometryId();
127 volumeID = geoID.volume();
128 boundaryID = geoID.boundary();
129 layerID = geoID.layer();
130 approachID = geoID.approach();
131 sensitiveID = geoID.sensitive();
135 volumeID =
step.volume->geometryId().volume();
138 m_sensitiveID.push_back(sensitiveID);
139 m_approachID.push_back(approachID);
140 m_layerID.push_back(layerID);
141 m_boundaryID.push_back(boundaryID);
142 m_volumeID.push_back(volumeID);
145 m_x.push_back(
step.position.x());
146 m_y.push_back(
step.position.y());
147 m_z.push_back(
step.position.z());
148 auto direction =
step.momentum.normalized();
149 m_dx.push_back(direction.x());
150 m_dy.push_back(direction.y());
151 m_dz.push_back(direction.z());
157 double act2 = actor * actor;
158 double acc2 = accuracy * accuracy;
159 double abo2 = aborter * aborter;
160 double usr2 = user * user;
163 if (act2 < acc2 && act2 < abo2 && act2 < usr2) {
164 m_step_type.push_back(0);
165 }
else if (acc2 < abo2 && acc2 < usr2) {
166 m_step_type.push_back(1);
167 }
else if (abo2 < usr2) {
168 m_step_type.push_back(2);
170 m_step_type.push_back(3);
174 m_step_acc.push_back(accuracy);
175 m_step_act.push_back(actor);
176 m_step_abt.push_back(aborter);
177 m_step_usr.push_back(user);
179 m_outputTree->Fill();