26 :
WriterT(cfg.collection,
"RootPropagationStepsWriter", level),
28 m_outputFile(cfg.rootFile) {
31 throw std::invalid_argument(
"Missing input collection");
33 throw std::invalid_argument(
"Missing tree name");
40 throw std::ios_base::failure(
"Could not open '" +
m_cfg.
filePath);
46 "TTree from RootPropagationStepsWriter");
48 throw std::bad_alloc();
72 if (m_cfg.rootFile ==
nullptr) {
73 m_outputFile->Close();
80 m_outputTree->Write();
81 ACTS_VERBOSE(
"Wrote particles to tree '" << m_cfg.treeName <<
"' in '"
82 << m_cfg.filePath <<
"'");
88 const std::vector<PropagationSteps>& stepCollection) {
90 std::lock_guard<std::mutex> lock(m_writeMutex);
96 for (
auto&
steps : stepCollection) {
101 m_approachID.clear();
102 m_sensitiveID.clear();
125 auto geoID =
step.surface->geoID();
126 volumeID = geoID.volume();
127 boundaryID = geoID.boundary();
128 layerID = geoID.layer();
129 approachID = geoID.approach();
130 sensitiveID = geoID.sensitive();
134 volumeID =
step.volume->geoID().volume();
137 m_sensitiveID.push_back(sensitiveID);
138 m_approachID.push_back(approachID);
139 m_layerID.push_back(layerID);
140 m_boundaryID.push_back(boundaryID);
141 m_volumeID.push_back(volumeID);
144 m_x.push_back(
step.position.x());
145 m_y.push_back(
step.position.y());
146 m_z.push_back(
step.position.z());
147 auto direction =
step.momentum.normalized();
148 m_dx.push_back(direction.x());
149 m_dy.push_back(direction.y());
150 m_dz.push_back(direction.z());
156 double act2 = actor * actor;
157 double acc2 = accuracy * accuracy;
158 double abo2 = aborter * aborter;
159 double usr2 = user * user;
162 if (act2 < acc2 && act2 < abo2 && act2 < usr2) {
163 m_step_type.push_back(0);
164 }
else if (acc2 < abo2 && acc2 < usr2) {
165 m_step_type.push_back(1);
166 }
else if (abo2 < usr2) {
167 m_step_type.push_back(2);
169 m_step_type.push_back(3);
173 m_step_acc.push_back(accuracy);
174 m_step_act.push_back(actor);
175 m_step_abt.push_back(aborter);
176 m_step_usr.push_back(user);
178 m_outputTree->Fill();