Skip to content

feat: tighten up the world to a more minimal geometry #896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions compact/definitions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@
<documentation>
## World volume
</documentation>
<constant name="world_side" value="30*m"/>
<constant name="world_dx" value="world_side"/>
<constant name="world_dy" value="world_side"/>
<constant name="world_dz" value="100*m"/>
<constant name="backward_x0" value="0.5*m"/>
<constant name="backward_dx" value="2*m"/>
<constant name="backward_dy" value="1*m"/>
<constant name="backward_dz" value="40*m"/>
<constant name="exp_hall_dx" value="3.5*m"/>
<constant name="exp_hall_dy" value="3.5*m"/>
<constant name="exp_hall_dz" value="5.5*m"/>
<constant name="forward_x0" value="-1*m"/>
<constant name="forward_dx" value="2*m"/>
<constant name="forward_dy" value="1*m"/>
<constant name="forward_dz" value="25*m"/>

<documentation>
## Detector IDs
Expand Down
2 changes: 2 additions & 0 deletions compact/far_forward/vacuum.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
<apperture x="B2PF_InnerRadius*2" y="B2PF_InnerRadius*2" r="B2PF_InnerRadius" />
</element>

<end_of_the_world z="exp_hall_dz + 2.0 * forward_dz"/>

</detector>
</detectors>

Expand Down
5 changes: 4 additions & 1 deletion src/magnetVacuumFF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
z_elem_magnet.push_back(pos_z * dd4hep::cm);
}

xml_comp_t x_end_of_the_world = x_det.child(_Unicode(end_of_the_world));
double end_of_the_world_z = x_end_of_the_world.attr<double>(_Unicode(z));

int numMagnets = radii_magnet.size(); //number of actual FF magnets between IP and FF detectors
int numGaps =
numMagnets -
Expand Down Expand Up @@ -265,7 +268,7 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *

int pieceIdx = numMagnets - 1; // last B2PF magnet
std::string piece_name = Form("GapVacuum%d", numGaps + numMagnets + 1);
double endGapLength = (10000.0 - z_end[pieceIdx]) / cos(rotation_magnet[pieceIdx]);
double endGapLength = (end_of_the_world_z - z_end[pieceIdx]) / cos(rotation_magnet[pieceIdx]);
endGapLength =
endGapLength -
4 * radii_magnet[pieceIdx] *
Expand Down
12 changes: 10 additions & 2 deletions templates/epic.xml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,18 @@
<documentation level="0">
## World Volume

The world is a simple box, but could be a union of multiple regions.
The world is a union of multiple regions.
</documentation>
<world material="Air">
<shape type="Box" dx="world_dx" dy="world_dy" dz="world_dz"/>
<shape type="BooleanShape" operation="Union">
<shape type="BooleanShape" operation="Union">
<shape type="Box" dx="exp_hall_dx" dy="exp_hall_dy" dz="exp_hall_dz"/>
<shape type="Box" dx="backward_dx" dy="backward_dy" dz="backward_dz"/>
<position x="backward_x0" y="0*cm" z="- exp_hall_dz - backward_dz"/>
</shape>
<shape type="Box" dx="forward_dx" dy="forward_dy" dz="forward_dz"/>
<position x="forward_x0" y="0*cm" z="+ exp_hall_dz + forward_dz"/>
</shape>
<!--regionref name="world_region"/-->
<!--limitsetref name="world_limits"/-->
</world>
Expand Down
Loading