Skip to content
Snippets Groups Projects
Commit b34ce354 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Revert "re-flip central beampipe"

This reverts commit e286b055
parent 0b2a2ba3
No related branches found
No related tags found
1 merge request!37Revert "re-flip central beampipe"
Pipeline #14542 passed
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// <detector name ="DetName" type="Beampipe" > // <detector name ="DetName" type="Beampipe" >
// <layer id="#(int)" inner_r="#(double)" outer_z="#(double)" > // <layer id="#(int)" inner_r="#(double)" outer_z="#(double)" >
// <slice material="string" thickness="#(double)" > // <slice material="string" thickness="#(double)" >
// </layer> // </layer>
// </detector> // </detector>
//========================================================================== //==========================================================================
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
using namespace std; using namespace std;
using namespace dd4hep; using namespace dd4hep;
/** \addtogroup beamline Beamline Instrumentation /** \addtogroup beamline Beamline Instrumentation
*/ */
/** \addtogroup IRChamber Interaction Region Vacuum Chamber. /** \addtogroup IRChamber Interaction Region Vacuum Chamber.
...@@ -28,18 +28,18 @@ using namespace dd4hep; ...@@ -28,18 +28,18 @@ using namespace dd4hep;
* \endcode * \endcode
* *
*/ */
static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector sens) { static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector sens) {
using namespace ROOT::Math; using namespace ROOT::Math;
xml_det_t x_det = e; xml_det_t x_det = e;
string det_name = x_det.nameStr(); string det_name = x_det.nameStr();
Material air = det.air(); Material air = det.air();
DetElement sdet(det_name, x_det.id()); DetElement sdet (det_name,x_det.id());
Assembly assembly(det_name + "_assembly"); Assembly assembly (det_name+"_assembly");
Material m_Cu = det.material("Copper"); Material m_Cu = det.material("Copper");
Material m_Al = det.material("Aluminum"); Material m_Al = det.material("Aluminum");
Material m_Be = det.material("Beryllium"); Material m_Be = det.material("Beryllium");
string vis_name = x_det.visStr(); string vis_name = x_det.visStr();
int n = 0; int n = 0;
...@@ -48,181 +48,138 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector sens) { ...@@ -48,181 +48,138 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector sens) {
xml::Component downstream_c = x_det.child(_Unicode(downstream_pipe)); xml::Component downstream_c = x_det.child(_Unicode(downstream_pipe));
// IP // IP
double IP_beampipe_OD = IP_pipe_c.attr<double>(_Unicode(OD)); double IP_beampipe_OD = IP_pipe_c.attr<double>(_Unicode(OD));
double IP_beampipe_thickness = double IP_beampipe_thickness = IP_pipe_c.attr<double>(_Unicode(wall_thickness));
IP_pipe_c.attr<double>(_Unicode(wall_thickness)); double IP_beampipe_ID = IP_beampipe_OD - IP_beampipe_thickness;
double IP_beampipe_ID = IP_beampipe_OD - IP_beampipe_thickness; double crossing_angle = IP_pipe_c.attr<double>(_Unicode(crossing_angle));
double - crossing_angle = IP_pipe_c.attr<double>(_Unicode(-crossing_angle));
// upstream parameters // upstream parameters
double upstream_straight_length = double upstream_straight_length = upstream_c.attr<double>(_Unicode(straight_length));;
upstream_c.attr<double>(_Unicode(straight_length)); double upstream_total_length = upstream_c.attr<double>(_Unicode(length));
; double upstream_conic_length = upstream_total_length - upstream_straight_length;
double upstream_total_length = upstream_c.attr<double>(_Unicode(length));
double upstream_conic_length =
upstream_total_length - upstream_straight_length;
double upstream_beampipe_exit_OD = 229.96 * mm; double upstream_beampipe_exit_OD = 229.96 * mm;
double upstream_beampipe_exit_ID = double upstream_beampipe_exit_ID = upstream_beampipe_exit_OD - IP_beampipe_thickness;
upstream_beampipe_exit_OD - IP_beampipe_thickness; double upstream_epipe_thickness = 4.0*mm;
double upstream_epipe_thickness = 4.0 * mm;
// downstream parameters // downstream parameters
double downstream_straight_length = double downstream_straight_length = downstream_c.attr<double>(_Unicode(straight_length));
downstream_c.attr<double>(_Unicode(straight_length)); double downstream_taper_length = 310.0 * mm;
double downstream_taper_length = 310.0 * mm; double downstream_total_length = downstream_c.attr<double>(_Unicode(length));
double downstream_total_length = downstream_c.attr<double>(_Unicode(length)); double downstream_conic_length = downstream_total_length - downstream_straight_length ;
double downstream_conic_length = double downstream_cone_rmax = 110.00*mm/2.0;
downstream_total_length - downstream_straight_length; double downstream_epipe_thickness = 4.0*mm; // just a guess
double downstream_cone_rmax = 110.00 * mm / 2.0;
double downstream_epipe_thickness = 4.0 * mm; // just a guess
double downstream_beampipe_exit_OD = 62.0 * mm; double downstream_beampipe_exit_OD = 62.0 * mm;
double downstream_beampipe_exit_ID = double downstream_beampipe_exit_ID = downstream_beampipe_exit_OD - downstream_epipe_thickness;
downstream_beampipe_exit_OD - downstream_epipe_thickness; double downstream_hpipe_OD = IP_beampipe_ID/2; // just a guess
double downstream_hpipe_OD = IP_beampipe_ID / 2; // just a guess double downstream_hpipe_thickness = 4.0*mm; // just a guess
double downstream_hpipe_thickness = 4.0 * mm; // just a guess
double upstream_delta_r = upstream_conic_length*std::tan(crossing_angle/2.0);
double downstream_delta_r = (downstream_conic_length+downstream_straight_length)*std::tan(crossing_angle);
double upstream_delta_r =
upstream_conic_length * std::tan(-crossing_angle / 2.0);
double downstream_delta_r =
(downstream_conic_length + downstream_straight_length) *
std::tan(-crossing_angle);
// ----------------------------- // -----------------------------
// IP beampipe // IP beampipe
Tube downstream_IP_tube(IP_beampipe_ID / 2.0, IP_beampipe_OD / 2.0, Tube downstream_IP_tube(IP_beampipe_ID/2.0, IP_beampipe_OD/2.0, downstream_straight_length/2.0);
downstream_straight_length / 2.0); Tube downstream_IP_vacuum(0.0, IP_beampipe_ID/2.0, downstream_straight_length/2.0);
Tube downstream_IP_vacuum(0.0, IP_beampipe_ID / 2.0, Tube upstream_IP_tube(IP_beampipe_ID/2.0, IP_beampipe_OD/2.0, upstream_straight_length/2.0);
downstream_straight_length / 2.0); Tube upstream_IP_vacuum(0.0, IP_beampipe_OD/2.0, upstream_straight_length/2.0);
Tube upstream_IP_tube(IP_beampipe_ID / 2.0, IP_beampipe_OD / 2.0,
upstream_straight_length / 2.0);
Tube upstream_IP_vacuum(0.0, IP_beampipe_OD / 2.0,
upstream_straight_length / 2.0);
Volume v_upstream_IP_tube("v_upstream_IP_tube", upstream_IP_tube, m_Be); Volume v_upstream_IP_tube("v_upstream_IP_tube", upstream_IP_tube, m_Be);
Volume v_downstream_IP_tube("v_downstream_IP_tube", downstream_IP_tube, m_Be); Volume v_downstream_IP_tube("v_downstream_IP_tube", downstream_IP_tube, m_Be);
// v_upstream_IP_tube.setVisAttributes(det,"GrayVis"); //v_upstream_IP_tube.setVisAttributes(det,"GrayVis");
// v_downstream_IP_tube.setVisAttributes(det,"RedVis"); //v_downstream_IP_tube.setVisAttributes(det,"RedVis");
sdet.setAttributes(det, v_upstream_IP_tube, x_det.regionStr(), sdet.setAttributes(det, v_upstream_IP_tube , x_det.regionStr(), x_det.limitsStr(), vis_name);
x_det.limitsStr(), vis_name); sdet.setAttributes(det, v_downstream_IP_tube, x_det.regionStr(), x_det.limitsStr(), vis_name);
sdet.setAttributes(det, v_downstream_IP_tube, x_det.regionStr(),
x_det.limitsStr(), vis_name);
auto pv_upstream_IP_tube = assembly.placeVolume( auto pv_upstream_IP_tube = assembly.placeVolume( v_upstream_IP_tube, Position(0, 0, -upstream_straight_length / 2.0));
v_upstream_IP_tube, Position(0, 0, -upstream_straight_length / 2.0));
auto pv_downstream_IP_tube = assembly.placeVolume( auto pv_downstream_IP_tube = assembly.placeVolume(
v_downstream_IP_tube, Position(0, 0, downstream_straight_length / 2.0)); v_downstream_IP_tube, Position(0, 0, downstream_straight_length / 2.0));
// ----------------------------- // -----------------------------
// upstream // upstream
Tube upstream_electron_tube( Tube upstream_electron_tube(IP_beampipe_ID/2.0 - upstream_epipe_thickness,
IP_beampipe_ID / 2.0 - upstream_epipe_thickness, IP_beampipe_ID/2.0-0.01*upstream_epipe_thickness, // leave a gap 1% of pipe thickness
IP_beampipe_ID / 2.0 - upstream_conic_length/2.0);
0.01 * upstream_epipe_thickness, // leave a gap 1% of pipe thickness Cone upstream_conic_section(upstream_conic_length / 2.0,
upstream_conic_length / 2.0); IP_beampipe_ID / 2.0, IP_beampipe_OD / 2.0,
Cone upstream_conic_section( IP_beampipe_ID / 2.0 + upstream_delta_r,
upstream_conic_length / 2.0, IP_beampipe_ID / 2.0, IP_beampipe_OD / 2.0, IP_beampipe_OD / 2.0+ upstream_delta_r + IP_beampipe_thickness);
IP_beampipe_ID / 2.0 + upstream_delta_r, Cone upstream_conic_section_vacuum(upstream_conic_length / 2.0,
IP_beampipe_OD / 2.0 + upstream_delta_r + IP_beampipe_thickness); 0.0, IP_beampipe_ID / 2.0,
Cone upstream_conic_section_vacuum(upstream_conic_length / 2.0, 0.0, 0.0, IP_beampipe_ID / 2.0 + upstream_delta_r);
IP_beampipe_ID / 2.0, 0.0, Volume v_upstream_conic_section("v_upstream_conic_section", upstream_conic_section, m_Be);
IP_beampipe_ID / 2.0 + upstream_delta_r); Volume v_upstream_electron_tube("v_upstream_electron_tube", upstream_electron_tube, m_Be);
Volume v_upstream_conic_section("v_upstream_conic_section", sdet.setAttributes(det, v_upstream_conic_section, x_det.regionStr(), x_det.limitsStr(), vis_name);
upstream_conic_section, m_Be); sdet.setAttributes(det, v_upstream_electron_tube, x_det.regionStr(), x_det.limitsStr(), vis_name);
Volume v_upstream_electron_tube("v_upstream_electron_tube", //Volume v_upstream_conic_section_vacuum("v_upstream_conic_section_vacuum", upstream_electron_tube, m_Al);
upstream_electron_tube, m_Be);
sdet.setAttributes(det, v_upstream_conic_section, x_det.regionStr(), //auto pv_upstream_conic_section = assembly.placeVolume(
x_det.limitsStr(), vis_name);
sdet.setAttributes(det, v_upstream_electron_tube, x_det.regionStr(),
x_det.limitsStr(), vis_name);
// Volume v_upstream_conic_section_vacuum("v_upstream_conic_section_vacuum",
// upstream_electron_tube, m_Al);
// auto pv_upstream_conic_section = assembly.placeVolume(
// v_upstream_conic_section, // v_upstream_conic_section,
// Transform3D( // Transform3D(
// Position(-upstream_delta_r/2.0,0, -upstream_straight_length - // Position(-upstream_delta_r/2.0,0, -upstream_straight_length - upstream_conic_length / 2.0)) *
// upstream_conic_length / 2.0)) * RotationY(-crossing_angle / 2.0) * // RotationY(crossing_angle / 2.0) * RotationX(M_PI));
// RotationX(M_PI)); auto pv_upstream_electron_tube =
auto pv_upstream_electron_tube = assembly.placeVolume( assembly.placeVolume(v_upstream_electron_tube,
v_upstream_electron_tube, Position(0, 0, -upstream_straight_length - upstream_conic_length / 2.0));
Position(0, 0, -upstream_straight_length - upstream_conic_length / 2.0)); //DetElement de_upstream_conic_section(sdet,"de_upstream_conic_section",1);
// DetElement de_upstream_conic_section(sdet,"de_upstream_conic_section",1); //de_upstream_conic_section.setPlacement(pv_upstream_conic_section);
// de_upstream_conic_section.setPlacement(pv_upstream_conic_section);
// ----------------------------- // -----------------------------
// downstream // downstream
Tube downstream_hadron_tube( Tube downstream_hadron_tube(downstream_hpipe_OD/2.0 - downstream_epipe_thickness,
downstream_hpipe_OD / 2.0 - downstream_epipe_thickness, downstream_hpipe_OD/2.0, downstream_conic_length / 2.0);
downstream_hpipe_OD / 2.0, downstream_conic_length / 2.0); Cone downstream_conic_section(downstream_conic_length / 2.0, IP_beampipe_ID / 2.0,
Cone downstream_conic_section( IP_beampipe_OD / 2.0, downstream_cone_rmax,
downstream_conic_length / 2.0, IP_beampipe_ID / 2.0, IP_beampipe_OD / 2.0, downstream_cone_rmax + downstream_epipe_thickness);
downstream_cone_rmax, downstream_cone_rmax + downstream_epipe_thickness); Cone downstream_taper_section(downstream_taper_length / 2.0,
Cone downstream_taper_section( downstream_cone_rmax, downstream_cone_rmax + downstream_epipe_thickness,
downstream_taper_length / 2.0, downstream_cone_rmax, downstream_beampipe_exit_ID/2.0, downstream_beampipe_exit_OD/2.0);
downstream_cone_rmax + downstream_epipe_thickness,
downstream_beampipe_exit_ID / 2.0, downstream_beampipe_exit_OD / 2.0); UnionSolid downstream_pipe_split0(downstream_conic_section, downstream_hadron_tube,
Transform3D(Position(downstream_delta_r / 2.0, 0.0, 0.0)) *
UnionSolid downstream_pipe_split0( RotationY(crossing_angle));
downstream_conic_section, downstream_hadron_tube,
Transform3D(Position(downstream_delta_r / 2.0, 0.0, 0.0)) *
RotationY(-crossing_angle));
// Vacuum // Vacuum
Cone downstream_conic_section_vacuum(downstream_conic_length / 2.0, 0.0, Cone downstream_conic_section_vacuum(downstream_conic_length / 2.0,
IP_beampipe_ID / 2.0, 0.0, 0.0, IP_beampipe_ID / 2.0,
downstream_cone_rmax); 0.0, downstream_cone_rmax);
Tube downstream_hadron_vacuum( Tube downstream_hadron_vacuum(0.0, downstream_hpipe_OD / 2.0 - downstream_epipe_thickness,
0.0, downstream_hpipe_OD / 2.0 - downstream_epipe_thickness, downstream_conic_length / 1.9);
downstream_conic_length / 1.9); UnionSolid downstream_pipe_vacuum_split0(downstream_conic_section_vacuum, downstream_hadron_vacuum,
UnionSolid downstream_pipe_vacuum_split0( Transform3D(Position(downstream_delta_r / 2.0, 0.0, 0.0)) *
downstream_conic_section_vacuum, downstream_hadron_vacuum, RotationY(crossing_angle));
Transform3D(Position(downstream_delta_r / 2.0, 0.0, 0.0)) * SubtractionSolid downstream_pipe_split1(downstream_pipe_split0,
RotationY(-crossing_angle));
SubtractionSolid downstream_pipe_split1(downstream_pipe_split0,
downstream_pipe_vacuum_split0); downstream_pipe_vacuum_split0);
Volume v_downstream_pipe_split1("v_downstream_pipe_split1", Volume v_downstream_pipe_split1("v_downstream_pipe_split1", downstream_pipe_split1, m_Be);
downstream_pipe_split1, m_Be); sdet.setAttributes(det, v_downstream_pipe_split1, x_det.regionStr(), x_det.limitsStr(), vis_name);
sdet.setAttributes(det, v_downstream_pipe_split1, x_det.regionStr(), auto pv_downstream_pipe_split1 = assembly.placeVolume(v_downstream_pipe_split1,
x_det.limitsStr(), vis_name); Position(0, 0,
auto pv_downstream_pipe_split1 = assembly.placeVolume( downstream_straight_length +
v_downstream_pipe_split1, downstream_conic_length / 2.0));
Position(0, 0, Volume v_downstream_taper_section("v_downstream_taper_section", downstream_taper_section, m_Be);
downstream_straight_length + downstream_conic_length / 2.0)); sdet.setAttributes(det, v_downstream_taper_section, x_det.regionStr(), x_det.limitsStr(), vis_name);
Volume v_downstream_taper_section("v_downstream_taper_section", auto pv_downstream_taper_section = assembly.placeVolume(v_downstream_taper_section, Position(0, 0, downstream_straight_length + downstream_conic_length + downstream_taper_length / 2.0));
downstream_taper_section, m_Be);
sdet.setAttributes(det, v_downstream_taper_section, x_det.regionStr(), //Volume v_downstream_conic_section("v_downstream_conic_section", downstream_conic_section, m_Al);
x_det.limitsStr(), vis_name); //Volume v_downstream_hadron_tube("v_downstream_hadron_tube", downstream_hadron_tube, m_Al);
auto pv_downstream_taper_section = assembly.placeVolume( //auto pv_downstream_hadron_tube = assembly.placeVolume(
v_downstream_taper_section,
Position(0, 0,
downstream_straight_length + downstream_conic_length +
downstream_taper_length / 2.0));
// Volume v_downstream_conic_section("v_downstream_conic_section",
// downstream_conic_section, m_Al); Volume
// v_downstream_hadron_tube("v_downstream_hadron_tube",
// downstream_hadron_tube, m_Al); auto pv_downstream_hadron_tube =
// assembly.placeVolume(
// v_downstream_hadron_tube, // v_downstream_hadron_tube,
// Transform3D(Position(downstream_delta_r / 2.0, 0, // Transform3D(Position(downstream_delta_r / 2.0, 0,
// downstream_straight_length + // downstream_straight_length + downstream_conic_length / 2.0)) *
// downstream_conic_length / 2.0)) * // RotationY(crossing_angle) );
// RotationY(-crossing_angle) );
// auto pv_downstream_conic_section = assembly.placeVolume( //auto pv_downstream_conic_section = assembly.placeVolume(
// v_downstream_conic_section, Position(0, 0, downstream_straight_length + // v_downstream_conic_section, Position(0, 0, downstream_straight_length + downstream_conic_length / 2.0));
// downstream_conic_length / 2.0)); //DetElement de_downstream_conic_section(sdet,"de_downstream_conic_section",1);
// DetElement //de_downstream_conic_section.setPlacement(pv_downstream_conic_section);
// de_downstream_conic_section(sdet,"de_downstream_conic_section",1);
// de_downstream_conic_section.setPlacement(pv_downstream_conic_section);
auto pv_assembly = det.pickMotherVolume(sdet).placeVolume(assembly); auto pv_assembly = det.pickMotherVolume(sdet).placeVolume(assembly);
pv_assembly.addPhysVolID("system", sdet.id()).addPhysVolID("barrel", 1); pv_assembly.addPhysVolID("system",sdet.id()).addPhysVolID("barrel",1);
sdet.setPlacement(pv_assembly); sdet.setPlacement(pv_assembly);
assembly->GetShape()->ComputeBBox(); assembly->GetShape()->ComputeBBox() ;
return sdet; return sdet;
} }
DECLARE_DETELEMENT(IP6BeamPipe, create_detector) DECLARE_DETELEMENT(IP6BeamPipe,create_detector)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment