Warning, /eic-spack/packages/acts/pr4620.patch is written in an unsupported language. File is not indexed.
0001 diff --git a/Plugins/DD4hep/src/DD4hepLayerBuilder.cpp b/Plugins/DD4hep/src/DD4hepLayerBuilder.cpp
0002 index 9e33e4036..59830b5f9 100644
0003 --- a/Plugins/DD4hep/src/DD4hepLayerBuilder.cpp
0004 +++ b/Plugins/DD4hep/src/DD4hepLayerBuilder.cpp
0005 @@ -131,31 +131,28 @@ const Acts::LayerVector Acts::DD4hepLayerBuilder::endcapLayers(
0006 // extract the boundaries
0007 double rMin = tube->GetRmin() * UnitConstants::cm;
0008 double rMax = tube->GetRmax() * UnitConstants::cm;
0009 - double zMin =
0010 - (transform.translation() -
0011 - transform.rotation().col(2) * tube->GetDz() * UnitConstants::cm)
0012 - .z();
0013 - double zMax =
0014 - (transform.translation() +
0015 - transform.rotation().col(2) * tube->GetDz() * UnitConstants::cm)
0016 - .z();
0017 - if (zMin > zMax) {
0018 - std::swap(zMin, zMax);
0019 - }
0020 +
0021 + // For disc layers, since ProtoLayer uses local coordinates,
0022 + // we can simply use ±dz directly in local coordinates
0023 + double dz = tube->GetDz() * UnitConstants::cm;
0024 + double zMin = -dz;
0025 + double zMax = +dz;
0026 +
0027 // check if layer has surfaces
0028 if (layerSurfaces.empty()) {
0029 ACTS_VERBOSE(" Disc layer has no sensitive surfaces.");
0030 // in case no surfaces are handed over the layer thickness will be
0031 // set to a default value to allow attaching material layers
0032 - double z = (zMin + zMax) * 0.5;
0033 - // create layer without surfaces
0034 - // manually create a proto layer
0035 - double eiz = (z != 0.) ? z - m_cfg.defaultThickness : 0.;
0036 - double eoz = (z != 0.) ? z + m_cfg.defaultThickness : 0.;
0037 - pl.extent.range(Acts::AxisDirection::AxisZ).set(eiz, eoz);
0038 - pl.extent.range(Acts::AxisDirection::AxisR).set(rMin, rMax);
0039 - pl.envelope[Acts::AxisDirection::AxisR] = {0., 0.};
0040 - pl.envelope[Acts::AxisDirection::AxisZ] = {0., 0.};
0041 + double eiz = (transform.translation().z() != 0.)
0042 + ? -m_cfg.defaultThickness
0043 + : 0.;
0044 + double eoz = (transform.translation().z() != 0.)
0045 + ? +m_cfg.defaultThickness
0046 + : 0.;
0047 + pl.extent.range(AxisDirection::AxisZ).set(eiz, eoz);
0048 + pl.extent.range(AxisDirection::AxisR).set(rMin, rMax);
0049 + pl.envelope[AxisDirection::AxisR] = {0., 0.};
0050 + pl.envelope[AxisDirection::AxisZ] = {0., 0.};
0051 } else {
0052 ACTS_VERBOSE(" Disc layer has " << layerSurfaces.size()
0053 << " sensitive surfaces.");