Skip to content
Snippets Groups Projects
Commit e1f7796a authored by myliu@ihep.ac.cn's avatar myliu@ihep.ac.cn
Browse files

Add two virtual end caps

parent 3918f875
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,10 @@
<constant name="SDT_outer_chamber_outer_wall_radius_min" value="1715*mm"/>
<constant name="SDT_outer_chamber_outer_wall_radius_max" value="1717.8*mm"/>
<constant name="SDT_Endcap_rmin" value="SDT_radius_min"/>
<constant name="SDT_Endcap_rmax" value="SDT_radius_max"/>
<constant name="SDT_Endcap_dz" value="0.1*mm"/>
</define>
<display>
......@@ -72,8 +76,8 @@
<detector id="7" name="DriftChamber" type="DriftChamber" readout="DriftChamberHitsCollection" vis="VisibleBlue" sensitive="true" region="DriftChamberRegion">
<envelope vis="SeeThrough">
<shape type="BooleanShape" operation="Union" material="Air">
<shape type="Tube" rmin="SDT_radius_min" rmax="909*mm" dz="SDT_half_length" />
<shape type="Tube" rmin="1084.8*mm" rmax="SDT_radius_max" dz="SDT_half_length" />
<shape type="Tube" rmin="SDT_radius_min" rmax="909*mm" dz="SDT_half_length+SDT_Endcap_dz" />
<shape type="Tube" rmin="1084.8*mm" rmax="SDT_radius_max" dz="SDT_half_length+SDT_Endcap_dz" />
</shape>
</envelope>
......
......@@ -143,6 +143,14 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
}
}
// End cap
double Endcap_rmin = theDetector.constant<double>("SDT_Endcap_rmin");
double Endcap_rmax = theDetector.constant<double>("SDT_Endcap_rmax");
double Endcap_z = theDetector.constant<double>("SDT_Endcap_dz");
dd4hep::Tube det_Endcap_solid(Endcap_rmin,Endcap_rmax,Endcap_z);
dd4hep::Volume det_Endcap_vol(det_name+"Endcap",det_Endcap_solid,det_mat);
det_Endcap_vol.setVisAttributes(theDetector,"VisibleRed");
//Initialize the segmentation
dd4hep::Readout readout = sd.readout();
dd4hep::Segmentation geomseg = readout.segmentation();
......@@ -256,6 +264,14 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep::PlacedVolume wall_phy = envelope.placeVolume(wall_vol,transform);
}
// - place Endcap
double endcap_pos[2] = {chamber_length*0.5+Endcap_z*0.5,-chamber_length*0.5-Endcap_z*0.5};
dd4hep::PlacedVolume endcap_phy;
for(int i=0; i<2; i++) {
dd4hep::Transform3D Endcap_transform(dd4hep::Rotation3D(),dd4hep::Position(0,0,endcap_pos[i]));
endcap_phy = envelope.placeVolume(det_Endcap_vol,Endcap_transform);
}
if ( x_det.hasAttr(_U(id)) ) {
phv.addPhysVolID("system",x_det.id());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment