17#include "JAAnet/JAAnetDictionary.hh"
36 unique_ptr<TIterator> i(cls.
getClass()->GetListOfDataMembers()->MakeIterator());
38 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
39 if (!JRoot::is_static(*p)) {
40 if (this->count(p->GetName()) == 0) {
41 (*this)[p->GetName()] =
"";
61 if (getFileStatus(is.str().c_str())) {
69 for (
JEquation equation; reader >> equation && equation.getKey() != end_event::Class_Name(); ) {
79 (*this)[equation.getKey()] = equation.getValue();
101 unique_ptr<TIterator> i(cls.
getClass()->GetListOfDataMembers()->MakeIterator());
103 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
104 if (!JRoot::is_static(*p)) {
105 if (this->find(p->GetName()) != this->end() ||
108 writer.
put(p->GetName(), cls.
get(*p),
true);
132 unique_ptr<TIterator> i(cls.
getClass()->GetListOfDataMembers()->MakeIterator());
136 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
137 if (!JRoot::is_static(*p)) {
139 writer.
put(p->GetName(), cls.
get(*p),
true);
145 for (JHead::const_iterator i = this->begin(); i != this->end(); ++i) {
147 writer.
put(i->first, i->second);
172 for (Head::const_iterator i = from.begin(); i != from.end(); ++i) {
176 const string buffer = trim(i->second);
178 if (abc.
is_valid() && buffer !=
"") {
184 if (i->first ==
getTag(i->first)) {
213 unique_ptr<TIterator> i(cls.
getClass()->GetListOfDataMembers()->MakeIterator());
215 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
216 if (!JRoot::is_static(*p)) {
217 if (from.find(p->GetName()) != from.end() ||
220 writer.
put(p->GetName(), cls.
get(*p),
true);
227 for (JHead::const_iterator i = from.begin(); i != from.end(); ++i) {
228 if (to.find(i->first) == to.end()) {
ASCII I/O of objects with ROOT dictionary.
std::istream & read(std::istream &in)
Read header from input.
JAANET::start_run start_run
std::ostream & write(std::ostream &out) const
Write header to output.
void push()
Push all data members to Head.
std::ostream & print(std::ostream &out) const
Print header to output.
JAANET::end_event end_event
static JLANG::JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
General purpose equation class.
This class can be used to temporarily redirect an input stream to an input string.
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.
const char * c_str() const
C-string.
Implementation for ASCII input of objects with ROOT dictionary.
JRootReader & getObject(T &object)
Read object.
Implementation for ASCII output of objects with ROOT dictionary.
JRootWriter & put(const T &object)
Write object according equation format.
Extensions to Evt data format.
void copy(const Head &from, JHead &to)
Copy header from from to to.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Implementation for Head output of JHead objects with ROOT dictionary.
virtual JRootWriter & put(const JEquation &equation) override
Write equation.
bool is_valid() const
Check validity of this addressable class.
JRootAddressableClass find(const char *const name) const
Find addressable base class or data member with given name within current class.
JRootAddressableClass get(const TDataMember &object) const
Get addressable class of given data member.
Auxiliary class to manage access to base classes and data members of ROOT class.
TClass * getClass() const
Get class.
ROOT class for reading into object.
ROOT class for writing from object.