1 #ifndef __JAANET_JHEADTOOLKIT__
2 #define __JAANET_JHEADTOOLKIT__
54 object.push_back(element);
77 if (!
object.empty()) {
106 const int offset = (
const char*) &(header.*p) - (
const char*) &header;
108 const JRootClass cls(getType<JHead>());
110 TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
112 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
114 const JRootClass abc = cls.get(*p);
116 if (abc == JRootClass(JType<T>()) && offset == abc.getOffset()) {
117 header[p->GetName()] =
"";
133 if (i->program == generator) {
221 inline T
get(
const JHead& head);
235 return header.coord_origin;
240 return Vec(0.0, 0.0, -header.can.zmin);
241 else if (
is_valid(header.coord_origin))
242 return header.coord_origin;
244 return Vec(0.0, 0.0, 0.0);
258 const Vec pos = get<Vec>(header);
273 using namespace JGEOMETRY2D;
296 add< std::vector<JAANET::physics> >();
342 using namespace JLANG;
343 using namespace JROOT;
350 for (
JEquation equation; reader >> equation && equation.getKey() != end_event::Class_Name(); ) {
356 if (abc.is_valid()) {
374 using namespace JLANG;
375 using namespace JROOT;
381 TIterator* i = cls.
getClass()->GetListOfDataMembers()->MakeIterator();
383 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
384 if (!JRootClass::is_static(*p)) {
385 writer.
put(p->GetName(), cls.
get(*p),
true);
bool is_mupage(const JHead &header)
Check for generator.
Data structure for vector in two dimensions.
static const std::string GSEAGEN
std::istream & operator>>(std::istream &in, JHead &header)
Read header from input.
static const std::string KM3
Implementation for ASCII output of objects with ROOT dictionary.
Data structure for circle in two dimensions.
Helper class for user formatting.
Simple wrapper class around JROOT::JRootDictionary so that other classes could be included in this di...
std::vector< JAANET::physics > physics
Simple data structure to support I/O of equations (see class JLANG::JEquation).
void push(JHead &header, T JHead::*p)
Push data of JHead for subsequent copy to Head.
static JRootReader & getObject(JRootReader &reader, T &object)
Read object.
Generator for neutrino interaction.
Description of Monte Carlo event generation applications.
General purpose equation class.
ROOT class for writing object.
static JRootWriter & putObject(JRootWriter &writer, const std::vector< JAANET::physics > &object)
Write object.
Implementation for ASCII input of objects with ROOT dictionary.
ASCII I/O of objects with ROOT dictionary.
ROOT class for reading object.
static const std::string MUPAGE
static JRootWriter & put(JRootWriter &writer, const std::string &key, const T &value)
Write given key and value according equation format.
static const std::string GENIE
static const std::string JSIRENE
Default helper class for formatting.
static JRootReader & getObject(JRootReader &reader, std::vector< JAANET::physics > &object)
Read object.
JRootAddressableClass get(const TDataMember &data_member) const
Get addressable class of given data member.
JAAnetDictionary()
Default constructor.
bool is_genhen(const JHead &header)
Check for generator.
bool is_physics(const JHead &header, const std::string &generator)
Check for generator.
bool is_sirene(const JHead &header)
Check for generator.
TClass * getClass() const
Get class.
static JRootDictionary & getInstance()
Get reference to unique instance of this class object.
bool is_km3sim(const JHead &header)
Check for generator.
static JRootWriter & putObject(JRootWriter &writer, const T &object)
Write object.
Data structure for position in three dimensions.
static const std::string GENHEN
Generators.
Helper class for user formatting.
JRootAddressableClass find(const char *name) const
Find addressable base class or data member with given name within current class.
This class can be used to temporarily redirect an input stream to an input string.
const JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
std::ostream & operator<<(std::ostream &out, const JHead &header)
Write header to output.
bool is_valid(const T &value)
Check validity of given value.
bool is_genie(const JHead &header)
Check for generator.
bool is_km3(const JHead &header)
Check for generator.