diff --git a/DDSurfaces/include/DDSurfaces/DiskSurface.h b/DDSurfaces/include/DDSurfaces/DiskSurface.h new file mode 100644 index 0000000000000000000000000000000000000000..477ebd7e5420784614c575d4be8811717f724b90 --- /dev/null +++ b/DDSurfaces/include/DDSurfaces/DiskSurface.h @@ -0,0 +1,40 @@ +/* + * DiskSurface.h + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#ifndef DDSurfaces_DISKSURFACE_H_ +#define DDSurfaces_DISKSURFACE_H_ + +#include "DDSurfaces/ISurface.h" + +namespace DDSurfaces { + +class DiskBoundary; + +class DiskSurface: public ISurface { +public: + /// Default constructor + DiskSurface(); + + /// Destructor + virtual ~DiskSurface(); + + /// Checks if the given point lies within the surface + bool isInsideBoundaries(const Vector3D& point) const; + + /// Access to the normal direction at the given point + Vector3D getNormal(const Vector3D& point) const; + + /// Access to the measurement directions at the given point + Measurement measurement(const Vector3D& point) const; + +protected: + DiskBoundary m_boundary; +}; + +} /* namespace DDSurfaces */ + +#endif /* DDSurfaces_DISKSURFACE_H_ */ diff --git a/DDSurfaces/include/DDSurfaces/ISurface.h b/DDSurfaces/include/DDSurfaces/ISurface.h new file mode 100644 index 0000000000000000000000000000000000000000..7d907a6d7c08e198f4879df90420ef12335688eb --- /dev/null +++ b/DDSurfaces/include/DDSurfaces/ISurface.h @@ -0,0 +1,79 @@ +/* + * ISurface.h + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#ifndef DDSurfaces_ISURFACE_H_ +#define DDSurfaces_ISURFACE_H_ + +#include "DDSurfaces/Material.h" +#include "DDSurfaces/Measurement.h" +#include "DDSurfaces/Vector3D.h" + +namespace DDSurfaces { + +/** Generic surface class used for tracking */ +class ISurface { +public: + /// Destructor + virtual ~ISurface() { + if (m_measurement) { + delete m_measurement; + } + } + + /// Checks if the surface has measurement directions + bool hasMeasurement() const { + return m_measurement != 0; + } + + /// Checks if the given point lies within the surface + bool isInsideBoundaries(const Vector3D& point) const = 0; + + /// Access to the normal direction at the given point + Vector3D getNormal(const Vector3D& point) const = 0; + + /// Access to the measurement directions at the given point + Measurement measurement(const Vector3D& point) const = 0; + + /// Access to the material in opposite direction of the normal + const Material& innerMaterial() const { + return m_innerMaterial; + } + + /// Access to the material in direction of the normal + const Material& outerMaterial() const { + return m_outerMaterial; + } + + /// Sets the material in opposite direction of the normal + void setInnerMaterial(const Material& material) { + m_innerMaterial = material; + } + + /// Sets the material in direction of the normal + void setOuterMaterial(const Material& material) { + m_outerMaterial = material; + } + + /// Sets the nominal measurement directions + void setMeasurement(const Measurement& measurement) { + m_measurement = new Measurement(measurement); + } + +protected: + /// Constructor which can be used by derived classes + ISurface(const Material& innerMaterial=Material(), const Material& outerMaterial=Material()) : + m_innerMaterial(innerMaterial), m_outerMaterial(outerMaterial), m_measurement(0) { + } + + Material m_innerMaterial; /// the material in opposite direction of the normal + Material m_outerMaterial; /// the material in direction of the normal + Measurement* m_measurement; /// the nominal measurement directions +}; + +} /* namespace DDSurfaces */ + +#endif /* DDSurfaces_ISURFACE_H_ */ diff --git a/DDSurfaces/include/DDSurfaces/Material.h b/DDSurfaces/include/DDSurfaces/Material.h new file mode 100644 index 0000000000000000000000000000000000000000..ccb00970c49e2ac2b83293d6006532730c6c9113 --- /dev/null +++ b/DDSurfaces/include/DDSurfaces/Material.h @@ -0,0 +1,61 @@ +/* + * Material.h + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#ifndef DDSurfaces_MATERIAL_H_ +#define DDSurfaces_MATERIAL_H_ + +namespace DDSurfaces { + +/** Container class for material properties used in tracking */ +class Material { +public: + /// Default constructor + Material(int Z=0, int A=0, double density=0., double radiationLength = 0.) : + m_Z(Z), m_A(A), m_density(density), m_radiationLength( + radiationLength) { + } + + /// Copy constructor + Material(const Material& material) : + m_Z(material.Z()), m_A(material.A()), m_density(material.density()), m_radiationLength( + material.radiationLength()) { + } + + /// Destructor + virtual ~Material() {} + + /// Access to the atomic number + int Z() const { + return m_Z; + } + + /// Access to the atomic mass + int A() const { + return m_A; + } + + /// Access to the density + double density() const { + return m_density; + } + + /// Access to the radiation length + double radiationLength() const { + // FIXME: needs to calculate X0 to allow lazy initialization + return m_radiationLength; + } + +protected: + int m_Z; /// the atomic number + int m_A; /// the atomic mass + double m_density; /// the density + double m_radiationLength; /// the radiation length +}; + +} /* namespace DDSurfaces */ + +#endif /* DDSurfaces_MATERIAL_H_ */ diff --git a/DDSurfaces/include/DDSurfaces/Measurement.h b/DDSurfaces/include/DDSurfaces/Measurement.h new file mode 100644 index 0000000000000000000000000000000000000000..661053461df09d191628e0a9f98b93c52284d16a --- /dev/null +++ b/DDSurfaces/include/DDSurfaces/Measurement.h @@ -0,0 +1,48 @@ +/* + * Measurement.h + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#ifndef DDSurfaces_MEASUREMENT_H_ +#define DDSurfaces_MEASUREMENT_H_ + +#include "DDSurfaces/Vector3D.h" + +namespace DDSurfaces { + +/** Container class for measurement directions */ +class Measurement { +public: + /// Default constructor + Measurement(const Vector3D& u, const Vector3D& v) : + m_u(u), m_v(v) { + } + + /// Copy constructor + Measurement(const Measurement& measurement) : + m_u(measurement.u()), m_v(measurement.v()) { + } + + /// Destructor + virtual ~Measurement() {} + + /// Access to the U measurement direction + const Vector3D& u() const { + return m_u; + } + + /// Access to the V measurement direction + const Vector3D& v() const { + return m_v; + } + +protected: + Vector3D m_u; + Vector3D m_v; +}; + +} /* namespace DDSurfaces */ + +#endif /* DDSurfaces_MEASUREMENT_H_ */ diff --git a/DDSurfaces/include/DDSurfaces/StraightLineSurface.h b/DDSurfaces/include/DDSurfaces/StraightLineSurface.h new file mode 100644 index 0000000000000000000000000000000000000000..df96a5baa4004e28e8e099c2cd247242ef7dc20c --- /dev/null +++ b/DDSurfaces/include/DDSurfaces/StraightLineSurface.h @@ -0,0 +1,40 @@ +/* + * StraightLineSurface.h + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#ifndef DDSurfaces_STRAIGHTLINESURFACE_H_ +#define DDSurfaces_STRAIGHTLINESURFACE_H_ + +#include "DDSurfaces/ISurface.h" + +namespace DDSurfaces { + +class StraightLineBoundary; + +class StraightLineSurface: public ISurface { +public: + /// Default constructor + StraightLineSurface(); + + /// Destructor + virtual ~StraightLineSurface(); + + /// Checks if the given point lies within the surface + bool isInsideBoundaries(const Vector3D& point) const; + + /// Access to the normal direction at the given point + Vector3D getNormal(const Vector3D& point) const; + + /// Access to the measurement directions at the given point + Measurement measurement(const Vector3D& point) const; + +protected: + StraightLineBoundary m_boundary; +}; + +} /* namespace DDSurfaces */ + +#endif /* DDSurfaces_STRAIGHTLINESURFACE_H_ */ diff --git a/DDSurfaces/include/DDSurfaces/Vector3D.h b/DDSurfaces/include/DDSurfaces/Vector3D.h new file mode 100644 index 0000000000000000000000000000000000000000..85d871e1dd2c8df592577da200535fe048ab8d09 --- /dev/null +++ b/DDSurfaces/include/DDSurfaces/Vector3D.h @@ -0,0 +1,54 @@ +/* + * Vector3D.h + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#ifndef DDSurfaces_VECTOR3D_H_ +#define DDSurfaces_VECTOR3D_H_ + +namespace DDSurfaces { + +/** Generic vector class */ +class Vector3D { +public: + /// Default constructor + Vector3D(double x=0., double y=0., double z=0.) : + m_x(x), m_y(y), m_z(z) { + } + + /** Copy constructor from arbitrary foreign vector class + * Requires x(), y(), z() methods to access Cartesian coordinates. + */ + template<typename T> Vector3D(const T& vector) : + m_x(vector.x()), m_y(vector.y()), m_z(vector.z()) { + } + + /// Destructor + virtual ~Vector3D() {} + + /// Access to x + double x() const { + return m_x; + } + + /// Access to y + double y() const { + return m_y; + } + + /// Access to z + double z() const { + return m_z; + } + +protected: + double m_x; + double m_y; + double m_z; +}; + +} /* namespace DDSurfaces */ + +#endif /* VECTOR3D_H_ */ diff --git a/DDSurfaces/include/DDSurfaces/ZCylinderSurface.h b/DDSurfaces/include/DDSurfaces/ZCylinderSurface.h new file mode 100644 index 0000000000000000000000000000000000000000..7eb4835e53677094aeae42c589211d9da2bb8198 --- /dev/null +++ b/DDSurfaces/include/DDSurfaces/ZCylinderSurface.h @@ -0,0 +1,40 @@ +/* + * ZCylinderSurface.h + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#ifndef DDSurfaces_ZCYLINDERSURFACE_H_ +#define DDSurfaces_ZCYLINDERSURFACE_H_ + +#include "DDSurfaces/ISurface.h" + +namespace DDSurfaces { + +class ZCylinderBoundary; + +class ZCylinderSurface: public ISurface { +public: + /// Default constructor + ZCylinderSurface(); + + /// Destructor + virtual ~ZCylinderSurface(); + + /// Checks if the given point lies within the surface + bool isInsideBoundaries(const Vector3D& point) const; + + /// Access to the normal direction at the given point + Vector3D getNormal(const Vector3D& point) const; + + /// Access to the measurement directions at the given point + Measurement measurement(const Vector3D& point) const; + +protected: + ZCylinderBoundary m_boundary; +}; + +} /* namespace DDSurfaces */ + +#endif /* DDSurfaces_ZCYLINDERSURFACE_H_ */ diff --git a/DDSurfaces/include/DDSurfaces/ZPlanarSurface.h b/DDSurfaces/include/DDSurfaces/ZPlanarSurface.h new file mode 100644 index 0000000000000000000000000000000000000000..7d7a98314524cca146b5c2fbd9b8e1f4c8b3213f --- /dev/null +++ b/DDSurfaces/include/DDSurfaces/ZPlanarSurface.h @@ -0,0 +1,40 @@ +/* + * ZPlanarSurface.h + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#ifndef DDSurfaces_ZPLANARSURFACE_H_ +#define DDSurfaces_ZPLANARSURFACE_H_ + +#include "DDSurfaces/ISurface.h" + +namespace DDSurfaces { + +class ZPlanarBoundary; + +class ZPlanarSurface: public ISurface { +public: + /// Default constructor + ZPlanarSurface(); + + /// Destructor + virtual ~ZPlanarSurface(); + + /// Checks if the given point lies within the surface + bool isInsideBoundaries(const Vector3D& point) const; + + /// Access to the normal direction at the given point + Vector3D getNormal(const Vector3D& point) const; + + /// Access to the measurement directions at the given point + Measurement measurement(const Vector3D& point) const; + +protected: + ZPlanarBoundary m_boundary; +}; + +} /* namespace DDSurfaces */ + +#endif /* DDSurfaces_ZPLANARSURFACE_H_ */ diff --git a/DDSurfaces/src/DiskSurface.cpp b/DDSurfaces/src/DiskSurface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f342d376bc71314503e08a817cb1e7de104ae01d --- /dev/null +++ b/DDSurfaces/src/DiskSurface.cpp @@ -0,0 +1,40 @@ +/* + * DiskSurface.cpp + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#include "DDSurfaces/DiskSurface.h" + +namespace DDSurfaces { + +DiskSurface::DiskSurface() { + // TODO Auto-generated constructor stub + +} + +DiskSurface::~DiskSurface() { + // TODO Auto-generated destructor stub +} + +/// Checks if the given point lies within the surface +bool DiskSurface::isInsideBoundaries(const Vector3D& point) const { + // TODO + return false; +} + +/// Access to the normal direction at the given point +Vector3D DiskSurface::getNormal(const Vector3D& point) const { + // TODO + return Vector3D(); + +} + +/// Access to the measurement directions at the given point +Measurement DiskSurface::measurement(const Vector3D& point) const { + // TODO + return Vector3D(); +} + +} /* namespace DDSurfaces */ diff --git a/DDSurfaces/src/StraightLineSurface.cpp b/DDSurfaces/src/StraightLineSurface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e03fbaf046319cf2f07321fadfce0ccef78aed5c --- /dev/null +++ b/DDSurfaces/src/StraightLineSurface.cpp @@ -0,0 +1,40 @@ +/* + * StraightLineSurface.cpp + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#include "DDSurfaces/StraightLineSurface.h" + +namespace DDSurfaces { + +StraightLineSurface::StraightLineSurface() { + // TODO Auto-generated constructor stub + +} + +StraightLineSurface::~StraightLineSurface() { + // TODO Auto-generated destructor stub +} + +/// Checks if the given point lies within the surface +bool StraightLineSurface::isInsideBoundaries(const Vector3D& point) const { + // TODO + return false; +} + +/// Access to the normal direction at the given point +Vector3D StraightLineSurface::getNormal(const Vector3D& point) const { + // TODO + return Vector3D(); + +} + +/// Access to the measurement directions at the given point +Measurement StraightLineSurface::measurement(const Vector3D& point) const { + // TODO + return Vector3D(); +} + +} /* namespace DDSurfaces */ diff --git a/DDSurfaces/src/ZCylinderSurface.cpp b/DDSurfaces/src/ZCylinderSurface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..04f1c032ac9792590b939962437db234d64df2db --- /dev/null +++ b/DDSurfaces/src/ZCylinderSurface.cpp @@ -0,0 +1,40 @@ +/* + * ZCylinderSurface.cpp + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#include "DDSurfaces/ZCylinderSurface.h" + +namespace DDSurfaces { + +ZCylinderSurface::ZCylinderSurface() { + // TODO Auto-generated constructor stub + +} + +ZCylinderSurface::~ZCylinderSurface() { + // TODO Auto-generated destructor stub +} + +/// Checks if the given point lies within the surface +bool ZCylinderSurface::isInsideBoundaries(const Vector3D& point) const { + // TODO + return false; +} + +/// Access to the normal direction at the given point +Vector3D ZCylinderSurface::getNormal(const Vector3D& point) const { + // TODO + return Vector3D(); + +} + +/// Access to the measurement directions at the given point +Measurement ZCylinderSurface::measurement(const Vector3D& point) const { + // TODO + return Vector3D(); +} + +} /* namespace DDSurfaces */ diff --git a/DDSurfaces/src/ZPlanarSurface.cpp b/DDSurfaces/src/ZPlanarSurface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0b5a4513f42ed6904bbdf7cc1e0f72f2c8b1d15e --- /dev/null +++ b/DDSurfaces/src/ZPlanarSurface.cpp @@ -0,0 +1,40 @@ +/* + * ZPlanarSurface.cpp + * + * Created on: Mar 7, 2014 + * Author: cgrefe + */ + +#include "DDSurfaces/ZPlanarSurface.h" + +namespace DDSurfaces { + +ZPlanarSurface::ZPlanarSurface() { + // TODO Auto-generated constructor stub + +} + +ZPlanarSurface::~ZPlanarSurface() { + // TODO Auto-generated destructor stub +} + +/// Checks if the given point lies within the surface +bool ZPlanarSurface::isInsideBoundaries(const Vector3D& point) const { + // TODO + return false; +} + +/// Access to the normal direction at the given point +Vector3D ZPlanarSurface::getNormal(const Vector3D& point) const { + // TODO + return Vector3D(); + +} + +/// Access to the measurement directions at the given point +Measurement ZPlanarSurface::measurement(const Vector3D& point) const { + // TODO + return Vector3D(); +} + +} /* namespace DDSurfaces */