Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
software/JTrigger/JTriggerParameters.cc
Go to the documentation of this file.
1#include "JSystem/JStat.hh"
5#include "JTrigger/JTriggerDictionary.hh"
6
7/**
8 * \author mdejong
9 */
10
11/**
12 * Streamer version of JTriggerParameters as obtained from ROOT file.
13 */
15
16
17/**
18 * Read L2 parameters from input.
19 *
20 * \param in input stream
21 * \param parameters L2 parameters
22 * \return input stream
23 */
24std::istream& operator>>(std::istream& in, JTRIGGER::JL2Parameters& parameters)
25{
26 using namespace JPP;
27
28 JRootReader(in, JEquationParameters(), JTriggerDictionary::getInstance()).get(parameters);
29
30 return in;
31}
32
33
34/**
35 * Write L2 parameters to output.
36 *
37 * \param out output stream
38 * \param parameters L2 parameters
39 * \return output stream
40 */
41std::ostream& operator<<(std::ostream& out, const JTRIGGER::JL2Parameters& parameters)
42{
43 using namespace JPP;
44
45 JRootWriter(out, JEquationParameters(), JTriggerDictionary::getInstance()).put(parameters);
46
47 return out;
48}
49
50
51/**
52 * Read trigger parameters from input.
53 *
54 * \param in input stream
55 * \param parameters trigger parameters
56 * \return input stream
57 */
58std::istream& operator>>(std::istream& in, JTRIGGER::JTriggerParameters& parameters)
59{
60 using namespace JPP;
61
62 JStringStream is(in);
63
64 if (getFileStatus(is.str().c_str())) {
65 is.load();
66 }
67
68 JRootReader(is, JEquationParameters(), JTriggerDictionary::getInstance()).get(parameters);
69
70 return in;
71}
72
73
74/**
75 * Write trigger parameters to output.
76 *
77 * \param out output stream
78 * \param parameters trigger parameters
79 * \return output stream
80 */
81std::ostream& operator<<(std::ostream& out, const JTRIGGER::JTriggerParameters& parameters)
82{
83 using namespace JPP;
84
85 JRootWriter(out, JEquationParameters(), JTriggerDictionary::getInstance()).put(parameters);
86
87 return out;
88}
ASCII I/O of objects with ROOT dictionary.
File status.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Wrapper class around STL stringstream class to facilitate optional loading of data from file.
void load()
Load data from file with name corresponding to current contents.
Implementation for ASCII input of objects with ROOT dictionary.
JRootReader & get(T &object)
Read object according equation format.
Implementation for ASCII output of objects with ROOT dictionary.
JRootWriter & put(const T &object)
Write object according equation format.
Data structure for all trigger parameters.
static int ROOT_IO_VERSION
Streamer version of JTriggerParameters as obtained from ROOT file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static JStat getFileStatus
Function object for file status.
Definition JStat.hh:173
JWriter & operator<<(JWriter &out, const JDAQChronometer &chronometer)
Write DAQ chronometer to output.
JReader & operator>>(JReader &in, JDAQChronometer &chronometer)
Read DAQ chronometer from input.
Data structure for L2 parameters.