Skip to content

Commit

Permalink
Added an upstream lepton-hadron joint between the backward and ip bea…
Browse files Browse the repository at this point in the history
…m pipes
  • Loading branch information
natochii committed Apr 21, 2024
1 parent be5f28a commit d6eca3f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
29 changes: 26 additions & 3 deletions compact/central_beampipe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
<constant name="LeptonIncomingBeampipe_ID3" value="43.00 * mm"/>
<constant name="LeptonIncomingBeampipe_ID4" value="54.00 * mm"/>

<!-- lepton lepton outgoing beam pipe -->
<!-- upstream lepton-hadron beam pipe joint -->
<constant name="UpstreamLeptonHadronBeampipeJointLength" value="20.1 * mm"/>

<!-- lepton outgoing beam pipe -->
<constant name="LeptonOutgoingBeampipeThickness" value="2.00 * mm"/>
<constant name="LeptonOutgoingBeampipe_z1" value="BeampipeUpstreamStraightLength"/>
<constant name="LeptonOutgoingBeampipe_z1" value="BeampipeUpstreamStraightLength + UpstreamLeptonHadronBeampipeJointLength"/>
<constant name="LeptonOutgoingBeampipe_z2" value="5000.00 * mm"/>

<constant name="LeptonOutgoingBeampipe_ID1" value="62.00 * mm"/>
Expand All @@ -42,7 +45,7 @@
<constant name="HadronIncomingBeampipe_ID3" value="41.15 * mm"/>

<constant name="HadronIncomingBeampipe_z1"
value="BeampipeUpstreamStraightLength + 0.5 * max(BeampipeOD,HadronIncomingBeampipe_ID1 + 2* HadronIncomingBeampipeThickness + 2* BeampipeCoatingThickness) * tan(abs(CrossingAngle))"/>
value="BeampipeUpstreamStraightLength + UpstreamLeptonHadronBeampipeJointLength + 0.5 * max(BeampipeOD,HadronIncomingBeampipe_ID1 + 2* HadronIncomingBeampipeThickness + 2* BeampipeCoatingThickness) * tan(abs(CrossingAngle))"/>
<constant name="HadronIncomingBeampipe_z2" value="2690.95 * mm"/>
<constant name="HadronIncomingBeampipe_z3" value="2890.35 * mm"/>
<constant name="HadronIncomingBeampipe_z4" value="2940.35 * mm"/>
Expand Down Expand Up @@ -85,6 +88,26 @@
<comment> For upstream beampipe, we subtract the vacuum from the matter </comment>
<upstream reflect="true"
place_vacuum="true">
<upstream_lepton_hadron_joint thickness="LeptonOutgoingBeampipeThickness">
<vacuum>
<zplane z="LeptonOutgoingBeampipe_z1 - UpstreamLeptonHadronBeampipeJointLength"
OD="LeptonOutgoingBeampipe_ID1"/>
<zplane z="LeptonOutgoingBeampipe_z1"
OD="LeptonOutgoingBeampipe_ID1"/>
</vacuum>
<coating>
<zplane z="LeptonOutgoingBeampipe_z1 - UpstreamLeptonHadronBeampipeJointLength"
OD="LeptonOutgoingBeampipe_ID1 + 2*BeampipeCoatingThickness"/>
<zplane z="LeptonOutgoingBeampipe_z1"
OD="LeptonOutgoingBeampipe_ID1 + 2*BeampipeCoatingThickness"/>
</coating>
<matter>
<zplane z="LeptonOutgoingBeampipe_z1 - UpstreamLeptonHadronBeampipeJointLength"
OD="LeptonOutgoingBeampipe_ID1 + 2* LeptonOutgoingBeampipeThickness + 2*BeampipeCoatingThickness"/>
<zplane z="LeptonOutgoingBeampipe_z1"
OD="LeptonOutgoingBeampipe_ID1 + 6* LeptonOutgoingBeampipeThickness + 2*BeampipeCoatingThickness"/>
</matter>
</upstream_lepton_hadron_joint>
<outgoing_lepton thickness="LeptonOutgoingBeampipeThickness">
<vacuum>
<zplane z="LeptonOutgoingBeampipe_z1" OD="LeptonOutgoingBeampipe_ID1"/>
Expand Down
14 changes: 11 additions & 3 deletions src/IP6BeamPipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
auto tf = Transform3D(Position(0, 0, axis_intersection));
if(name == "upstream")
tf *= Transform3D(RotationY( crossing_angle));
else
else if(name == "downstream")
tf *= Transform3D(RotationY( std::abs(crossing_angle)));
tf *= Transform3D(Position(0, 0, -axis_intersection));

Expand All @@ -213,7 +213,7 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
BooleanSolid coating;
BooleanSolid vacuum;

if (name == "upstream") {
if (name == "upstream" || name == "joint") {
// union of all matter, coating, and vacuum
UnionSolid matter_union( std::get<0>(pipe1_polycones), std::get<0>(pipe2_polycones), tf);
UnionSolid coating_union( std::get<1>(pipe1_polycones), std::get<1>(pipe2_polycones), tf);
Expand Down Expand Up @@ -373,23 +373,31 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
xml::Component upstream_c = x_det.child(_Unicode(upstream));
xml::Component incoming_hadron_c = upstream_c.child(_Unicode(incoming_hadron));
xml::Component outgoing_lepton_c = upstream_c.child(_Unicode(outgoing_lepton));
xml::Component upstream_lepton_hadron_c = upstream_c.child(_Unicode(upstream_lepton_hadron_joint));
xml_coll_t additional_subtractions_upstream(upstream_c, _Unicode(additional_subtraction));

auto volumes_upstream = create_volumes(
"upstream", outgoing_lepton_c, incoming_hadron_c,additional_subtractions_upstream);

auto joint_upstream = create_volumes(
"joint", upstream_lepton_hadron_c, upstream_lepton_hadron_c,additional_subtractions_upstream);

// reflect
auto tf_upstream = Transform3D(RotationZYX(0, 0, 0));
if (getAttrOrDefault<bool>(upstream_c, _Unicode(reflect), true))
tf_upstream = Transform3D(RotationZYX(0, M_PI, 0));

// add matter
assembly.placeVolume(std::get<0>(volumes_upstream), tf_upstream);
assembly.placeVolume(std::get<0>(joint_upstream), tf_upstream);
// add coating
assembly.placeVolume(std::get<1>(volumes_upstream), tf_upstream);
assembly.placeVolume(std::get<1>(joint_upstream), tf_upstream);
// add vacuum
if (getAttrOrDefault<bool>(upstream_c, _Unicode(place_vacuum), true))
if (getAttrOrDefault<bool>(upstream_c, _Unicode(place_vacuum), true)) {
assembly.placeVolume(std::get<2>(volumes_upstream), tf_upstream);
assembly.placeVolume(std::get<2>(joint_upstream), tf_upstream);
}

// -----------------------------
// Downstream:
Expand Down

0 comments on commit d6eca3f

Please sign in to comment.