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

WIP: put the dim into xml file.

parent 315669ae
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,8 @@
<detectors>
<detector id="1" name="CaloDetector" type="EcalMatrix" readout="CaloHitsCollection" vis="VisibleGreen" sensitive="true">
<position x="0" y="0" z="1800*mm"/>
<position x="0" y="0" z="1835*mm+30*cm"/>
<dimensions dx="30*cm" dy="30*cm" dz="30*cm"/>
</detector>
</detectors>
......
......@@ -27,6 +27,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
MYDEBUGVAL(det_name);
MYDEBUGVAL(det_type);
xml_dim_t pos (x_det.child(_U(position)));
xml_dim_t dim (x_det.child(_U(dimensions)));
dd4hep::DetElement sdet(det_name, x_det.id());
......@@ -34,7 +35,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep::Volume motherVol = theDetector.pickMotherVolume(sdet);
dd4hep::Material det_mat(theDetector.material("G4_BGO"));
dd4hep::Volume det_vol(det_name+"_vol", dd4hep::Box(60, 60, 60), det_mat);
dd4hep::Volume det_vol(det_name+"_vol", dd4hep::Box(dim.dx(), dim.dy(), dim.dz()), det_mat);
dd4hep::Transform3D transform(dd4hep::Rotation3D(),
dd4hep::Position(pos.x(),pos.y(),pos.z()));
......
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