projection plane on local coordinates

This commit is contained in:
AndreaRigoni
2026-03-19 09:52:19 +00:00
parent ca2223e04c
commit c8eec163a6
3 changed files with 42 additions and 3 deletions

View File

@@ -45,12 +45,30 @@ class DetectorChamber : public ContainerBox {
public:
DetectorChamber() : BaseClass() {
m_ProjectionPlane.origin = HPoint3f(0, 0, 0);
m_ProjectionPlane.direction = HVector3f(0, 0, 1);
}
DetectorChamber(const Vector3f &size) : BaseClass(size) {
m_ProjectionPlane.origin = HPoint3f(0, 0, 0);
m_ProjectionPlane.direction = HVector3f(0, 0, 1);
}
// set the plane where muons hit is projected
// to be represented with a direction vector
// coordinates are local to the container box
void SetProjectionPlane(const HLine3f &normal) { m_ProjectionPlane = normal; }
const HLine3f &GetProjectionPlane() const { return m_ProjectionPlane; }
HLine3f GetWorldProjectionPlane() const {
HLine3f worldPlane;
Matrix4f M = this->GetWorldMatrix();
worldPlane.origin = M * m_ProjectionPlane.origin;
worldPlane.direction = M * m_ProjectionPlane.direction;
return worldPlane;
}
MuonEvent ProjectMuonEvent(const MuonEvent &muon) const;
private: