Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JMuonParameters.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 gmaggi
13  */
14 
15 /**
16  * Streamer version of JMuonParameters 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::JMuonParameters& 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::JMuonParameters& parameters)
53 {
54  using namespace JPP;
55 
56  JRootWriter(out, JEquationParameters(), JRootDictionary::getInstance()).put(parameters);
57 
58  return out;
59 }
std::istream & operator>>(std::istream &in, JHead &header)
Read header from input.
ASCII I/O of objects with ROOT dictionary.
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:73
static JStat getFileStatus
Function object for file status.
Definition: JStat.hh:173
static int ROOT_IO_VERSION
Streamer version of JMuonParameters as obtained from ROOT file.
std::ostream & operator<<(std::ostream &stream, const CLBCommonHeader &header)
File status.