Jpp
JShowerParameters.cc
Go to the documentation of this file.
1 #include <sstream>
2 #include <fstream>
3 
4 #include "JSystem/JStat.hh"
6 #include "JROOT/JRootStreamer.hh"
8 #include "JLang/JStringStream.hh"
9 
10 
11 /**
12  * \author adomi
13  */
14 
15 /**
16  * Streamer version of JShowerParameters as obtained from ROOT file.
17  */
19 
20 
21 /**
22  * Read fit parameters from input.
23  *
24  * \param in input stream
25  * \param parameters fit parameters
26  * \return input stream
27  */
28 std::istream& operator>>(std::istream& in, JFIT::JShowerParameters& parameters)
29 {
30  using namespace std;
31  using namespace JPP;
32 
33  JStringStream is(in);
34 
35  if (getFileStatus(is.str().c_str())) {
36  is.load();
37  }
38 
39  JRootReader(is, JEquationParameters(), JRootDictionary::getInstance()).get(parameters);
40 
41  return in;
42 }
43 
44 
45 /**
46  * Write fit parameters to output.
47  *
48  * \param out output stream
49  * \param parameters fit parameters
50  * \return output stream
51  */
52 std::ostream& operator<<(std::ostream& out, const JFIT::JShowerParameters& parameters)
53 {
54  using namespace JPP;
55 
56  JRootWriter(out, JEquationParameters(), JRootDictionary::getInstance()).put(parameters);
57 
58  return out;
59 }
operator<<
std::ostream & operator<<(std::ostream &out, const JFIT::JShowerParameters &parameters)
Write fit parameters to output.
Definition: JShowerParameters.cc:52
JLANG::getInstance
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:73
JRootStreamer.hh
JShowerParameters.hh
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JSYSTEM::getFileStatus
static JStat getFileStatus
Function object for file status.
Definition: JStat.hh:173
JStringStream.hh
JStat.hh
JFIT::JShowerParameters::ROOT_IO_VERSION
static int ROOT_IO_VERSION
Streamer version of JShowerParameters as obtained from ROOT file.
Definition: JShowerParameters.hh:53
JFIT::JShowerParameters
Definition: JShowerParameters.hh:20
JRootDictionary.hh
std
Definition: jaanetDictionary.h:36
operator>>
std::istream & operator>>(std::istream &in, JFIT::JShowerParameters &parameters)
Read fit parameters from input.
Definition: JShowerParameters.cc:28