From 083df212b7f0f80c895fcacf988b6a9419469ecd Mon Sep 17 00:00:00 2001 From: simonge Date: Fri, 21 Feb 2025 21:48:26 +0000 Subject: [PATCH 01/25] Swapped small air gap for a proper pipe bend --- src/BeamPipeChain_geo.cpp | 136 +++++++++++++++++++++++++++++--------- 1 file changed, 105 insertions(+), 31 deletions(-) diff --git a/src/BeamPipeChain_geo.cpp b/src/BeamPipeChain_geo.cpp index 706c7e8108..3d17f77d60 100644 --- a/src/BeamPipeChain_geo.cpp +++ b/src/BeamPipeChain_geo.cpp @@ -1,12 +1,11 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright (C) 2022 Dhevan Gangadharan +// Copyright (C) 2022-25 Dhevan Gangadharan, Simon Gardner //========================================================================== // // Places a chain of beam pipe segments within and between the beamline magnets. // // Approximation used for beam pipes in between magnets. -// Right-angled ends with a small air gap to avoid G4 overlap errors // //========================================================================== @@ -29,6 +28,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / Material m_Vacuum = description.material("Vacuum"); string vis_name = dd4hep::getAttrOrDefault(x_det, _Unicode(vis), "BeamPipeVis"); double thickness = getAttrOrDefault(x_det, _Unicode(wall_thickness), 0); + double bendRadius = 0.00001; //Small bend radius to allow the construction of toruses vector names; vector ids; @@ -38,6 +38,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / vector thetas; vector rOuters1; vector rOuters2; + vector bendLengths; // Grab info for beamline magnets for (xml_coll_t pipe_coll(x_det, _Unicode(pipe)); pipe_coll; pipe_coll++) { // pipes @@ -50,10 +51,10 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / // Vectors momentarily filled with zeros for pipes in between magnets xCenters.push_back(getAttrOrDefault(pipe, _Unicode(xcenter), 0)); zCenters.push_back(getAttrOrDefault(pipe, _Unicode(zcenter), 0)); - lengths.push_back(getAttrOrDefault(pipe, _Unicode(length), 0)); - thetas.push_back(getAttrOrDefault(pipe, _Unicode(theta), 0)); - rOuters1.push_back(getAttrOrDefault(pipe, _Unicode(rout1), 0)); - rOuters2.push_back(getAttrOrDefault(pipe, _Unicode(rout2), 0)); + lengths. push_back(getAttrOrDefault(pipe, _Unicode(length), 0)); + thetas. push_back(getAttrOrDefault(pipe, _Unicode(theta), 0)); + rOuters1.push_back(getAttrOrDefault(pipe, _Unicode(rout1), 0)); + rOuters2.push_back(getAttrOrDefault(pipe, _Unicode(rout2), 0)); } // Calculate parameters for connecting pipes in between magnets @@ -69,23 +70,17 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / continue; } // can't create pipe for an empty end slot - double x = (xCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * sin(thetas[pipeN - 1]) + - xCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * sin(thetas[pipeN + 1])) / - 2.; - double z = (zCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * cos(thetas[pipeN - 1]) + - zCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * cos(thetas[pipeN + 1])) / - 2.; - double deltaX = (xCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * sin(thetas[pipeN - 1])) - - (xCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * sin(thetas[pipeN + 1])); - double deltaZ = (zCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * cos(thetas[pipeN - 1])) - - (zCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * cos(thetas[pipeN + 1])); - double l = sqrt(pow(deltaX, 2) + pow(deltaZ, 2)); - double theta = atan(deltaX / deltaZ); - - // Small air gap between connecting and magnet beam pipes to avoid G4 overlap errors - if ((theta != thetas[pipeN - 1]) || (theta != thetas[pipeN + 1])) { - l -= 0.5; - } + double previousPipeEndX = xCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * sin(thetas[pipeN - 1]); + double previousPipeEndZ = zCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * cos(thetas[pipeN - 1]); + double nextPipeStartX = xCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * sin(thetas[pipeN + 1]); + double nextPipeStartZ = zCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * cos(thetas[pipeN + 1]); + + double x = (previousPipeEndX + nextPipeStartX) / 2.; + double z = (previousPipeEndZ + nextPipeStartZ) / 2.; + double deltaX = previousPipeEndX - nextPipeStartX; + double deltaZ = previousPipeEndZ - nextPipeStartZ; + double l = sqrt(deltaX * deltaX + deltaZ * deltaZ); + double theta = atan2(deltaX,deltaZ); xCenters[pipeN] = x; zCenters[pipeN] = z; @@ -95,29 +90,108 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / rOuters2[pipeN] = rOuters1[pipeN + 1]; } + // If there is an bend in the pipe, calculate the length reduction of the pipe and joint length + for (uint i = 1; i < thetas.size(); i++) + { + // Start at the join between the first two pipes ending at the join between the last two pipes N-1 + if(thetas[i-1] == thetas[i]) + { + bendLengths.push_back(0); + } + else // Correct for tubes, not yet cones so imperfect + { + double bendAngle = thetas[i] - thetas[i-1]; + double bendLength = abs(rOuters1[i] * tan(bendAngle/2)); + bendLengths.push_back(bendLength+bendRadius); + } + + } + + // Add all pipes to the assembly for (uint pipeN = 0; pipeN < xCenters.size(); pipeN++) { - ConeSegment s_tube(lengths[pipeN] / 2.0, rOuters2[pipeN] - thickness, rOuters2[pipeN], - rOuters1[pipeN] - thickness, rOuters1[pipeN]); - ConeSegment s_vacuum(lengths[pipeN] / 2.0, 0, rOuters2[pipeN] - thickness, 0, - rOuters1[pipeN] - thickness); + double length = lengths[pipeN]; + double theta = thetas[pipeN]; + double xCenter = xCenters[pipeN]; + double zCenter = zCenters[pipeN]; + double rOuter1 = rOuters1[pipeN]; + double rOuter2 = rOuters2[pipeN]; + + //Change straight pipe length to account for bend + if(pipeN!=0) + { + length -= bendLengths[pipeN-1]; + xCenter -= bendLengths[pipeN-1]/2*sin(theta); + zCenter -= bendLengths[pipeN-1]/2*cos(theta); + } + if(pipeN!=xCenters.size()-1) + { + length -= bendLengths[pipeN]; + xCenter += bendLengths[pipeN]/2*sin(theta); + zCenter += bendLengths[pipeN]/2*cos(theta); + } + + ConeSegment s_tube(length / 2.0, rOuter2 - thickness, rOuter2, + rOuter1 - thickness, rOuter1); + ConeSegment s_vacuum(length / 2.0, 0, rOuter2 - thickness, 0, + rOuter1 - thickness); Volume v_tube("v_tube_" + names[pipeN], s_tube, m_Al); Volume v_vacuum("v_vacuum_" + names[pipeN], s_vacuum, m_Vacuum); v_tube.setVisAttributes(description.visAttributes(vis_name)); - assembly.placeVolume(v_tube, Transform3D(RotationY(thetas[pipeN]), - Position(xCenters[pipeN], 0, zCenters[pipeN]))); + assembly.placeVolume(v_tube, Transform3D(RotationY(theta), + Position(xCenter, 0, zCenter))); auto placed_vacuum = - assembly.placeVolume(v_vacuum, Transform3D(RotationY(thetas[pipeN]), - Position(xCenters[pipeN], 0, zCenters[pipeN]))); + assembly.placeVolume(v_vacuum, Transform3D(RotationY(theta), + Position(xCenter, 0, zCenter))); DetElement vacuum_element(sdet, names[pipeN] + "_vacuum", ids[pipeN]); vacuum_element.setPlacement(placed_vacuum); + + // // Add joining bend to next pipe + if(pipeN!=xCenters.size()-1 && bendLengths[pipeN]!=0){ + + // double bendLength = bendLengths[pipeN]; + double bendAngle = thetas[pipeN+1] - thetas[pipeN]; + + // Create a torus to join the two pipes + Torus s_bend_solid(rOuter2+bendRadius, rOuter2-thickness,rOuter2, 0.0,abs(bendAngle)); + + //Create a vacuum torus to place inside the solid segment + Torus s_bend_vac(rOuter2+bendRadius, 0, rOuter2-thickness, 0, bendAngle); + + // //Create the volumes + Volume v_bend_soild("v_bend_solid_" + names[pipeN], s_bend_solid, m_Al); + Volume v_bend_vac("v_bend_vac_" + names[pipeN], s_bend_vac, m_Vacuum); + + // Calculate the position and rotation to place bend at the joint + double bendCenterX = xCenter + rOuter2*cos(theta) - (length/2)*sin(theta); + double bendCenterZ = zCenter - rOuter2*sin(theta) - (length/2)*cos(theta); + double rotation = pi-theta; + if(bendAngle>0) + { + bendCenterX = xCenter - rOuter2*cos(theta) - (length/2)*sin(theta); + bendCenterZ = zCenter + rOuter2*sin(theta) - (length/2)*cos(theta); + rotation = -bendAngle-theta; + } + + // Place the bend in the assembly + assembly.placeVolume(v_bend_soild, Transform3D(RotationZYX(rotation,0,pi/2), Position(bendCenterX, 0, bendCenterZ))); + assembly.placeVolume(v_bend_vac, Transform3D(RotationZYX(rotation,0,pi/2), Position(bendCenterX, 0, bendCenterZ))); + + // Set vis attributes + v_bend_soild.setVisAttributes(description.visAttributes(vis_name)); + + } + + + } + // Final placement auto pv_assembly = description.pickMotherVolume(sdet).placeVolume(assembly, Position(0.0, 0.0, 0.0)); From ccb43ff89bd3474790435bdd06505115e93ea3cd Mon Sep 17 00:00:00 2001 From: simonge Date: Fri, 21 Feb 2025 21:57:39 +0000 Subject: [PATCH 02/25] Fix vacuum torus --- src/BeamPipeChain_geo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BeamPipeChain_geo.cpp b/src/BeamPipeChain_geo.cpp index 3d17f77d60..1a95ef0ad4 100644 --- a/src/BeamPipeChain_geo.cpp +++ b/src/BeamPipeChain_geo.cpp @@ -161,7 +161,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / Torus s_bend_solid(rOuter2+bendRadius, rOuter2-thickness,rOuter2, 0.0,abs(bendAngle)); //Create a vacuum torus to place inside the solid segment - Torus s_bend_vac(rOuter2+bendRadius, 0, rOuter2-thickness, 0, bendAngle); + Torus s_bend_vac(rOuter2+bendRadius, 0, rOuter2-thickness, 0, abs(bendAngle)); // //Create the volumes Volume v_bend_soild("v_bend_solid_" + names[pipeN], s_bend_solid, m_Al); From a90967898d7b4f0148f2be019ffd224a0fad746a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 22:17:34 +0000 Subject: [PATCH 03/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/BeamPipeChain_geo.cpp | 115 +++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 64 deletions(-) diff --git a/src/BeamPipeChain_geo.cpp b/src/BeamPipeChain_geo.cpp index 1a95ef0ad4..70e409a105 100644 --- a/src/BeamPipeChain_geo.cpp +++ b/src/BeamPipeChain_geo.cpp @@ -51,10 +51,10 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / // Vectors momentarily filled with zeros for pipes in between magnets xCenters.push_back(getAttrOrDefault(pipe, _Unicode(xcenter), 0)); zCenters.push_back(getAttrOrDefault(pipe, _Unicode(zcenter), 0)); - lengths. push_back(getAttrOrDefault(pipe, _Unicode(length), 0)); - thetas. push_back(getAttrOrDefault(pipe, _Unicode(theta), 0)); - rOuters1.push_back(getAttrOrDefault(pipe, _Unicode(rout1), 0)); - rOuters2.push_back(getAttrOrDefault(pipe, _Unicode(rout2), 0)); + lengths.push_back(getAttrOrDefault(pipe, _Unicode(length), 0)); + thetas.push_back(getAttrOrDefault(pipe, _Unicode(theta), 0)); + rOuters1.push_back(getAttrOrDefault(pipe, _Unicode(rout1), 0)); + rOuters2.push_back(getAttrOrDefault(pipe, _Unicode(rout2), 0)); } // Calculate parameters for connecting pipes in between magnets @@ -70,17 +70,19 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / continue; } // can't create pipe for an empty end slot - double previousPipeEndX = xCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * sin(thetas[pipeN - 1]); - double previousPipeEndZ = zCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * cos(thetas[pipeN - 1]); - double nextPipeStartX = xCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * sin(thetas[pipeN + 1]); - double nextPipeStartZ = zCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * cos(thetas[pipeN + 1]); + double previousPipeEndX = + xCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * sin(thetas[pipeN - 1]); + double previousPipeEndZ = + zCenters[pipeN - 1] - lengths[pipeN - 1] / 2. * cos(thetas[pipeN - 1]); + double nextPipeStartX = xCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * sin(thetas[pipeN + 1]); + double nextPipeStartZ = zCenters[pipeN + 1] + lengths[pipeN + 1] / 2. * cos(thetas[pipeN + 1]); - double x = (previousPipeEndX + nextPipeStartX) / 2.; - double z = (previousPipeEndZ + nextPipeStartZ) / 2.; + double x = (previousPipeEndX + nextPipeStartX) / 2.; + double z = (previousPipeEndZ + nextPipeStartZ) / 2.; double deltaX = previousPipeEndX - nextPipeStartX; double deltaZ = previousPipeEndZ - nextPipeStartZ; - double l = sqrt(deltaX * deltaX + deltaZ * deltaZ); - double theta = atan2(deltaX,deltaZ); + double l = sqrt(deltaX * deltaX + deltaZ * deltaZ); + double theta = atan2(deltaX, deltaZ); xCenters[pipeN] = x; zCenters[pipeN] = z; @@ -91,22 +93,17 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / } // If there is an bend in the pipe, calculate the length reduction of the pipe and joint length - for (uint i = 1; i < thetas.size(); i++) - { - // Start at the join between the first two pipes ending at the join between the last two pipes N-1 - if(thetas[i-1] == thetas[i]) - { + for (uint i = 1; i < thetas.size(); i++) { + // Start at the join between the first two pipes ending at the join between the last two pipes N-1 + if (thetas[i - 1] == thetas[i]) { bendLengths.push_back(0); - } - else // Correct for tubes, not yet cones so imperfect + } else // Correct for tubes, not yet cones so imperfect { - double bendAngle = thetas[i] - thetas[i-1]; - double bendLength = abs(rOuters1[i] * tan(bendAngle/2)); - bendLengths.push_back(bendLength+bendRadius); + double bendAngle = thetas[i] - thetas[i - 1]; + double bendLength = abs(rOuters1[i] * tan(bendAngle / 2)); + bendLengths.push_back(bendLength + bendRadius); } - } - // Add all pipes to the assembly for (uint pipeN = 0; pipeN < xCenters.size(); pipeN++) { @@ -119,79 +116,69 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / double rOuter2 = rOuters2[pipeN]; //Change straight pipe length to account for bend - if(pipeN!=0) - { - length -= bendLengths[pipeN-1]; - xCenter -= bendLengths[pipeN-1]/2*sin(theta); - zCenter -= bendLengths[pipeN-1]/2*cos(theta); + if (pipeN != 0) { + length -= bendLengths[pipeN - 1]; + xCenter -= bendLengths[pipeN - 1] / 2 * sin(theta); + zCenter -= bendLengths[pipeN - 1] / 2 * cos(theta); } - if(pipeN!=xCenters.size()-1) - { - length -= bendLengths[pipeN]; - xCenter += bendLengths[pipeN]/2*sin(theta); - zCenter += bendLengths[pipeN]/2*cos(theta); + if (pipeN != xCenters.size() - 1) { + length -= bendLengths[pipeN]; + xCenter += bendLengths[pipeN] / 2 * sin(theta); + zCenter += bendLengths[pipeN] / 2 * cos(theta); } - ConeSegment s_tube(length / 2.0, rOuter2 - thickness, rOuter2, - rOuter1 - thickness, rOuter1); - ConeSegment s_vacuum(length / 2.0, 0, rOuter2 - thickness, 0, - rOuter1 - thickness); + ConeSegment s_tube(length / 2.0, rOuter2 - thickness, rOuter2, rOuter1 - thickness, rOuter1); + ConeSegment s_vacuum(length / 2.0, 0, rOuter2 - thickness, 0, rOuter1 - thickness); Volume v_tube("v_tube_" + names[pipeN], s_tube, m_Al); Volume v_vacuum("v_vacuum_" + names[pipeN], s_vacuum, m_Vacuum); v_tube.setVisAttributes(description.visAttributes(vis_name)); - assembly.placeVolume(v_tube, Transform3D(RotationY(theta), - Position(xCenter, 0, zCenter))); - auto placed_vacuum = - assembly.placeVolume(v_vacuum, Transform3D(RotationY(theta), - Position(xCenter, 0, zCenter))); + assembly.placeVolume(v_tube, Transform3D(RotationY(theta), Position(xCenter, 0, zCenter))); + auto placed_vacuum = assembly.placeVolume( + v_vacuum, Transform3D(RotationY(theta), Position(xCenter, 0, zCenter))); DetElement vacuum_element(sdet, names[pipeN] + "_vacuum", ids[pipeN]); vacuum_element.setPlacement(placed_vacuum); // // Add joining bend to next pipe - if(pipeN!=xCenters.size()-1 && bendLengths[pipeN]!=0){ + if (pipeN != xCenters.size() - 1 && bendLengths[pipeN] != 0) { // double bendLength = bendLengths[pipeN]; - double bendAngle = thetas[pipeN+1] - thetas[pipeN]; + double bendAngle = thetas[pipeN + 1] - thetas[pipeN]; // Create a torus to join the two pipes - Torus s_bend_solid(rOuter2+bendRadius, rOuter2-thickness,rOuter2, 0.0,abs(bendAngle)); + Torus s_bend_solid(rOuter2 + bendRadius, rOuter2 - thickness, rOuter2, 0.0, abs(bendAngle)); //Create a vacuum torus to place inside the solid segment - Torus s_bend_vac(rOuter2+bendRadius, 0, rOuter2-thickness, 0, abs(bendAngle)); + Torus s_bend_vac(rOuter2 + bendRadius, 0, rOuter2 - thickness, 0, abs(bendAngle)); // //Create the volumes Volume v_bend_soild("v_bend_solid_" + names[pipeN], s_bend_solid, m_Al); - Volume v_bend_vac("v_bend_vac_" + names[pipeN], s_bend_vac, m_Vacuum); + Volume v_bend_vac("v_bend_vac_" + names[pipeN], s_bend_vac, m_Vacuum); // Calculate the position and rotation to place bend at the joint - double bendCenterX = xCenter + rOuter2*cos(theta) - (length/2)*sin(theta); - double bendCenterZ = zCenter - rOuter2*sin(theta) - (length/2)*cos(theta); - double rotation = pi-theta; - if(bendAngle>0) - { - bendCenterX = xCenter - rOuter2*cos(theta) - (length/2)*sin(theta); - bendCenterZ = zCenter + rOuter2*sin(theta) - (length/2)*cos(theta); - rotation = -bendAngle-theta; + double bendCenterX = xCenter + rOuter2 * cos(theta) - (length / 2) * sin(theta); + double bendCenterZ = zCenter - rOuter2 * sin(theta) - (length / 2) * cos(theta); + double rotation = pi - theta; + if (bendAngle > 0) { + bendCenterX = xCenter - rOuter2 * cos(theta) - (length / 2) * sin(theta); + bendCenterZ = zCenter + rOuter2 * sin(theta) - (length / 2) * cos(theta); + rotation = -bendAngle - theta; } // Place the bend in the assembly - assembly.placeVolume(v_bend_soild, Transform3D(RotationZYX(rotation,0,pi/2), Position(bendCenterX, 0, bendCenterZ))); - assembly.placeVolume(v_bend_vac, Transform3D(RotationZYX(rotation,0,pi/2), Position(bendCenterX, 0, bendCenterZ))); + assembly.placeVolume(v_bend_soild, Transform3D(RotationZYX(rotation, 0, pi / 2), + Position(bendCenterX, 0, bendCenterZ))); + assembly.placeVolume(v_bend_vac, Transform3D(RotationZYX(rotation, 0, pi / 2), + Position(bendCenterX, 0, bendCenterZ))); // Set vis attributes - v_bend_soild.setVisAttributes(description.visAttributes(vis_name)); - + v_bend_soild.setVisAttributes(description.visAttributes(vis_name)); } - - - } - // Final placement auto pv_assembly = description.pickMotherVolume(sdet).placeVolume(assembly, Position(0.0, 0.0, 0.0)); From 8512aa7e323657592bfb8b56655fbd0145945bf1 Mon Sep 17 00:00:00 2001 From: simonge Date: Mon, 3 Mar 2025 14:36:55 +0000 Subject: [PATCH 04/25] Changes for 6.3.1 lattice --- compact/far_backward/definitions.xml | 48 +++++++++++++++------------- compact/far_backward/magnets.xml | 27 ++++++---------- compact/fields/beamline_18x275.xml | 10 +++--- 3 files changed, 39 insertions(+), 46 deletions(-) diff --git a/compact/far_backward/definitions.xml b/compact/far_backward/definitions.xml index bfd863ee8c..063d44037e 100644 --- a/compact/far_backward/definitions.xml +++ b/compact/far_backward/definitions.xml @@ -14,31 +14,33 @@ Electron magnet dimensions and positions - - + + - + - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + Note: Placements for Q4eR, B3eR, B4eR, B5eR, B6eR, B7eR are approximate (valid to within ~1 cm). @@ -184,7 +186,7 @@ Dipole focal point in global coordinates - + Central pipe dimensions @@ -195,7 +197,7 @@ Entry box joining magnets, lumi and tagger systems - + Timepix4 ASIC dimensions @@ -209,8 +211,8 @@ - - + + @@ -220,7 +222,7 @@ - + @@ -231,7 +233,7 @@ - + diff --git a/compact/far_backward/magnets.xml b/compact/far_backward/magnets.xml index 1fe53f8d30..8f3b5282a4 100644 --- a/compact/far_backward/magnets.xml +++ b/compact/far_backward/magnets.xml @@ -37,8 +37,8 @@ @@ -59,28 +59,19 @@ - - - - - - - - + - - - + + + + + + diff --git a/compact/fields/beamline_18x275.xml b/compact/fields/beamline_18x275.xml index 3e1f2c6347..43cf7a9672 100644 --- a/compact/fields/beamline_18x275.xml +++ b/compact/fields/beamline_18x275.xml @@ -16,12 +16,12 @@ - - - + + + - - + + From 9ef68c9414f0b2b37f589a911893e04290bb996d Mon Sep 17 00:00:00 2001 From: simonge Date: Mon, 3 Mar 2025 15:04:00 +0000 Subject: [PATCH 05/25] Updated all configurations --- compact/fields/beamline_10x100.xml | 13 ++++++------- compact/fields/beamline_10x110_H2.xml | 11 +++++------ compact/fields/beamline_10x275.xml | 13 ++++++------- compact/fields/beamline_18x110_Au.xml | 13 ++++++------- compact/fields/beamline_18x110_H2.xml | 13 ++++++------- compact/fields/beamline_18x110_He3.xml | 13 ++++++------- compact/fields/beamline_18x110_Pb.xml | 13 ++++++------- compact/fields/beamline_18x275.xml | 6 ++---- compact/fields/beamline_5x100.xml | 13 ++++++------- compact/fields/beamline_5x110_H2.xml | 13 ++++++------- compact/fields/beamline_5x41.xml | 13 ++++++------- compact/fields/beamline_5x41_H2.xml | 13 ++++++------- compact/fields/beamline_5x41_He3.xml | 13 ++++++------- compact/fields/beamline_5x41_He4.xml | 13 ++++++------- 14 files changed, 79 insertions(+), 94 deletions(-) diff --git a/compact/fields/beamline_10x100.xml b/compact/fields/beamline_10x100.xml index 174e6cbeac..48d4b2dd62 100644 --- a/compact/fields/beamline_10x100.xml +++ b/compact/fields/beamline_10x100.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_10x110_H2.xml b/compact/fields/beamline_10x110_H2.xml index 47f6eee522..270e8e9d9d 100644 --- a/compact/fields/beamline_10x110_H2.xml +++ b/compact/fields/beamline_10x110_H2.xml @@ -14,14 +14,13 @@ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_10x275.xml b/compact/fields/beamline_10x275.xml index e8a790ecbf..3e922e8d3f 100644 --- a/compact/fields/beamline_10x275.xml +++ b/compact/fields/beamline_10x275.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_18x110_Au.xml b/compact/fields/beamline_18x110_Au.xml index 78800577e8..c96263d1c5 100644 --- a/compact/fields/beamline_18x110_Au.xml +++ b/compact/fields/beamline_18x110_Au.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_18x110_H2.xml b/compact/fields/beamline_18x110_H2.xml index 23c5b4c90c..fb6e735ab7 100644 --- a/compact/fields/beamline_18x110_H2.xml +++ b/compact/fields/beamline_18x110_H2.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_18x110_He3.xml b/compact/fields/beamline_18x110_He3.xml index 899b830eb3..f10825f979 100644 --- a/compact/fields/beamline_18x110_He3.xml +++ b/compact/fields/beamline_18x110_He3.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_18x110_Pb.xml b/compact/fields/beamline_18x110_Pb.xml index eee1d8ea46..c2b8c85850 100644 --- a/compact/fields/beamline_18x110_Pb.xml +++ b/compact/fields/beamline_18x110_Pb.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_18x275.xml b/compact/fields/beamline_18x275.xml index 43cf7a9672..f7e687bc73 100644 --- a/compact/fields/beamline_18x275.xml +++ b/compact/fields/beamline_18x275.xml @@ -10,24 +10,22 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - + - Forward Fields All magnet values are input by hand and represent the implementation in EICRoot used for the Yellow Report. diff --git a/compact/fields/beamline_5x100.xml b/compact/fields/beamline_5x100.xml index 0a35ef845b..6c107e1ec9 100644 --- a/compact/fields/beamline_5x100.xml +++ b/compact/fields/beamline_5x100.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_5x110_H2.xml b/compact/fields/beamline_5x110_H2.xml index 7669f7f119..3cb4bc54bd 100644 --- a/compact/fields/beamline_5x110_H2.xml +++ b/compact/fields/beamline_5x110_H2.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_5x41.xml b/compact/fields/beamline_5x41.xml index 1b8a4f0d1b..a8dc1196dd 100644 --- a/compact/fields/beamline_5x41.xml +++ b/compact/fields/beamline_5x41.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_5x41_H2.xml b/compact/fields/beamline_5x41_H2.xml index 101fb0ac42..f6a8afa92a 100644 --- a/compact/fields/beamline_5x41_H2.xml +++ b/compact/fields/beamline_5x41_H2.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_5x41_He3.xml b/compact/fields/beamline_5x41_He3.xml index b7ada81616..458fe8508b 100644 --- a/compact/fields/beamline_5x41_He3.xml +++ b/compact/fields/beamline_5x41_He3.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + diff --git a/compact/fields/beamline_5x41_He4.xml b/compact/fields/beamline_5x41_He4.xml index 21e8abf834..0cc969af8a 100644 --- a/compact/fields/beamline_5x41_He4.xml +++ b/compact/fields/beamline_5x41_He4.xml @@ -10,18 +10,17 @@ Backwards Fields - Values taken from: https://indico.bnl.gov/event/10974/contributions/51260/ + Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy - - - - + + + - - + + From 72ba3818a58e2a56fdb436e7a243ce1317ca2bdf Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 5 Mar 2025 13:43:23 +0000 Subject: [PATCH 06/25] Update some of the extension --- .../beamline_extension_electron.xml | 34 +++++----- compact/far_backward/definitions.xml | 63 +++++++++++-------- compact/far_backward/magnets.xml | 11 +++- 3 files changed, 66 insertions(+), 42 deletions(-) diff --git a/compact/far_backward/beamline_extension_electron.xml b/compact/far_backward/beamline_extension_electron.xml index e1346df240..f361ba1a1b 100644 --- a/compact/far_backward/beamline_extension_electron.xml +++ b/compact/far_backward/beamline_extension_electron.xml @@ -16,44 +16,50 @@ name="Pipe_Q3eR_to_B7eR" type="BeamPipeChain" wall_thickness="2*mm"> - + + + - - + - - + - - + - - + - - + - - + diff --git a/compact/far_backward/definitions.xml b/compact/far_backward/definitions.xml index 063d44037e..301c72093a 100644 --- a/compact/far_backward/definitions.xml +++ b/compact/far_backward/definitions.xml @@ -32,25 +32,36 @@ - - - - - - - - - - - Note: Placements for Q4eR, B3eR, B4eR, B5eR, B6eR, B7eR - are approximate (valid to within ~1 cm). - Should be updated with detailed input from the accelerator group - - - - + + + + + + + + + + + Electron Beamline Extension + + + + + + + + + + + + + + + + + - + @@ -177,7 +188,7 @@ - + @@ -186,13 +197,13 @@ Dipole focal point in global coordinates - + Central pipe dimensions - - - - + + + + Entry box joining magnets, lumi and tagger systems @@ -213,7 +224,7 @@ - + @@ -224,7 +235,7 @@ - + diff --git a/compact/far_backward/magnets.xml b/compact/far_backward/magnets.xml index 8f3b5282a4..1276592677 100644 --- a/compact/far_backward/magnets.xml +++ b/compact/far_backward/magnets.xml @@ -66,9 +66,15 @@ + + + + + + - + @@ -96,7 +102,8 @@ - + + From 77ce7f7b638bd98b00bc3e9f8b1f661a348dfd3d Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 5 Mar 2025 14:41:45 +0000 Subject: [PATCH 07/25] Fruther extensions --- .../beamline_extension_electron.xml | 106 ++++++++++-------- compact/far_backward/beamline_tracking.xml | 10 +- compact/far_backward/definitions.xml | 74 ++++++------ 3 files changed, 103 insertions(+), 87 deletions(-) diff --git a/compact/far_backward/beamline_extension_electron.xml b/compact/far_backward/beamline_extension_electron.xml index f361ba1a1b..e60e216a1a 100644 --- a/compact/far_backward/beamline_extension_electron.xml +++ b/compact/far_backward/beamline_extension_electron.xml @@ -11,9 +11,9 @@ Electron side extended beam pipe volumes - + + rout1="Q3eR_InnerRadius" rout2="Q3eR_InnerRadius" + limits="kill_limits"> + + + - - + - - + + + + + + + - - - - - - - - + + - - + + @@ -72,29 +84,33 @@ name="Magnets_Q4eR_to_B7eR" type="CylindricalMagnetChain" vis="RedVis"> - + + - + - + - + - + - + diff --git a/compact/far_backward/beamline_tracking.xml b/compact/far_backward/beamline_tracking.xml index f2f4b601f1..965c4de4ec 100644 --- a/compact/far_backward/beamline_tracking.xml +++ b/compact/far_backward/beamline_tracking.xml @@ -40,20 +40,20 @@ @@ -62,8 +62,8 @@ diff --git a/compact/far_backward/definitions.xml b/compact/far_backward/definitions.xml index 301c72093a..b962b19d62 100644 --- a/compact/far_backward/definitions.xml +++ b/compact/far_backward/definitions.xml @@ -51,54 +51,54 @@ - - + + - - + + - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + Hadron magnet dimensions and positions From d74bc4e227a9b4b05292c63e5aa68988994682b2 Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 5 Mar 2025 14:59:51 +0000 Subject: [PATCH 08/25] Added and fixed remaining beamline extension --- .../beamline_extension_electron.xml | 78 +++++++++++++++---- compact/far_backward/definitions.xml | 37 ++++++++- 2 files changed, 97 insertions(+), 18 deletions(-) diff --git a/compact/far_backward/beamline_extension_electron.xml b/compact/far_backward/beamline_extension_electron.xml index e60e216a1a..d7075a23c9 100644 --- a/compact/far_backward/beamline_extension_electron.xml +++ b/compact/far_backward/beamline_extension_electron.xml @@ -25,36 +25,31 @@ + rout1="Q3eR_InnerRadius" rout2="Q3eR_InnerRadius"> + rout1="SQ4eR_InnerRadius" rout2="SQ4eR_InnerRadius"> + rout1="Q4eR_InnerRadius" rout2="Q4eR_InnerRadius"> + rout1="SQ5eR_InnerRadius" rout2="SQ5eR_InnerRadius"> + rout1="Q5eR_InnerRadius" rout2="Q5eR_InnerRadius"> - + rout1="SQ6eR_InnerRadius" rout2="SQ6eR_InnerRadius"> - - + + rout1="Q6eR_InnerRadius" rout2="Q6eR_InnerRadius"> + + + + + + + + + + + + + + + @@ -112,6 +135,27 @@ x="Q6eR_CenterX" y="0" z="Q6eR_CenterZ" theta="Q6eR_Theta" length="Q6eR_Length" rin="Q6eR_InnerRadius" rout="Q6eR_OuterRadius"> + + + + + + + + + + + diff --git a/compact/far_backward/definitions.xml b/compact/far_backward/definitions.xml index b962b19d62..94cfcb4f38 100644 --- a/compact/far_backward/definitions.xml +++ b/compact/far_backward/definitions.xml @@ -94,12 +94,47 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hadron magnet dimensions and positions From 7e79898d53cbb75fb2a30c2a94b4d72acecadeb1 Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 5 Mar 2025 15:41:04 +0000 Subject: [PATCH 09/25] Fix visualization --- compact/far_backward/beamline_extension_electron.xml | 2 +- compact/far_backward/beamline_extension_hadron.xml | 2 +- src/CylindricalMagnetChain_geo.cpp | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/compact/far_backward/beamline_extension_electron.xml b/compact/far_backward/beamline_extension_electron.xml index d7075a23c9..34a1f5476d 100644 --- a/compact/far_backward/beamline_extension_electron.xml +++ b/compact/far_backward/beamline_extension_electron.xml @@ -106,7 +106,7 @@ + vis="FFMagnetVis"> diff --git a/compact/far_backward/beamline_extension_hadron.xml b/compact/far_backward/beamline_extension_hadron.xml index 4be55c4df4..765e1b6d03 100644 --- a/compact/far_backward/beamline_extension_hadron.xml +++ b/compact/far_backward/beamline_extension_hadron.xml @@ -13,7 +13,7 @@ Hadron side beam magnet volumes - + diff --git a/src/CylindricalMagnetChain_geo.cpp b/src/CylindricalMagnetChain_geo.cpp index 607a575f96..0de2fdc02b 100644 --- a/src/CylindricalMagnetChain_geo.cpp +++ b/src/CylindricalMagnetChain_geo.cpp @@ -33,6 +33,7 @@ static Ref_t create_magnet(Detector& description, xml_h e, SensitiveDetector /* xml_comp_t magnet(magnet_coll); string name = getAttrOrDefault(magnet, _Unicode(name), ""); + int id = getAttrOrDefault(magnet, _Unicode(id), 0); double x = getAttrOrDefault(magnet, _Unicode(x), 0); double y = getAttrOrDefault(magnet, _Unicode(y), 0); double z = getAttrOrDefault(magnet, _Unicode(z), 0); @@ -45,9 +46,14 @@ static Ref_t create_magnet(Detector& description, xml_h e, SensitiveDetector /* Tube yoke_tube(rin, rout, 0.5 * length); Volume v_yoke("v_yoke_" + name, yoke_tube, m_Iron); - v_yoke.setVisAttributes(description.visAttributes(vis_name)); + v_yoke.setVisAttributes(x_det.visStr()); + + auto yoke_pv = assembly.placeVolume(v_yoke, Transform3D(RotationY(theta), Position(x, y, z))); - assembly.placeVolume(v_yoke, Transform3D(RotationY(theta), Position(x, y, z))); + yoke_pv.addPhysVolID("element", id); + DetElement yoke_de(sdet, name, id); + yoke_de.setPlacement(yoke_pv); + yoke_de.setAttributes(description, v_yoke, x_det.regionStr(), x_det.limitsStr(), vis_name); } // Final placement From 051ae3d59f25d7fad4525054b7f500784193fafd Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 5 Mar 2025 16:10:45 +0000 Subject: [PATCH 10/25] Add visualization of FF electron magnets --- compact/far_forward/electron_beamline.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compact/far_forward/electron_beamline.xml b/compact/far_forward/electron_beamline.xml index 88f4642019..57ab817767 100644 --- a/compact/far_forward/electron_beamline.xml +++ b/compact/far_forward/electron_beamline.xml @@ -56,7 +56,7 @@ - + @@ -72,7 +72,7 @@ - + From c8846eacbf07f9871842a3de4dd66f00f56b4bc2 Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 5 Mar 2025 17:48:39 +0000 Subject: [PATCH 11/25] Make beamline magnet calculation more transparent --- compact/far_backward/definitions.xml | 2 +- compact/fields/beamline_10x100.xml | 15 ++++++++++----- compact/fields/beamline_10x110_H2.xml | 15 ++++++++++----- compact/fields/beamline_10x275.xml | 15 ++++++++++----- compact/fields/beamline_18x110_Au.xml | 15 ++++++++++----- compact/fields/beamline_18x110_H2.xml | 15 ++++++++++----- compact/fields/beamline_18x110_He3.xml | 15 ++++++++++----- compact/fields/beamline_18x110_Pb.xml | 15 ++++++++++----- compact/fields/beamline_18x275.xml | 16 +++++++++++----- compact/fields/beamline_5x100.xml | 15 ++++++++++----- compact/fields/beamline_5x110_H2.xml | 15 ++++++++++----- compact/fields/beamline_5x41.xml | 15 ++++++++++----- compact/fields/beamline_5x41_H2.xml | 15 ++++++++++----- compact/fields/beamline_5x41_He3.xml | 15 ++++++++++----- compact/fields/beamline_5x41_He4.xml | 15 ++++++++++----- templates/epic.xml.jinja2 | 2 +- 16 files changed, 143 insertions(+), 72 deletions(-) diff --git a/compact/far_backward/definitions.xml b/compact/far_backward/definitions.xml index 94cfcb4f38..3c80a6b3ca 100644 --- a/compact/far_backward/definitions.xml +++ b/compact/far_backward/definitions.xml @@ -15,7 +15,7 @@ Electron magnet dimensions and positions - + diff --git a/compact/fields/beamline_10x100.xml b/compact/fields/beamline_10x100.xml index 48d4b2dd62..8076cf78c1 100644 --- a/compact/fields/beamline_10x100.xml +++ b/compact/fields/beamline_10x100.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_10x110_H2.xml b/compact/fields/beamline_10x110_H2.xml index 270e8e9d9d..898e493394 100644 --- a/compact/fields/beamline_10x110_H2.xml +++ b/compact/fields/beamline_10x110_H2.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_10x275.xml b/compact/fields/beamline_10x275.xml index 3e922e8d3f..f0fdd70d33 100644 --- a/compact/fields/beamline_10x275.xml +++ b/compact/fields/beamline_10x275.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_18x110_Au.xml b/compact/fields/beamline_18x110_Au.xml index c96263d1c5..b51580909e 100644 --- a/compact/fields/beamline_18x110_Au.xml +++ b/compact/fields/beamline_18x110_Au.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_18x110_H2.xml b/compact/fields/beamline_18x110_H2.xml index fb6e735ab7..872e494aa6 100644 --- a/compact/fields/beamline_18x110_H2.xml +++ b/compact/fields/beamline_18x110_H2.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_18x110_He3.xml b/compact/fields/beamline_18x110_He3.xml index f10825f979..c77989830e 100644 --- a/compact/fields/beamline_18x110_He3.xml +++ b/compact/fields/beamline_18x110_He3.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_18x110_Pb.xml b/compact/fields/beamline_18x110_Pb.xml index c2b8c85850..65f5cb8189 100644 --- a/compact/fields/beamline_18x110_Pb.xml +++ b/compact/fields/beamline_18x110_Pb.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_18x275.xml b/compact/fields/beamline_18x275.xml index f7e687bc73..ae3a0d06f3 100644 --- a/compact/fields/beamline_18x275.xml +++ b/compact/fields/beamline_18x275.xml @@ -12,15 +12,21 @@ Backwards Fields Values taken from: https://brookhavenlab.sharepoint.com/:f:/r/sites/eRHIC/bnl%26slac/Shared%20Documents/Version-6.3/ Relevent values in the tables scale linearly with beam energy + - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_5x100.xml b/compact/fields/beamline_5x100.xml index 6c107e1ec9..7a3ab54d82 100644 --- a/compact/fields/beamline_5x100.xml +++ b/compact/fields/beamline_5x100.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_5x110_H2.xml b/compact/fields/beamline_5x110_H2.xml index 3cb4bc54bd..4b34b4ca12 100644 --- a/compact/fields/beamline_5x110_H2.xml +++ b/compact/fields/beamline_5x110_H2.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_5x41.xml b/compact/fields/beamline_5x41.xml index a8dc1196dd..03564cae39 100644 --- a/compact/fields/beamline_5x41.xml +++ b/compact/fields/beamline_5x41.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_5x41_H2.xml b/compact/fields/beamline_5x41_H2.xml index f6a8afa92a..83426a423f 100644 --- a/compact/fields/beamline_5x41_H2.xml +++ b/compact/fields/beamline_5x41_H2.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_5x41_He3.xml b/compact/fields/beamline_5x41_He3.xml index 458fe8508b..51c345f33e 100644 --- a/compact/fields/beamline_5x41_He3.xml +++ b/compact/fields/beamline_5x41_He3.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_5x41_He4.xml b/compact/fields/beamline_5x41_He4.xml index 0cc969af8a..34e12fb9d2 100644 --- a/compact/fields/beamline_5x41_He4.xml +++ b/compact/fields/beamline_5x41_He4.xml @@ -15,12 +15,17 @@ - - - + + + + + + - - + + + + diff --git a/templates/epic.xml.jinja2 b/templates/epic.xml.jinja2 index c3729f8f5f..8ea64b7a6f 100644 --- a/templates/epic.xml.jinja2 +++ b/templates/epic.xml.jinja2 @@ -44,9 +44,9 @@ The ip6 (or other ip) defines should be included first. These files have only a define tags. - + From 048a90b89330477533da445fb1a02d204b620cb5 Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 5 Mar 2025 18:02:19 +0000 Subject: [PATCH 12/25] Fix unit conversions --- compact/fields/beamline_10x100.xml | 10 +++++----- compact/fields/beamline_10x110_H2.xml | 10 +++++----- compact/fields/beamline_10x275.xml | 10 +++++----- compact/fields/beamline_18x110_Au.xml | 10 +++++----- compact/fields/beamline_18x110_H2.xml | 8 ++++---- compact/fields/beamline_18x110_He3.xml | 10 +++++----- compact/fields/beamline_18x110_Pb.xml | 10 +++++----- compact/fields/beamline_18x275.xml | 10 +++++----- compact/fields/beamline_5x100.xml | 10 +++++----- compact/fields/beamline_5x110_H2.xml | 10 +++++----- compact/fields/beamline_5x41.xml | 10 +++++----- compact/fields/beamline_5x41_H2.xml | 10 +++++----- compact/fields/beamline_5x41_He3.xml | 10 +++++----- compact/fields/beamline_5x41_He4.xml | 10 +++++----- 14 files changed, 69 insertions(+), 69 deletions(-) diff --git a/compact/fields/beamline_10x100.xml b/compact/fields/beamline_10x100.xml index 8076cf78c1..5595738402 100644 --- a/compact/fields/beamline_10x100.xml +++ b/compact/fields/beamline_10x100.xml @@ -18,14 +18,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_10x110_H2.xml b/compact/fields/beamline_10x110_H2.xml index 898e493394..14da3d1f3e 100644 --- a/compact/fields/beamline_10x110_H2.xml +++ b/compact/fields/beamline_10x110_H2.xml @@ -18,14 +18,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_10x275.xml b/compact/fields/beamline_10x275.xml index f0fdd70d33..7cca64be79 100644 --- a/compact/fields/beamline_10x275.xml +++ b/compact/fields/beamline_10x275.xml @@ -18,14 +18,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_18x110_Au.xml b/compact/fields/beamline_18x110_Au.xml index b51580909e..efbb80d563 100644 --- a/compact/fields/beamline_18x110_Au.xml +++ b/compact/fields/beamline_18x110_Au.xml @@ -18,14 +18,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_18x110_H2.xml b/compact/fields/beamline_18x110_H2.xml index 872e494aa6..3bf2825aae 100644 --- a/compact/fields/beamline_18x110_H2.xml +++ b/compact/fields/beamline_18x110_H2.xml @@ -18,14 +18,14 @@ - - + + - - + + diff --git a/compact/fields/beamline_18x110_He3.xml b/compact/fields/beamline_18x110_He3.xml index c77989830e..781ed0a469 100644 --- a/compact/fields/beamline_18x110_He3.xml +++ b/compact/fields/beamline_18x110_He3.xml @@ -18,14 +18,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_18x110_Pb.xml b/compact/fields/beamline_18x110_Pb.xml index 65f5cb8189..cd8dedaf2b 100644 --- a/compact/fields/beamline_18x110_Pb.xml +++ b/compact/fields/beamline_18x110_Pb.xml @@ -18,14 +18,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_18x275.xml b/compact/fields/beamline_18x275.xml index ae3a0d06f3..8429ff91a1 100644 --- a/compact/fields/beamline_18x275.xml +++ b/compact/fields/beamline_18x275.xml @@ -19,14 +19,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_5x100.xml b/compact/fields/beamline_5x100.xml index 7a3ab54d82..fa93caf323 100644 --- a/compact/fields/beamline_5x100.xml +++ b/compact/fields/beamline_5x100.xml @@ -18,14 +18,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_5x110_H2.xml b/compact/fields/beamline_5x110_H2.xml index 4b34b4ca12..f6a794e5a3 100644 --- a/compact/fields/beamline_5x110_H2.xml +++ b/compact/fields/beamline_5x110_H2.xml @@ -18,14 +18,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_5x41.xml b/compact/fields/beamline_5x41.xml index 03564cae39..56f4692551 100644 --- a/compact/fields/beamline_5x41.xml +++ b/compact/fields/beamline_5x41.xml @@ -18,14 +18,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_5x41_H2.xml b/compact/fields/beamline_5x41_H2.xml index 83426a423f..cf390e75d2 100644 --- a/compact/fields/beamline_5x41_H2.xml +++ b/compact/fields/beamline_5x41_H2.xml @@ -18,14 +18,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_5x41_He3.xml b/compact/fields/beamline_5x41_He3.xml index 51c345f33e..88bfdb23f0 100644 --- a/compact/fields/beamline_5x41_He3.xml +++ b/compact/fields/beamline_5x41_He3.xml @@ -18,14 +18,14 @@ - - - + + + - - + + diff --git a/compact/fields/beamline_5x41_He4.xml b/compact/fields/beamline_5x41_He4.xml index 34e12fb9d2..fc17e01655 100644 --- a/compact/fields/beamline_5x41_He4.xml +++ b/compact/fields/beamline_5x41_He4.xml @@ -18,14 +18,14 @@ - - - + + + - - + + From d10f1e7aec7fcd253a0e37b1e5863ebb415a32b9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 09:19:36 +0000 Subject: [PATCH 13/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/CylindricalMagnetChain_geo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CylindricalMagnetChain_geo.cpp b/src/CylindricalMagnetChain_geo.cpp index 0de2fdc02b..b12497ecac 100644 --- a/src/CylindricalMagnetChain_geo.cpp +++ b/src/CylindricalMagnetChain_geo.cpp @@ -47,7 +47,7 @@ static Ref_t create_magnet(Detector& description, xml_h e, SensitiveDetector /* Volume v_yoke("v_yoke_" + name, yoke_tube, m_Iron); v_yoke.setVisAttributes(x_det.visStr()); - + auto yoke_pv = assembly.placeVolume(v_yoke, Transform3D(RotationY(theta), Position(x, y, z))); yoke_pv.addPhysVolID("element", id); From 5afbdb50cc18a6eaf761bfb754fe1cfea2027752 Mon Sep 17 00:00:00 2001 From: simonge Date: Tue, 11 Mar 2025 09:26:14 +0000 Subject: [PATCH 14/25] Updated new configurations --- compact/fields/beamline_10x115_Cu63.xml | 15 ++++++++++----- compact/fields/beamline_10x115_Ru96.xml | 15 ++++++++++----- compact/fields/beamline_10x130.xml | 15 ++++++++++----- compact/fields/beamline_10x130_H2.xml | 15 ++++++++++----- compact/fields/beamline_10x166_He3.xml | 15 ++++++++++----- compact/fields/beamline_10x250.xml | 15 ++++++++++----- 6 files changed, 60 insertions(+), 30 deletions(-) diff --git a/compact/fields/beamline_10x115_Cu63.xml b/compact/fields/beamline_10x115_Cu63.xml index a142fed400..53ece55e73 100644 --- a/compact/fields/beamline_10x115_Cu63.xml +++ b/compact/fields/beamline_10x115_Cu63.xml @@ -16,12 +16,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_10x115_Ru96.xml b/compact/fields/beamline_10x115_Ru96.xml index a142fed400..53ece55e73 100644 --- a/compact/fields/beamline_10x115_Ru96.xml +++ b/compact/fields/beamline_10x115_Ru96.xml @@ -16,12 +16,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_10x130.xml b/compact/fields/beamline_10x130.xml index fd0e7df86f..43a452dc8d 100644 --- a/compact/fields/beamline_10x130.xml +++ b/compact/fields/beamline_10x130.xml @@ -16,12 +16,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_10x130_H2.xml b/compact/fields/beamline_10x130_H2.xml index 7f84e076e1..b976009613 100644 --- a/compact/fields/beamline_10x130_H2.xml +++ b/compact/fields/beamline_10x130_H2.xml @@ -16,12 +16,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_10x166_He3.xml b/compact/fields/beamline_10x166_He3.xml index 33b21fc60c..3cf217f5bb 100644 --- a/compact/fields/beamline_10x166_He3.xml +++ b/compact/fields/beamline_10x166_He3.xml @@ -16,12 +16,17 @@ - - - + + + + + + - - + + + + diff --git a/compact/fields/beamline_10x250.xml b/compact/fields/beamline_10x250.xml index 5375f076da..1992d409cd 100644 --- a/compact/fields/beamline_10x250.xml +++ b/compact/fields/beamline_10x250.xml @@ -16,12 +16,17 @@ - - - + + + + + + - - + + + + From ad49f2d91c6502e5bd6b1ac700d5236811299295 Mon Sep 17 00:00:00 2001 From: simonge Date: Tue, 29 Apr 2025 15:53:05 +0100 Subject: [PATCH 15/25] Fix new configuration --- compact/fields/beamline_10x100_Au197.xml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/compact/fields/beamline_10x100_Au197.xml b/compact/fields/beamline_10x100_Au197.xml index 2bc72f37d8..05b0f6fe75 100644 --- a/compact/fields/beamline_10x100_Au197.xml +++ b/compact/fields/beamline_10x100_Au197.xml @@ -16,14 +16,19 @@ - - - + + + + + + - - + + + + - + From aab8f7934fb2c9fbf3c5c3ce1a3a0e3b8f2d3aee Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 18 Jun 2025 11:48:52 +0100 Subject: [PATCH 16/25] Move lumi collimator out of beampipe --- compact/far_backward/definitions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compact/far_backward/definitions.xml b/compact/far_backward/definitions.xml index 981df6c029..42b81f621b 100644 --- a/compact/far_backward/definitions.xml +++ b/compact/far_backward/definitions.xml @@ -288,7 +288,7 @@ - + From 9fa60fb290fa8659fee3adf20ca8974962f59464 Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 18 Jun 2025 11:49:42 +0100 Subject: [PATCH 17/25] Put fields definitions after far detectors --- templates/epic.xml.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/epic.xml.jinja2 b/templates/epic.xml.jinja2 index 687347a0e4..1253a6f3b5 100644 --- a/templates/epic.xml.jinja2 +++ b/templates/epic.xml.jinja2 @@ -44,10 +44,10 @@ The ip6 (or other ip) defines should be included first. These files have only a define tags. - + From 4bedb2723b691f7ad446cc80cdfb8aab528aeff1 Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 18 Jun 2025 11:53:34 +0100 Subject: [PATCH 18/25] Fix merging error --- compact/far_backward/magnets.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/compact/far_backward/magnets.xml b/compact/far_backward/magnets.xml index b5326af060..1276592677 100644 --- a/compact/far_backward/magnets.xml +++ b/compact/far_backward/magnets.xml @@ -102,11 +102,7 @@ -<<<<<<< HEAD -======= - ->>>>>>> origin/main From 2f523787df30f3fbb5828393c3dcb01726de97f1 Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 18 Jun 2025 16:16:57 +0100 Subject: [PATCH 19/25] Allow incoming rotation in tagger box --- compact/far_backward/taggers.xml | 1 + src/BackwardsTaggers_geo.cpp | 35 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/compact/far_backward/taggers.xml b/compact/far_backward/taggers.xml index 7c16fa727e..429dbff786 100644 --- a/compact/far_backward/taggers.xml +++ b/compact/far_backward/taggers.xml @@ -17,6 +17,7 @@ diff --git a/src/BackwardsTaggers_geo.cpp b/src/BackwardsTaggers_geo.cpp index 96745409dc..89fad83840 100644 --- a/src/BackwardsTaggers_geo.cpp +++ b/src/BackwardsTaggers_geo.cpp @@ -48,7 +48,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { double off = pos.z(); // Beamline rotation - xml_dim_t rot = x_det.rotation(); + double out_theta = x_det.rotation().theta(); // Beampipe thickness double wall = dd4hep::getAttrOrDefault(x_det, _Unicode(wall), 1 * mm); @@ -61,6 +61,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { double BB_MaxX = BB.xmax(); double BB_MaxY = BB.ymax(); double BB_MaxZ = BB.zmax(); + double in_theta = BB.theta(); double BB_X = abs(BB_MaxX - BB_MinX); double BB_Y = abs(BB_MaxY - BB_MinY); @@ -76,7 +77,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { double Lumi_R = EB.attr(_Unicode(lumiR)); // Maximum theta to exit the dipole from - double exitTheta = EB.attr(_Unicode(maxTheta)); + double maxTheta = EB.attr(_Unicode(maxTheta)); // Generic box for making intersection solid with double xbox = 10 * m; @@ -117,9 +118,9 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { // Theta coverage expected double thetamin = - dd4hep::getAttrOrDefault(mod, _Unicode(theta_min), 0.030 * rad) - rot.theta(); + dd4hep::getAttrOrDefault(mod, _Unicode(theta_min), 0.030 * rad) - out_theta; double thetamax = - dd4hep::getAttrOrDefault(mod, _Unicode(theta_max), 0.030 * rad) - rot.theta(); + dd4hep::getAttrOrDefault(mod, _Unicode(theta_max), 0.030 * rad) - out_theta; // Align box to max or minimum theta expected at the tagger from focal point bool max_align = dd4hep::getAttrOrDefault(mod, _Unicode(max_align), false); @@ -223,33 +224,33 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { // CutTube Lumi_Exit (0, Lumi_R, ED_Z, 0,2*pi, sin(angle),0,cos(angle), 0,0,1); // Add entry boxes to main beamline volume - Wall_Box = UnionSolid(Wall_Box, Entry_Beam_Box, Transform3D(RotationY(-rot.theta()))); - Vacuum_Box = UnionSolid(Vacuum_Box, Entry_Vacuum_Box, Transform3D(RotationY(-rot.theta()))); - Vacuum_Box = UnionSolid(Vacuum_Box, Lumi_Exit, Transform3D(RotationY(-rot.theta()))); + Wall_Box = UnionSolid(Wall_Box, Entry_Beam_Box, Transform3D(RotationY(-out_theta))); + Vacuum_Box = UnionSolid(Vacuum_Box, Entry_Vacuum_Box, Transform3D(RotationY(-out_theta))); + Vacuum_Box = UnionSolid(Vacuum_Box, Lumi_Exit, Transform3D(RotationY(-out_theta))); } //----------------------------------------------------------------- - // Restrict tagger boxes into region defined by exitTheta from the dipole magnet + // Restrict tagger boxes into region defined by maxTheta from the dipole magnet //----------------------------------------------------------------- double exitDist = BB_MinZ - off; - double cutX = (ED_X - exitDist * tan(-rot.theta())) * cos(rot.theta()); + double cutX = (ED_X - exitDist * tan(-out_theta)) * cos(out_theta); double cutZ = - (ED_X - exitDist * tan(-rot.theta())) * sin(rot.theta()) + exitDist * cos(rot.theta()); - double cutXwall = (ED_X - wall - exitDist * tan(-rot.theta())) * cos(rot.theta()); + (ED_X - exitDist * tan(-out_theta)) * sin(out_theta) + exitDist * cos(out_theta); + double cutXwall = (ED_X - wall - exitDist * tan(-out_theta)) * cos(out_theta); double cutZwall = - (ED_X - wall - exitDist * tan(-rot.theta())) * sin(rot.theta()) + exitDist * cos(rot.theta()); + (ED_X - wall - exitDist * tan(-out_theta)) * sin(out_theta) + exitDist * cos(out_theta); Wall_Box = IntersectionSolid(Wall_Box, Cut_Box, - Transform3D(RotationY(exitTheta), Position(xbox - cutX, 0, cutZ))); + Transform3D(RotationY(maxTheta), Position(xbox - cutX, 0, cutZ))); Vacuum_Box = IntersectionSolid(Vacuum_Box, Cut_Box, - Transform3D(RotationY(exitTheta), Position(xbox - cutXwall, 0, cutZwall))); + Transform3D(RotationY(maxTheta), Position(xbox - cutXwall, 0, cutZwall))); //----------------------------------------------------------------- // Cut solids so they are only in the far backwards box //----------------------------------------------------------------- - RotationY rotate2(-rot.theta()); - Position position(0, 0, (exitDist - BB_Z) / cos(rot.theta())); + RotationY rotate2(in_theta-out_theta); + Position position(0, 0, (exitDist - BB_Z) / cos(out_theta-in_theta)); IntersectionSolid Wall_Box_Sub(Wall_Box, Far_Backwards_Box, Transform3D(rotate2, position)); IntersectionSolid Vacuum_Box_Sub(Vacuum_Box, Far_Backwards_Box, Transform3D(rotate2, position)); @@ -271,7 +272,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { backAssembly.placeVolume(DetAssemblyAir); // placement in mother volume - Transform3D tr(RotationY(rot.theta()), Position(pos.x(), pos.y(), pos.z())); + Transform3D tr(RotationY(out_theta), Position(pos.x(), pos.y(), pos.z())); PlacedVolume detPV = desc.pickMotherVolume(det).placeVolume(backAssembly, tr); detPV.addPhysVolID("system", detID); From e3be88aa53f3f9fb2b61c4491d1561d97e1f9d35 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 15:17:26 +0000 Subject: [PATCH 20/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/BackwardsTaggers_geo.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/BackwardsTaggers_geo.cpp b/src/BackwardsTaggers_geo.cpp index 89fad83840..2745470a18 100644 --- a/src/BackwardsTaggers_geo.cpp +++ b/src/BackwardsTaggers_geo.cpp @@ -48,7 +48,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { double off = pos.z(); // Beamline rotation - double out_theta = x_det.rotation().theta(); + double out_theta = x_det.rotation().theta(); // Beampipe thickness double wall = dd4hep::getAttrOrDefault(x_det, _Unicode(wall), 1 * mm); @@ -77,7 +77,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { double Lumi_R = EB.attr(_Unicode(lumiR)); // Maximum theta to exit the dipole from - double maxTheta = EB.attr(_Unicode(maxTheta)); + double maxTheta = EB.attr(_Unicode(maxTheta)); // Generic box for making intersection solid with double xbox = 10 * m; @@ -234,8 +234,7 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { //----------------------------------------------------------------- double exitDist = BB_MinZ - off; double cutX = (ED_X - exitDist * tan(-out_theta)) * cos(out_theta); - double cutZ = - (ED_X - exitDist * tan(-out_theta)) * sin(out_theta) + exitDist * cos(out_theta); + double cutZ = (ED_X - exitDist * tan(-out_theta)) * sin(out_theta) + exitDist * cos(out_theta); double cutXwall = (ED_X - wall - exitDist * tan(-out_theta)) * cos(out_theta); double cutZwall = (ED_X - wall - exitDist * tan(-out_theta)) * sin(out_theta) + exitDist * cos(out_theta); @@ -249,8 +248,8 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { //----------------------------------------------------------------- // Cut solids so they are only in the far backwards box //----------------------------------------------------------------- - RotationY rotate2(in_theta-out_theta); - Position position(0, 0, (exitDist - BB_Z) / cos(out_theta-in_theta)); + RotationY rotate2(in_theta - out_theta); + Position position(0, 0, (exitDist - BB_Z) / cos(out_theta - in_theta)); IntersectionSolid Wall_Box_Sub(Wall_Box, Far_Backwards_Box, Transform3D(rotate2, position)); IntersectionSolid Vacuum_Box_Sub(Vacuum_Box, Far_Backwards_Box, Transform3D(rotate2, position)); From efce9a58f944698c653d26c33bb95e3c00a94d17 Mon Sep 17 00:00:00 2001 From: simonge Date: Thu, 3 Jul 2025 15:31:13 +0100 Subject: [PATCH 21/25] Fixes for stuck particles --- compact/far_backward/beamline_extension_hadron.xml | 4 ++-- src/BeamPipeChain_geo.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/compact/far_backward/beamline_extension_hadron.xml b/compact/far_backward/beamline_extension_hadron.xml index 770524e14e..265aec86c7 100644 --- a/compact/far_backward/beamline_extension_hadron.xml +++ b/compact/far_backward/beamline_extension_hadron.xml @@ -58,8 +58,8 @@ type="BeamPipeChain" wall_thickness="2*mm"> Date: Thu, 3 Jul 2025 15:39:38 +0100 Subject: [PATCH 22/25] Remove debugging cout --- src/BeamPipeChain_geo.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/BeamPipeChain_geo.cpp b/src/BeamPipeChain_geo.cpp index 1595668186..1121b46d74 100644 --- a/src/BeamPipeChain_geo.cpp +++ b/src/BeamPipeChain_geo.cpp @@ -97,9 +97,6 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / for (uint i = 1; i < thetas.size(); i++) { - std::cout << "Pipe " << i<< ": " << names[i] << std::endl; - std::cout << "theta: " << thetas[i-1] << std::endl; - std::cout << "theta: " << thetas[i] << std::endl; // Start at the join between the first two pipes ending at the join between the last two pipes N-1 double bendAngle = thetas[i] - thetas[i - 1]; if (std::abs(bendAngle) < 0.00001) { @@ -108,8 +105,6 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / { double bendLength = abs(rOuters1[i] * tan(bendAngle / 2)); bendLengths.push_back(bendLength + bendRadius); - std::cout << "bendAngle: " << bendAngle << std::endl; - std::cout << "bendLength: " << bendLength << std::endl; } } From 7db751f12fd19d44828ae458b59046c48e994e31 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 14:41:26 +0000 Subject: [PATCH 23/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/BeamPipeChain_geo.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/BeamPipeChain_geo.cpp b/src/BeamPipeChain_geo.cpp index 1121b46d74..be29a8ecb2 100644 --- a/src/BeamPipeChain_geo.cpp +++ b/src/BeamPipeChain_geo.cpp @@ -84,7 +84,6 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / double l = sqrt(deltaX * deltaX + deltaZ * deltaZ); double theta = atan2(deltaX, deltaZ); - xCenters[pipeN] = x; zCenters[pipeN] = z; lengths[pipeN] = l; @@ -96,9 +95,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / // If there is an bend in the pipe, calculate the length reduction of the pipe and joint length for (uint i = 1; i < thetas.size(); i++) { - // Start at the join between the first two pipes ending at the join between the last two pipes N-1 - double bendAngle = thetas[i] - thetas[i - 1]; + double bendAngle = thetas[i] - thetas[i - 1]; if (std::abs(bendAngle) < 0.00001) { bendLengths.push_back(0); } else // Correct for tubes, not yet cones so imperfect From de1b6d9f343b1926b78c30b23246d79b55cf9b5b Mon Sep 17 00:00:00 2001 From: simonge Date: Thu, 3 Jul 2025 18:11:34 +0100 Subject: [PATCH 24/25] Actually rotate the magnetic field to match the magnet --- compact/far_backward/magnets.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compact/far_backward/magnets.xml b/compact/far_backward/magnets.xml index 1276592677..ab1451c23f 100644 --- a/compact/far_backward/magnets.xml +++ b/compact/far_backward/magnets.xml @@ -116,7 +116,8 @@ - + + From 44952f9406a42445a034bba9d196d0cb579cba9c Mon Sep 17 00:00:00 2001 From: simonge Date: Thu, 3 Jul 2025 18:12:13 +0100 Subject: [PATCH 25/25] Shrink to 5cm radius --- compact/far_backward/definitions.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compact/far_backward/definitions.xml b/compact/far_backward/definitions.xml index 42b81f621b..23ed2fe30d 100644 --- a/compact/far_backward/definitions.xml +++ b/compact/far_backward/definitions.xml @@ -22,11 +22,11 @@ - + - +