#ifndef __JTRACK3EY__ #define __JTRACK3EY__ #include #include #include "JGeometry3D/JTrack3E.hh" #include "JIO/JSerialisable.hh" #include "JLang/JManip.hh" /** * \author mdejong, adomi */ namespace JGEOMETRY3D {} namespace JPP { using namespace JGEOMETRY3D; } namespace JGEOMETRY3D { using JIO::JReader; using JIO::JWriter; using JPHYSICS::JGeane; /** * 3D track with energy and Bjorken Y. */ class JTrack3EY : public JTrack3E { public: /** * Default constructor. */ JTrack3EY() : JTrack3E(), __Y(0.0) {} /** * Constructor. * * \param track track * \param Y Bjorken Y */ JTrack3EY(const JTrack3E& track, const double Y) : JTrack3E(track), __Y(Y) {} /** * Constructor. * * \param pos position * \param dir direction * \param t0 time at vertex * \param E energy at vertex * \param Y Bjorken Y */ JTrack3EY(const JVector3D& pos, const JVersor3D& dir, const JTime& t0, const double E, const double Y) : JTrack3E(pos, dir, t0, E), __Y(Y) {} /** * Constructor. * * \param vertex vertex * \param dir direction * \param E energy at vertex * \param Y Bjorken Y */ JTrack3EY(const JVertex3D& vertex, const JVersor3D& dir, const double E, const double Y) : JTrack3E(vertex, dir, E), __Y(Y) {} /** * Get Bjorken Y. * * \return Bjorken Y */ inline double getBjY() const { return __Y; } /** * Read track from input. * * \param in input stream * \param track track * \return input stream */ friend inline std::istream& operator>>(std::istream& in, JTrack3EY& track) { in >> static_cast(track); in >> track.__Y; return in; } /** * Write track to output. * * \param out output stream * \param track track * \return output stream */ friend inline std::ostream& operator<<(std::ostream& out, const JTrack3EY& track) { const JFormat format(out, getFormat(JFormat_t(9, 3, std::ios::fixed | std::ios::showpos))); out << static_cast(track); out << ' '; out << format << track.__Y; return out; } /** * Read track from input. * * \param in reader * \param track track * \return reader */ friend inline JReader& operator>>(JReader& in, JTrack3EY& track) { in >> static_cast(track); in >> track.__Y; return in; } /** * Write track to output. * * \param out writer * \param track track * \return writer */ friend inline JWriter& operator<<(JWriter& out, const JTrack3EY& track) { out << static_cast(track); out << track.__Y; return out; } protected: double __Y; }; } #endif