#include <istream>
#include <ostream>
  
#include "JSystem/JStat.hh"
#include "JReconstruction/JShowerBjorkenYParameters_t.hh"
#include "JROOT/JRootStreamer.hh"
#include "JROOT/JRootDictionary.hh"
#include "JLang/JStringStream.hh"
  
/**
 * Read fit parameters from input.
 *
 * \param  in           input stream
 * \param  parameters   fit parameters
 * \return              input stream
 */
std::istream& operator>>(std::istream& in, JRECONSTRUCTION::JShowerBjorkenYParameters_t& parameters)
{
  using namespace std;
  using namespace JPP;

  JStringStream is(in);

  if (getFileStatus(is.str().c_str())) {
    is.load();
  }
 
  JRootReader(is, JEquationParameters(), JRootDictionary::getInstance()).get(parameters);
 
  return in;
}
   
  
/**
 * Write fit parameters to output.
 *
 * \param  out          output stream
 * \param  parameters   fit parameters
 * \return              output stream
 */
std::ostream& operator<<(std::ostream& out, const JRECONSTRUCTION::JShowerBjorkenYParameters_t& parameters)
{
  using namespace JPP;

  JRootWriter(out, JEquationParameters(), JRootDictionary::getInstance()).put(parameters);
 
  return out;
}