#ifndef __JSHOWER3EZ__ #define __JSHOWER3EZ__ #include #include #include "JMath/JMath.hh" #include "JFit/JShower3Z.hh" #include "JFit/JEnergy.hh" /** * \author lquinn */ namespace JFIT {} namespace JPP { using namespace JFIT; } namespace JFIT { using JMATH::JMath; /** * Data structure for fit of straight line in positive z-direction with energy. * Note that the position coordinates are defined with respect to the given direction. */ class JShower3EZ : public JShower3Z, public JEnergy, public JMath { public: /** * Default constructor. */ JShower3EZ() : JShower3Z(), JEnergy() {} /** * Constructor. * * \param line line * \param x energy * \param By bjorken y */ JShower3EZ(const JShower3Z& line, const JEnergy& x, const double By = 1.0) : JShower3Z(line), JEnergy(x), __By(By) {} /** * Constructor. * * \param point point * \param dir direction * \param x energy * \param By bjorken y */ JShower3EZ(const JPoint4D& point, const JVersor3Z& dir, const JEnergy& x, const double By = 1.0): JShower3Z(JPoint4D(point), JVersor3Z(dir)), JEnergy(x), __By(By) {} /** * Get bjorken y * * \return bjorken y */ double getBy() const { return __By; } /** * Prefix unary minus. * * \return shower */ JShower3EZ& negate() { JShower3Z::negate(); JEnergy::negate(); __By = -__By; return *this; } /** * Addition operator. * * \param value shower * \return shower */ JShower3EZ& add(const JShower3EZ& value) { JShower3Z::add(value); JEnergy::add(value); __By += value.getBy(); return *this; } /** * Subtraction operator. * * \param value shower * \return shower */ JShower3EZ& sub(const JShower3EZ& value) { JShower3Z::sub(value); JEnergy::sub(value); __By -= value.getBy(); return *this; } /** * Multiplication operator. * * \param value multiplication factor * \return shower */ JShower3EZ& mul(const double value) { JShower3Z::mul(value); JEnergy::mul(value); __By *= value; return *this; } /** * Division operator. * * \param value division factor * \return shower */ JShower3EZ& div(const double value) { JShower3Z::div(value); JEnergy::div(value); __By /= 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, JShower3EZ& object) { in >> static_cast(object); in >> static_cast(object); in >> object.__By; 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 JShower3EZ& object) { out << static_cast(object); out << static_cast(object); out << object.__By; return out; } typedef double JShower3EZ::*parameter_type; static parameter_type pBy() { return &JShower3EZ::__By; } protected: double __By; }; } #endif