15 #include "JAAnet/JAAnetDictionary.hh"
32 JRootReadableClass cls(*
this);
34 TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
36 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
37 if (!JRootClass::is_static(*p)) {
38 if (this->
count(p->GetName()) == 0) {
39 (*this)[p->GetName()] =
"";
65 JRootReadableClass cls(*
this);
67 for (
JEquation equation; reader >> equation && equation.
getKey() != end_event::Class_Name(); ) {
69 JRedirectString redirect(reader, equation.getValue());
71 const JRootReadableClass abc = cls.find(equation.getKey().c_str());
74 reader.getObject(abc);
77 (*this)[equation.getKey()] = equation.getValue();
97 JRootWritableClass cls(*
this);
99 TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
101 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
102 if (!JRootClass::is_static(*p)) {
103 if (this->find(p->GetName()) != this->end() ||
106 writer.
put(p->GetName(), cls.get(*p),
true);
128 JRootWritableClass cls(*
this);
130 TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
134 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
135 if (!JRootClass::is_static(*p)) {
137 writer.
put(p->GetName(), cls.get(*p),
true);
139 end_event = make_pair(p->GetName(), cls.get(*p));
143 for (JHead::const_iterator i = this->begin(); i != this->end(); ++i) {
144 if (!cls.find(i->first.c_str()).
is_valid()) {
145 writer.
put(i->first, i->second);
149 writer.
put(end_event.first, end_event.second,
true);
168 JRootReadableClass cls(to);
170 for (Head::const_iterator i = from.begin(); i != from.end(); ++i) {
172 const JRootReadableClass& abc = cls.find(
getTag(i->first).c_str());
174 const string buffer =
trim(i->second);
176 if (abc.is_valid() && buffer !=
"") {
178 JRedirectString redirect(reader, buffer);
180 reader.getObject(abc);
182 if (i->first ==
getTag(i->first)) {
209 JRootWritableClass cls(from);
211 TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
213 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
214 if (!JRootClass::is_static(*p)) {
215 if (from.find(p->GetName()) != from.end() ||
218 writer.
put(p->GetName(), cls.get(*p),
true);
225 for (JHead::const_iterator i = from.begin(); i != from.end(); ++i) {
226 if (to.find(i->first) == to.end()) {
void push()
Push all data members to Head.
const std::string & getKey() const
Get key.
Implementation for ASCII output of objects with ROOT dictionary.
std::string trim(const std::string &buffer)
Trim string.
JAANET::end_event end_event
General purpose equation class.
ASCII I/O of objects with ROOT dictionary.
T & getInstance(const T &object)
Get static instance from temporary object.
static JLANG::JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
std::istream & read(std::istream &in)
Read header from input.
JAANET::start_run start_run
std::ostream & print(std::ostream &out) const
Print header to output.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
static JStat getFileStatus
Function object for file status.
virtual JRootWriter & put(const JEquation &equation) override
Write equation.
void copy(const Head &from, JHead &to)
Copy header from from to to.
JRootWriter & put(const T &object)
Write object according equation format.
Implementation for Head output of JHead objects with ROOT dictionary.
bool is_valid(T JHead::*pd) const
Check validity of given data member in JHead.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
std::string getTag(const std::string &tag)
Get tag without aanet extension "_<counter>" for identical tags.
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
std::ostream & write(std::ostream &out) const
Write header to output.