16 #include "JAAnet/JAAnetDictionary.hh"
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()] =
"";
68 for (
JEquation equation; reader >> equation && equation.getKey() != end_event::Class_Name(); ) {
78 (*this)[equation.getKey()] = equation.getValue();
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);
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);
144 for (JHead::const_iterator i = this->begin(); i != this->end(); ++i) {
146 writer.
put(i->first, i->second);
171 for (Head::const_iterator i = from.begin(); i != from.end(); ++i) {
175 const string buffer =
trim(i->second);
177 if (abc.
is_valid() && buffer !=
"") {
183 if (i->first ==
getTag(i->first)) {
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()) {
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.
static JLANG::JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
void push()
Push all data members to Head.
std::ostream & print(std::ostream &out) const
Print header to output.
JAANET::end_event end_event
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.
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.
std::string getTag(const std::string &tag)
Get tag without aanet extension "_<counter>" for identical tags.
T & getInstance(const T &object)
Get static instance from temporary object.
std::string trim(const std::string &buffer)
Trim string.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static JStat getFileStatus
Function object for file status.
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 get(const TDataMember &data_member) const
Get addressable class of given data member.
JRootAddressableClass find(const char *const name) const
Find addressable base class or data member with given name within current class.
Auxiliary class to manage access to base classes and data members of ROOT class.
TClass * getClass() const
Get class.
ROOT class for reading object.
ROOT class for writing object.