16 #include "JAAnet/JAAnetDictionary.hh"
33 JRootReadableClass cls(*
this);
35 unique_ptr<TIterator>
i(cls.getClass()->GetListOfDataMembers()->MakeIterator());
37 for (
const TDataMember* p; (p = (
const TDataMember*)
i->Next()) != NULL; ) {
38 if (!JRootClass::is_static(*p)) {
39 if (this->
count(p->GetName()) == 0) {
40 (*this)[p->GetName()] =
"";
66 JRootReadableClass cls(*
this);
68 for (
JEquation equation; reader >> equation && equation.
getKey() != end_event::Class_Name(); ) {
70 JRedirectString redirect(reader, equation.getValue());
72 const JRootReadableClass abc = cls.find(equation.getKey().c_str());
75 reader.getObject(abc);
78 (*this)[equation.getKey()] = equation.getValue();
98 JRootWritableClass cls(*
this);
100 unique_ptr<TIterator>
i(cls.getClass()->GetListOfDataMembers()->MakeIterator());
102 for (
const TDataMember* p; (p = (
const TDataMember*)
i->Next()) != NULL; ) {
103 if (!JRootClass::is_static(*p)) {
104 if (this->find(p->GetName()) != this->end() ||
107 writer.
put(p->GetName(), cls.get(*p),
true);
129 JRootWritableClass cls(*
this);
131 unique_ptr<TIterator>
i(cls.getClass()->GetListOfDataMembers()->MakeIterator());
135 for (
const TDataMember* p; (p = (
const TDataMember*)
i->Next()) != NULL; ) {
136 if (!JRootClass::is_static(*p)) {
138 writer.
put(p->GetName(), cls.get(*p),
true);
140 end_event = make_pair(p->GetName(), cls.get(*p));
144 for (JHead::const_iterator
i = this->begin();
i != this->end(); ++
i) {
145 if (!cls.find(
i->first.c_str()).
is_valid()) {
146 writer.
put(
i->first,
i->second);
150 writer.
put(end_event.first, end_event.second,
true);
169 JRootReadableClass cls(to);
171 for (Head::const_iterator
i = from.begin();
i != from.end(); ++
i) {
173 const JRootReadableClass& abc = cls.find(
getTag(
i->first).c_str());
175 const string buffer =
trim(
i->second);
177 if (abc.is_valid() && buffer !=
"") {
179 JRedirectString redirect(reader, buffer);
181 reader.getObject(abc);
210 JRootWritableClass cls(from);
212 unique_ptr<TIterator>
i(cls.getClass()->GetListOfDataMembers()->MakeIterator());
214 for (
const TDataMember* p; (p = (
const TDataMember*)
i->Next()) != NULL; ) {
215 if (!JRootClass::is_static(*p)) {
216 if (from.find(p->GetName()) != from.end() ||
219 writer.
put(p->GetName(), cls.get(*p),
true);
226 for (JHead::const_iterator
i = from.begin();
i != from.end(); ++
i) {
227 if (to.find(
i->first) == to.end()) {
std::ostream & print(std::ostream &out) const
Print header to output.
const std::string & getKey() const
Get key.
bool is_valid(T JHead::*pd) const
Check validity of given data member in JHead.
Implementation for ASCII output of objects with ROOT dictionary.
JAANET::start_run start_run
then usage $script< input file >[option] nPossible options count
std::istream & read(std::istream &in)
Read header from input.
std::string trim(const std::string &buffer)
Trim string.
General purpose equation class.
ASCII I/O of objects with ROOT dictionary.
T & getInstance(const T &object)
Get static instance from temporary object.
void push()
Push all data members to Head.
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.
then fatal The output file must have the wildcard in the e g root fi 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
void copy(const Head &from, JHead &to)
Copy header from from to to.
static JLANG::JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
JAANET::end_event end_event
std::ostream & write(std::ostream &out) const
Write header to output.
JRootWriter & put(const T &object)
Write object according equation format.
Implementation for Head output of JHead objects with ROOT dictionary.
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