#ifndef __JSHOWER3Z__ #define __JSHOWER3Z__ #include #include #include "JMath/JMath.hh" #include "JGeometry3D/JVector3D.hh" #include "JGeometry3D/JVersor3Z.hh" #include "JGeometry3D/JTrack3D.hh" #include "JFit/JPoint4D.hh" /** * \author lquinn */ namespace JFIT {} namespace JPP { using namespace JFIT; } namespace JFIT { using JMATH::JMath; using JGEOMETRY3D::JVector3D; using JGEOMETRY3D::JVersor3Z; using JGEOMETRY3D::JTrack3D; /** * Data structure for cascade in positive z-direction. * Note that the position coordinates are defined with respect to the given direction. */ class JShower3Z : public JPoint4D, public JVersor3Z, public JMath { public: using JPoint4D::add; using JPoint4D::sub; using JPoint4D::getT; using JVersor3Z::add; using JVersor3Z::sub; using JVersor3Z::getDirection; /** * Default constructor. */ JShower3Z() : JPoint4D(), JVersor3Z() {} /** * Constructor. * * \param point point * \param dir direction */ JShower3Z(const JPoint4D& point, const JVersor3Z& dir): JPoint4D(point), JVersor3Z(dir) {} /** * Prefix unary minus. * * \return shower */ JShower3Z& negate() { JPoint4D ::negate(); JVersor3Z::negate(); return *this; } /** * Addition operator. * * \param value shower * \return shower */ JShower3Z& add(const JShower3Z& value) { JPoint4D ::add(value); JVersor3Z::add(value); return *this; } /** * Subtraction operator. * * \param value shower * \return shower */ JShower3Z& sub(const JShower3Z& value) { JPoint4D ::sub(value); JVersor3Z::sub(value); return *this; } /** * Multiplication operator. * * \param value * \return shower */ JShower3Z& mul(const double value) { JPoint4D ::mul(value); JVersor3Z::mul(value); return *this; } /** * Divison operator. * * \param value * \return shower */ JShower3Z& div(const double value) { JPoint4D ::div(value); JVersor3Z::div(value); return *this; } /** * Read object from input. * * \param in input stream * \param object object * \return input stream */ friend inline std::istream& operator>>(std::istream& in, JShower3Z& object) { in >> static_cast(object); in >> object.__dx; in >> object.__dy; return in; } /** * Write object to output. * * \param out output stream * \param object object * \return output stream */ friend inline std::ostream& operator<<(std::ostream& out, const JShower3Z& object) { out << static_cast(object); out << ' ' << object.__dx; out << ' ' << object.__dy; return out; } typedef double JShower3Z::*parameter_type; static parameter_type pDX() { return &JShower3Z::__dx; } static parameter_type pDY() { return &JShower3Z::__dy; } }; } #endif