Skip to content

Commit

Permalink
flag material if found (#893)
Browse files Browse the repository at this point in the history
This PR adds a single additional value to the RootPropagationStepWriter which helps checking the material loading onto a geometry.
  • Loading branch information
asalzburger committed Jul 22, 2021
1 parent 41b85b2 commit bb4ba16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class RootPropagationStepsWriter
std::vector<int> m_layerID; ///< layer identifier if
std::vector<int> m_approachID; ///< surface identifier
std::vector<int> m_sensitiveID; ///< surface identifier
std::vector<int> m_material; ///< flag material if present
std::vector<float> m_x; ///< global x
std::vector<float> m_y; ///< global y
std::vector<float> m_z; ///< global z
Expand Down
7 changes: 7 additions & 0 deletions Examples/Io/Root/src/RootPropagationStepsWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ ActsExamples::RootPropagationStepsWriter::RootPropagationStepsWriter(
m_outputTree->Branch("layer_id", &m_layerID);
m_outputTree->Branch("approach_id", &m_approachID);
m_outputTree->Branch("sensitive_id", &m_sensitiveID);
m_outputTree->Branch("material", &m_material);
m_outputTree->Branch("g_x", &m_x);
m_outputTree->Branch("g_y", &m_y);
m_outputTree->Branch("g_z", &m_z);
Expand Down Expand Up @@ -101,6 +102,7 @@ ActsExamples::ProcessCode ActsExamples::RootPropagationStepsWriter::writeT(
m_layerID.clear();
m_approachID.clear();
m_sensitiveID.clear();
m_material.clear();
m_x.clear();
m_y.clear();
m_z.clear();
Expand All @@ -121,6 +123,7 @@ ActsExamples::ProcessCode ActsExamples::RootPropagationStepsWriter::writeT(
Acts::GeometryIdentifier::Value layerID = 0;
Acts::GeometryIdentifier::Value approachID = 0;
Acts::GeometryIdentifier::Value sensitiveID = 0;
int material = 0;
// get the identification from the surface first
if (step.surface) {
auto geoID = step.surface->geometryId();
Expand All @@ -129,6 +132,9 @@ ActsExamples::ProcessCode ActsExamples::RootPropagationStepsWriter::writeT(
layerID = geoID.layer();
approachID = geoID.approach();
sensitiveID = geoID.sensitive();
if (step.surface->surfaceMaterial() != nullptr) {
material = 1;
}
}
// a current volume overwrites the surface tagged one
if (step.volume) {
Expand All @@ -140,6 +146,7 @@ ActsExamples::ProcessCode ActsExamples::RootPropagationStepsWriter::writeT(
m_layerID.push_back(layerID);
m_boundaryID.push_back(boundaryID);
m_volumeID.push_back(volumeID);
m_material.push_back(material);

// kinematic information
m_x.push_back(step.position.x());
Expand Down

0 comments on commit bb4ba16

Please sign in to comment.