Skip to content

Commit

Permalink
Added track killing to beamline to speed up beam electron simulation …
Browse files Browse the repository at this point in the history
…from 3Hz to 500Hz
  • Loading branch information
simonge committed Oct 9, 2024
1 parent 8db5c15 commit 21d68d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compact/far_backward/beamline_extension_electron.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<pipe id="2" name="Pipe_in_Q4eR"
xcenter="Q4eR_CenterX" zcenter="Q4eR_CenterZ"
length="Q4eR_Length" theta="Q4eR_Theta"
rout1="Q4eR_InnerRadius" rout2="Q4eR_InnerRadius">
rout1="Q4eR_InnerRadius" rout2="Q4eR_InnerRadius"
limits="kill_limits">
</pipe>
<pipe id="3" name="Pipe_Q4eR_to_B3eR"/>
<pipe id="4" name="Pipe_in_B3eR"
Expand Down
4 changes: 4 additions & 0 deletions src/BeamPipeChain_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector /
vector<double> thetas;
vector<double> rOuters1;
vector<double> rOuters2;
vector<string> limits;

// Grab info for beamline magnets
for (xml_coll_t pipe_coll(x_det, _Unicode(pipe)); pipe_coll; pipe_coll++) { // pipes
Expand All @@ -54,6 +55,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector /
thetas.push_back(getAttrOrDefault<double>(pipe, _Unicode(theta), 0));
rOuters1.push_back(getAttrOrDefault<double>(pipe, _Unicode(rout1), 0));
rOuters2.push_back(getAttrOrDefault<double>(pipe, _Unicode(rout2), 0));
limits.push_back(getAttrOrDefault<std::string>(pipe, _Unicode(limits), "world_limits"));

}

// Calculate parameters for connecting pipes in between magnets
Expand Down Expand Up @@ -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])));
Expand Down
3 changes: 3 additions & 0 deletions templates/epic.xml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
<limit name="ekin_min" particles="*" value="0.001" unit="MeV" />
<limit name="range_min" particles="*" value="0.1" unit="mm" />
</limitset>
<limitset name="kill_limits">
<limit name="time_max" particles="*" value="0.0" unit="ns"/>
</limitset>
<limitset name="cal_limits">
<limit name="step_length_max" particles="*" value="5.0" unit="mm"/>
</limitset>
Expand Down

0 comments on commit 21d68d6

Please sign in to comment.