Skip to content

Commit

Permalink
restore previous behaviour of RedoSegmentation for segmentations diff…
Browse files Browse the repository at this point in the history
…erent from the merged module-theta readout (#57)
  • Loading branch information
giovannimarchiori authored Dec 14, 2023
1 parent 11419ae commit 26e669e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Detector/DetComponents/src/RedoSegmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ StatusCode RedoSegmentation::execute() {
// factor 10 to convert mm to cm
position = dd4hep::DDSegmentation::Vector3D (pos.x / 10., pos.y / 10., pos.z / 10.);
}
// debug
debug() << "x = " << position.x() << " y = " << position.y() << " z = " << position.z() << endmsg;

// first calculate proper segmentation fields
// pass volumeID: we need layer / module information
Expand All @@ -113,9 +115,14 @@ StatusCode RedoSegmentation::execute() {
// initial module number with merged module number, we still want
// to pass the initial module number to segmentation->cellID(..)
// as part of the volume ID
if (m_segmentationType == 2)
dd4hep::DDSegmentation::CellID newCellId;
if (m_segmentationType == 2) {
m_segmentation->decoder()->set(vID, "module", m_oldDecoder->get(cellId, "module"));
dd4hep::DDSegmentation::CellID newCellId = m_segmentation->cellID(position, position, vID);
newCellId = m_segmentation->cellID(position, position, vID);
}
else {
newCellId = m_segmentation->cellID(position, position, 0);
}
// now rewrite all other fields (detector ID)
for (const auto& detectorField : m_detectorIdentifiers) {
oldid = m_oldDecoder->get(cellId, detectorField);
Expand Down

0 comments on commit 26e669e

Please sign in to comment.