Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
software/JTrigger/JTriggerParameters.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 mdejong
13  */
14 
15 /**
16  * Streamer version of JTriggerParameters as obtained from ROOT file.
17  */
19 
20 
21 /**
22  * Read L2 parameters from input.
23  *
24  * \param in input stream
25  * \param parameters L2 parameters
26  * \return input stream
27  */
28 std::istream& operator>>(std::istream& in, JTRIGGER::JL2Parameters& parameters)
29 {
30  using namespace JPP;
31 
32  JRootReader(in, JEquationParameters(), JRootDictionary::getInstance()).get(parameters);
33 
34  return in;
35 }
36 
37 
38 /**
39  * Write L2 parameters to output.
40  *
41  * \param out output stream
42  * \param parameters L2 parameters
43  * \return output stream
44  */
45 std::ostream& operator<<(std::ostream& out, const JTRIGGER::JL2Parameters& parameters)
46 {
47  using namespace JPP;
48 
49  JRootWriter(out, JEquationParameters(), JRootDictionary::getInstance()).put(parameters);
50 
51  return out;
52 }
53 
54 
55 /**
56  * Read trigger parameters from input.
57  *
58  * \param in input stream
59  * \param parameters trigger parameters
60  * \return input stream
61  */
62 std::istream& operator>>(std::istream& in, JTRIGGER::JTriggerParameters& parameters)
63 {
64  using namespace std;
65  using namespace JPP;
66 
67  JStringStream is(in);
68 
69  if (getFileStatus(is.str().c_str())) {
70  is.load();
71  }
72 
73  JRootReader(is, JEquationParameters(), JRootDictionary::getInstance()).get(parameters);
74 
75  return in;
76 }
77 
78 
79 /**
80  * Write trigger parameters to output.
81  *
82  * \param out output stream
83  * \param parameters trigger parameters
84  * \return output stream
85  */
86 std::ostream& operator<<(std::ostream& out, const JTRIGGER::JTriggerParameters& parameters)
87 {
88  using namespace JPP;
89 
90  JRootWriter(out, JEquationParameters(), JRootDictionary::getInstance()).put(parameters);
91 
92  return out;
93 }
Data structure for all trigger parameters.
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 int ROOT_IO_VERSION
Streamer version of JTriggerParameters as obtained from ROOT file.
static JStat getFileStatus
Function object for file status.
Definition: JStat.hh:173
Data structure for L2 parameters.
static data_type & getInstance()
Get unique instance of template class.
Definition: JSingleton.hh:27
std::ostream & operator<<(std::ostream &stream, const CLBCommonHeader &header)
File status.