From 21d68d6ca56bd8057594537ed0a1c3313ce49467 Mon Sep 17 00:00:00 2001 From: simonge Date: Wed, 9 Oct 2024 12:19:57 +0100 Subject: [PATCH] Added track killing to beamline to speed up beam electron simulation from 3Hz to 500Hz --- compact/far_backward/beamline_extension_electron.xml | 3 ++- src/BeamPipeChain_geo.cpp | 4 ++++ templates/epic.xml.jinja2 | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/compact/far_backward/beamline_extension_electron.xml b/compact/far_backward/beamline_extension_electron.xml index 9a47d3f38..e1346df24 100644 --- a/compact/far_backward/beamline_extension_electron.xml +++ b/compact/far_backward/beamline_extension_electron.xml @@ -25,7 +25,8 @@ + rout1="Q4eR_InnerRadius" rout2="Q4eR_InnerRadius" + limits="kill_limits"> thetas; vector rOuters1; vector rOuters2; + vector limits; // Grab info for beamline magnets for (xml_coll_t pipe_coll(x_det, _Unicode(pipe)); pipe_coll; pipe_coll++) { // pipes @@ -54,6 +55,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / thetas.push_back(getAttrOrDefault(pipe, _Unicode(theta), 0)); rOuters1.push_back(getAttrOrDefault(pipe, _Unicode(rout1), 0)); rOuters2.push_back(getAttrOrDefault(pipe, _Unicode(rout2), 0)); + limits.push_back(getAttrOrDefault(pipe, _Unicode(limits), "world_limits")); + } // Calculate parameters for connecting pipes in between magnets @@ -107,6 +110,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector / Volume v_vacuum("v_vacuum_" + names[pipeN], s_vacuum, m_Vacuum); v_tube.setVisAttributes(description.visAttributes(vis_name)); + v_vacuum.setLimitSet(description,limits[pipeN]); assembly.placeVolume(v_tube, Transform3D(RotationY(thetas[pipeN]), Position(xCenters[pipeN], 0, zCenters[pipeN]))); diff --git a/templates/epic.xml.jinja2 b/templates/epic.xml.jinja2 index 0472526f2..c3729f8f5 100644 --- a/templates/epic.xml.jinja2 +++ b/templates/epic.xml.jinja2 @@ -71,6 +71,9 @@ + + +