Monte Carlo run header.
More...
#include <JHead.hh>
|
static const std::string | GENHEN = "GENHEN" |
| Generators. More...
|
|
static const std::string | GENIE = "GENIE" |
|
static const std::string | GSEAGEN = "gSeaGen" |
|
static const std::string | MUPAGE = "HEMAS-DPM" |
|
static const std::string | JSIRENE = "JSirene" |
|
static const std::string | KM3 = "KM3" |
|
static const std::string | KM3SIM = "KM3Sim" |
|
|
template<class T > |
static bool | match (const T &first, const T &second) |
| Test match. More...
|
|
template<class T > |
static bool | match (const std::vector< T > &first, const std::vector< T > &second) |
| Test one container is subset of other container or vice versa. More...
|
|
template<class T > |
static bool | match (const JHead &first, const JHead &second, const bool option, T JHead::*pd) |
| Test match of given data member of headers. More...
|
|
Monte Carlo run header.
This class extends the Head class so that the data from specific tags can be promoted to concrete data types.
Note that for the copy of new JHead data (e.g. data not obtained via a previous JAANET::copy) to become effective, the key words in the corresponding map of the Head class should be set.
To this end, member method JHead::push can be used.
Definition at line 839 of file JHead.hh.
◆ JHead() [1/2]
Default constructor.
Definition at line 857 of file JHead.hh.
◆ JHead() [2/2]
JAANET::JHead::JHead |
( |
const Head & |
header | ) |
|
|
inline |
Copy constructor.
- Parameters
-
Definition at line 866 of file JHead.hh.
◆ ~JHead()
virtual JAANET::JHead::~JHead |
( |
| ) |
|
|
inlinevirtual |
Virtual destructor.
Definition at line 875 of file JHead.hh.
◆ getHeader() [1/2]
const JHead& JAANET::JHead::getHeader |
( |
| ) |
const |
|
inline |
Get header.
- Returns
- header
Definition at line 884 of file JHead.hh.
886 return static_cast<const JHead&>(*
this);
◆ getHeader() [2/2]
JHead& JAANET::JHead::getHeader |
( |
| ) |
|
|
inline |
Get header.
- Returns
- header
Definition at line 895 of file JHead.hh.
897 return static_cast<JHead&>(*
this);
◆ setHeader()
void JAANET::JHead::setHeader |
( |
const JHead & |
header | ) |
|
|
inline |
Set header.
- Parameters
-
Definition at line 906 of file JHead.hh.
908 static_cast<JHead&>(*
this) = header;
◆ pull() [1/2]
template<class T >
const_iterator JAANET::JHead::pull |
( |
T JHead::* |
pd | ) |
const |
|
inline |
Pull given data member from Head.
- Parameters
-
- Returns
- iterator of Head
Definition at line 919 of file JHead.hh.
◆ pull() [2/2]
template<class T >
iterator JAANET::JHead::pull |
( |
T JHead::* |
pd | ) |
|
|
inline |
Pull given data member from Head.
- Parameters
-
- Returns
- iterator of Head
Definition at line 932 of file JHead.hh.
◆ push()
template<class T >
void JAANET::JHead::push |
( |
T JHead::* |
pd | ) |
|
|
inline |
Push given data member to Head.
- Parameters
-
Definition at line 944 of file JHead.hh.
◆ erase()
template<class T >
void JAANET::JHead::erase |
( |
T JHead::* |
pd | ) |
|
|
inline |
Remove given data member from Head.
- Parameters
-
Definition at line 956 of file JHead.hh.
960 if (p != this->end()) {
964 static_cast<Head*>(
this)->erase(p);
◆ match() [1/4]
bool JAANET::JHead::match |
( |
const JHead & |
header, |
|
|
const bool |
option = true |
|
) |
| const |
|
inline |
Test match of headers.
Note that if option is set to false
, the match applies only to data which have a corresponding entry in the underlying map of the given header.
- Parameters
-
header | second header |
option | option |
- Returns
- true if matches; else false
Definition at line 979 of file JHead.hh.
◆ less()
bool JAANET::JHead::less |
( |
const JHead & |
header | ) |
const |
|
inline |
Comparison of headers.
- Parameters
-
- Returns
- true if this header less than given header; else false
Definition at line 1006 of file JHead.hh.
◆ add()
Addition of headers.
- Parameters
-
- Returns
- this header
Definition at line 1023 of file JHead.hh.
1025 if (
match(header)) {
1034 THROW(JException,
"JHead::add() headers do not match.");
◆ getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
<key>: <value> [<value>]*
<key>: <value> [<value>]*
- Returns
- equation parameters
Definition at line 1106 of file JHead.hh.
◆ setEquationParameters()
Set equation parameters.
- Parameters
-
equation | equation parameters |
Definition at line 1119 of file JHead.hh.
◆ read()
std::istream & JAANET::JHead::read |
( |
std::istream & |
in | ) |
|
Read header from input.
- Parameters
-
- Returns
- input stream
Definition at line 41 of file JHead.cc.
54 JRootReadableClass cls(*
this);
56 for (JEquation equation; reader >> equation && equation.getKey() != end_event::Class_Name(); ) {
58 JRedirectString redirect(reader, equation.getValue());
60 const JRootReadableClass abc = cls.find(equation.getKey().c_str());
63 reader.getObject(abc);
66 (*this)[equation.getKey()] = equation.getValue();
◆ write()
std::ostream & JAANET::JHead::write |
( |
std::ostream & |
out | ) |
const |
Write header to output.
- Parameters
-
out | output stream |
header | header |
- Returns
- output stream
- Parameters
-
- Returns
- output stream
Definition at line 79 of file JHead.cc.
86 JRootWritableClass cls(*
this);
88 TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
90 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
91 if (!JRootClass::is_static(*p)) {
92 if (this->find(p->GetName()) != this->end() ||
95 writer.put(p->GetName(), cls.get(*p),
true);
◆ print()
std::ostream & JAANET::JHead::print |
( |
std::ostream & |
out | ) |
const |
Print header to output.
- Parameters
-
- Returns
- output stream
Definition at line 110 of file JHead.cc.
119 JRootWritableClass cls(*
this);
121 TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
125 for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
126 if (!JRootClass::is_static(*p)) {
128 writer.put(p->GetName(), cls.get(*p),
true);
130 end_event = make_pair(p->GetName(), cls.get(*p));
134 for (JHead::const_iterator i = this->begin(); i != this->end(); ++i) {
135 if (!cls.find(i->first.c_str()).
is_valid()) {
136 out << i->first << parameters.getDefaultSeparator() << parameters.getDefaultWhiteSpace() << i->second << parameters.getDefaultEndOfLine();
◆ ClassDef()
JAANET::JHead::ClassDef |
( |
JHead |
, |
|
|
3 |
|
|
) |
| |
◆ match() [2/4]
template<class T >
static bool JAANET::JHead::match |
( |
const T & |
first, |
|
|
const T & |
second |
|
) |
| |
|
inlinestaticprivate |
Test match.
- Parameters
-
first | first object |
second | second object |
- Returns
- true if matches; else false
Definition at line 1164 of file JHead.hh.
1167 return first.match(second);
◆ match() [3/4]
Test one container is subset of other container or vice versa.
- Parameters
-
first | first object |
second | second object |
- Returns
- true if first (second) is subset of second (first); else false
Definition at line 1179 of file JHead.hh.
1186 if (
match(*ix, *iy)) {
1192 return ns == first.size() || ns == second.size();
◆ match() [4/4]
template<class T >
static bool JAANET::JHead::match |
( |
const JHead & |
first, |
|
|
const JHead & |
second, |
|
|
const bool |
option, |
|
|
T JHead::* |
pd |
|
) |
| |
|
inlinestaticprivate |
Test match of given data member of headers.
Note that if option is set to false
, the match applies only to data which have a corresponding tag in the underlying map of the second header.
- Parameters
-
first | first header |
second | second header |
option | option |
pd | pointer to data member
|
- Returns
- true if matches; else false
Definition at line 1209 of file JHead.hh.
1214 if (option || second.
pull(pd) != second.end())
1215 return match(first.*pd, second.*pd);
◆ operator==
bool operator== |
( |
const JHead & |
first, |
|
|
const JHead & |
second |
|
) |
| |
|
friend |
Equal operator.
Note that this operator uses the JHead::match method.
- Parameters
-
first | first header |
second | second header |
- Returns
- true if two headers are equal; else false
Definition at line 1050 of file JHead.hh.
1053 return first.
match(second);
◆ operator<
bool operator< |
( |
const JHead & |
first, |
|
|
const JHead & |
second |
|
) |
| |
|
friend |
Less than operator.
- Parameters
-
first | first header |
second | second header |
- Returns
- true if first header is less than second header; else false
Definition at line 1064 of file JHead.hh.
1067 return first.
less(second);
◆ GENHEN
const std::string JAANET::JHead::GENHEN = "GENHEN" |
|
static |
Generators.
Applications.
Definition at line 845 of file JHead.hh.
◆ GENIE
const std::string JAANET::JHead::GENIE = "GENIE" |
|
static |
◆ GSEAGEN
const std::string JAANET::JHead::GSEAGEN = "gSeaGen" |
|
static |
◆ MUPAGE
const std::string JAANET::JHead::MUPAGE = "HEMAS-DPM" |
|
static |
◆ JSIRENE
const std::string JAANET::JHead::JSIRENE = "JSirene" |
|
static |
◆ KM3
const std::string JAANET::JHead::KM3 = "KM3" |
|
static |
◆ KM3SIM
const std::string JAANET::JHead::KM3SIM = "KM3Sim" |
|
static |
◆ start_run
◆ XSecFile
◆ detector
◆ muon_desc_file
◆ target
◆ physics
◆ simul
◆ cut_primary
◆ cut_seamuon
◆ cut_in
◆ cut_nu
◆ spectrum
◆ can
◆ fixedcan
◆ genvol
◆ coord_origin
◆ genhencut
◆ norma
◆ livetime
◆ seabottom
◆ DAQ
◆ tgen
◆ primary
◆ end_event
The documentation for this struct was generated from the following files:
std::vector< JAANET::physics > physics
std::vector< JAANET::simul > simul
bool match(const JHead &header, const bool option=true) const
Test match of headers.
JAANET::end_event end_event
JAANET::fixedcan fixedcan
bool less(const cut &object) const
Comparison.
livetime & add(const livetime &object)
Addition.
JAANET::livetime livetime
T & getInstance(const T &object)
Get static instance from temporary object.
JAANET::coord_origin coord_origin
bool is_valid(const T &value)
Check validity of given value.
JAANET::seabottom seabottom
bool less(const primary &object) const
Comparison.
JAANET::start_run start_run
genvol & add(const genvol &object)
Addition.
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).
const TDataMember * getDataMember(const JRootClass &parent, const JRootClass &member)
Get ROOT data member for given parent and member class.
const_iterator pull(T JHead::*pd) const
Pull given data member from Head.
static JStat getFileStatus
Function object for file status.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Phase space of primary particle.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
static JLANG::JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
Normalisation of MUPAGE events.
JAANET::cut_seamuon cut_seamuon
norma & add(const norma &object)
Addition.
JAANET::spectrum spectrum
Normlisation of CORSIKA events.
bool less(const JHead &header) const
Comparison of headers.
JAANET::cut_primary cut_primary
DAQ & add(const DAQ &object)
Addition.