Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JHeadWriter.hh
Go to the documentation of this file.
1#ifndef __JAANET__JHEADWRITER__
2#define __JAANET__JHEADWRITER__
3
5
9#include "JAAnet/JHead.hh"
10#include "JAAnet/JAAnetDictionary.hh"
11
12
13/**
14 * \author mdejong
15 */
16
17namespace JAANET {
18
19 using JLANG::JEquation;
23
24
25 /**
26 * Implementation for Head output of JHead objects with ROOT dictionary.
27 */
28 struct JHeadWriter :
29 public JRootWriter
30 {
31 using JRootWriter::put;
32
33 /**
34 * Constructor.
35 *
36 * \param header header output
37 * \param parameters equation parameters
38 * \param dictionary dictionary
39 */
41 const JEquationParameters& parameters,
43 JRootWriter(JLANG::null, parameters, dictionary),
45 {}
46
47
48 /**
49 * Write equation.
50 *
51 * \param equation equation
52 * \return this ROOT writer
53 */
54 virtual JRootWriter& put(const JEquation& equation) override
55 {
56 using namespace std;
57
58 string key = equation.getKey();
59
60 for (int i = 1; header.find(key) != header.end(); ++i) {
61 key = getTag(equation.getKey(), i);
62 }
63
64 header[key] = equation.getValue();
65
66 return *this;
67 }
68
69 private:
71 };
72}
73
74#endif
JNET::JTag getTag(JLANG::JType< KM3NETDAQ::JDAQTimeslice >)
Definition JDAQTags.hh:94
ASCII I/O of objects with ROOT dictionary.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
General purpose equation class.
Definition JEquation.hh:47
const std::string & getKey() const
Get key.
Definition JEquation.hh:163
const std::string & getValue() const
Get value.
Definition JEquation.hh:185
Implementation for ASCII output of objects with ROOT dictionary.
JRootWriter & put(const T &object)
Write object according equation format.
const JRootDictionary_t & dictionary
Extensions to Evt data format.
Auxiliary classes and methods for language specific functionality.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Definition Head.hh:65
Implementation for Head output of JHead objects with ROOT dictionary.
virtual JRootWriter & put(const JEquation &equation) override
Write equation.
JHeadWriter(Head &header, const JEquationParameters &parameters, const JRootDictionary_t &dictionary)
Constructor.
Type definition of ROOT based dictionary for ASCII I/O.