Skip to content
Snippets Groups Projects
Commit 3ee63011 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

modified: ip6/beampipe.xml

	modified:   src/IP6BeamPipe.cpp
parent cc470c0d
Branches acts_beampipe
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<detectors> <detectors>
<detector id="BeamPipe_ID" name="BeamPipe" type="IP6BeamPipe" vis="BeamPipeVis"> <detector id="BeamPipe_ID" name="BeamPipe" type="IP6BeamPipe" vis="BeamPipeVis">
<!--<beampipe/>-->
<IP_pipe OD="BeampipeOD" wall_thickness="4*mm" crossing_angle="CrossingAngle" /> <IP_pipe OD="BeampipeOD" wall_thickness="4*mm" crossing_angle="CrossingAngle" />
<downstream_pipe straight_length="685.0 * mm" length="4500.0 * mm" /> <downstream_pipe straight_length="685.0 * mm" length="4500.0 * mm" />
<upstream_pipe straight_length="1300.0 * mm" length="4500.0 * mm" /> <upstream_pipe straight_length="1300.0 * mm" length="4500.0 * mm" />
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include "TMath.h" #include "TMath.h"
#include <XML/Helper.h> #include <XML/Helper.h>
#include "Acts/Plugins/DD4hep/ActsExtension.hpp"
#include "Acts/Definitions/Units.hpp"
using namespace std; using namespace std;
using namespace dd4hep; using namespace dd4hep;
...@@ -39,8 +41,25 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector sens) { ...@@ -39,8 +41,25 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector sens) {
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");
Material m_Vacuum = det.material("Vacuum");
string vis_name = x_det.visStr(); string vis_name = x_det.visStr();
Acts::ActsExtension* beampipeExtension = new Acts::ActsExtension();
bool isBeamPipe = x_det.hasChild(_U(beampipe));
beampipeExtension->addType("passive cylinder", "layer");
if (isBeamPipe) {
beampipeExtension->addType("beampipe", "layer");
}
//tubeVolume.setVisAttributes(oddd, x_det.visStr());
//// Place it in the mother
//Volume motherVolume = oddd.pickMotherVolume(cylinderElement);
//PlacedVolume placedTube = motherVolume.placeVolume(tubeVolume);
//placedTube.addPhysVolID(detName, cylinderElement.id());
//sdet.setPlacement(placedTube);
int n = 0; int n = 0;
xml::Component IP_pipe_c = x_det.child(_Unicode(IP_pipe)); xml::Component IP_pipe_c = x_det.child(_Unicode(IP_pipe));
...@@ -79,6 +98,12 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector sens) { ...@@ -79,6 +98,12 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector sens) {
// ----------------------------- // -----------------------------
// IP beampipe // IP beampipe
Tube IP_tube(IP_beampipe_ID/2.0, IP_beampipe_OD/2.0, downstream_straight_length/2.0+upstream_straight_length/2.0);
Tube IP_vacuum(0.0, IP_beampipe_ID/2.0, downstream_straight_length/2.0+upstream_straight_length/2.0);
Volume v_IP_tube("v_IP_tube", IP_tube, m_Be);
Volume v_IP_vacuum("v_IP_vacuum", IP_vacuum, m_Vacuum );
Tube downstream_IP_tube(IP_beampipe_ID/2.0, IP_beampipe_OD/2.0, downstream_straight_length/2.0); Tube downstream_IP_tube(IP_beampipe_ID/2.0, IP_beampipe_OD/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, downstream_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_tube(IP_beampipe_ID/2.0, IP_beampipe_OD/2.0, upstream_straight_length/2.0);
...@@ -91,11 +116,15 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector sens) { ...@@ -91,11 +116,15 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector sens) {
//v_downstream_IP_tube.setVisAttributes(det,"RedVis"); //v_downstream_IP_tube.setVisAttributes(det,"RedVis");
sdet.setAttributes(det, v_upstream_IP_tube , x_det.regionStr(), x_det.limitsStr(), vis_name); sdet.setAttributes(det, v_upstream_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); sdet.setAttributes(det, v_downstream_IP_tube, x_det.regionStr(), x_det.limitsStr(), vis_name);
sdet.setAttributes(det, v_IP_tube, x_det.regionStr(), x_det.limitsStr(), vis_name);
auto pv_upstream_IP_tube = assembly.placeVolume( v_upstream_IP_tube, Position(0, 0, -upstream_straight_length / 2.0)); //auto pv_upstream_IP_tube = assembly.placeVolume( v_upstream_IP_tube, Position(0, 0, -upstream_straight_length / 2.0));
//auto pv_downstream_IP_tube = assembly.placeVolume( v_downstream_IP_tube, Position(0, 0, downstream_straight_length / 2.0));
auto pv_IP_tube = assembly.placeVolume( v_IP_tube, Position(0, 0, -upstream_straight_length / 2.0 +downstream_straight_length / 2.0));
auto pv_downstream_IP_tube = assembly.placeVolume( DetElement beampipe_element(sdet, "beampipe_de", 1);
v_downstream_IP_tube, Position(0, 0, downstream_straight_length / 2.0)); beampipe_element.addExtension<Acts::ActsExtension>(beampipeExtension);
beampipe_element.setPlacement(pv_IP_tube);
// ----------------------------- // -----------------------------
// upstream // upstream
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment