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

Fixing overlaps in tracker

parent 020e754e
Branches
Tags
1 merge request!75Fixing overlaps in tracker
Pipeline #6809 passed
......@@ -51,25 +51,30 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
string c_nam = _toString(ncomponents, "component%d");
Box c_box(x_comp.thickness() / 2, x_comp.width() / 2 ,x_comp.length() / 2 );
Volume c_vol(c_nam, c_box, description.material(x_comp.materialStr()));
PlacedVolume c_pv;
//if (x_pos) {
//std::cout << x_pos.x(0) << "\n";
//}
if (x_pos && x_rot) {
Position c_pos(x_pos.x(0), x_pos.y(0), x_pos.z(0));
RotationZYX c_rot(x_rot.z(0), x_rot.y(0), x_rot.x(0));
pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos));
c_pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos));
} else if (x_rot) {
pv = m_vol.placeVolume(c_vol, RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)));
c_pv = m_vol.placeVolume(c_vol, RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)));
} else if (x_pos) {
pv = m_vol.placeVolume(c_vol, Position(x_pos.x(0), x_pos.y(0), x_pos.z(0)));
c_pv = m_vol.placeVolume(c_vol, Position(x_pos.x(0), x_pos.y(0), x_pos.z(0)));
} else {
pv = m_vol.placeVolume(c_vol);
c_pv = m_vol.placeVolume(c_vol);
}
c_vol.setRegion(description, x_comp.regionStr());
c_vol.setLimitSet(description, x_comp.limitsStr());
c_vol.setVisAttributes(description, x_comp.visStr());
if (x_comp.isSensitive()) {
pv.addPhysVolID(_U(sensor), sensor_number++);
c_pv.addPhysVolID(_U(sensor), sensor_number++);
c_vol.setSensitiveDetector(sens);
sensitives[m_nam].push_back(pv);
sensitives[m_nam].push_back(c_pv);
}
}
}
......
This diff is collapsed.
......@@ -11,6 +11,7 @@
<constant name="world_y" value="world_side"/>
<constant name="world_z" value="100*m"/>
<constant name="mil" value="0.0254*mm"/>
<comment>
------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment