diff --git a/DetectorDescription/OfflineDBLoader/src/DDCoreToDDXMLOutput.cc b/DetectorDescription/OfflineDBLoader/src/DDCoreToDDXMLOutput.cc index 878988b972f24..e7e21b1449e0c 100644 --- a/DetectorDescription/OfflineDBLoader/src/DDCoreToDDXMLOutput.cc +++ b/DetectorDescription/OfflineDBLoader/src/DDCoreToDDXMLOutput.cc @@ -784,25 +784,27 @@ void DDCoreToDDXMLOutput::position(const TGeoVolume& parent, xos << "" << std::endl; const auto matrix = child.GetMatrix(); - if (matrix != nullptr && !matrix->IsIdentity()) { - auto rot = matrix->GetRotationMatrix(); - if (cms::rotation_utils::rotHash(rot) != cms::rotation_utils::identityHash) { - std::string rotNameStr = cms::rotation_utils::rotName(rot, context); - if (rotNameStr == "NULL") { - rotNameStr = child.GetName(); // Phys vol name - rotNameStr += parent.GetName(); - cms::DDNamespace nameSpace(context); - cms::rotation_utils::addRotWithNewName(nameSpace, rotNameStr, rot); + if (matrix != nullptr) { + if (!matrix->IsIdentity()) { + auto rot = matrix->GetRotationMatrix(); + if (cms::rotation_utils::rotHash(rot) != cms::rotation_utils::identityHash) { + std::string rotNameStr = cms::rotation_utils::rotName(rot, context); + if (rotNameStr == "NULL") { + rotNameStr = child.GetName(); // Phys vol name + rotNameStr += parent.GetName(); + cms::DDNamespace nameSpace(context); + cms::rotation_utils::addRotWithNewName(nameSpace, rotNameStr, rot); + } + xos << "" << std::endl; } - xos << "" << std::endl; } + auto trans = matrix->GetTranslation(); + using namespace cms_rounding; + xos << "" << std::endl; } - auto trans = matrix->GetTranslation(); - using namespace cms_rounding; - xos << "" << std::endl; xos << "" << std::endl; }