1 #ifndef __JAANET__JHEAD__ 
    2 #define __JAANET__JHEAD__ 
   94   inline std::string 
getTag(
const std::string& tag)
 
  100     if (pos != string::npos) {
 
  102       for (string::size_type i = pos + 1; i != tag.size(); ++i) {
 
  103         if (!isdigit(tag[i])) {
 
  108       return tag.substr(0, pos);
 
  122   inline std::string 
getTag(
const std::string& tag, 
const int counter)
 
  124     std::ostringstream os;
 
  168       return !(*this).less(
object) && !(object).
less(*
this);
 
  181       istringstream i0(
this ->
buffer);
 
  182       istringstream i1(
object.
buffer);
 
  187       copy(istream_iterator<string>(i0), istream_iterator<string>(), back_inserter(v0));
 
  188       copy(istream_iterator<string>(i1), istream_iterator<string>(), back_inserter(v1));
 
  214       return out << 
object.buffer;
 
  242       return this->program == 
object.program && this->filename == 
object.filename; 
 
  256       in >> 
object.program >> 
object.filename;
 
  259         object.filename = 
object.program;
 
  260         object.program  = 
"?";
 
  275       return out << 
object.program << 
' ' << 
object.filename;
 
  331     static const std::string 
statical()  { 
return "statical"; }
 
  332     static const std::string 
dynamical() { 
return "dynamical"; }
 
  372         const double cosTmin,
 
  373         const double cosTmax) :
 
  375       cosT(cosTmin, cosTmax)
 
  386       if (E.getLowerLimit() == 
object.E.getLowerLimit()) {
 
  388         if (E.getUpperLimit() == 
object.E.getUpperLimit()) {
 
  390           if (cosT.getLowerLimit() == 
object.cosT.getLowerLimit()) {
 
  391             return cosT.getUpperLimit() < 
object.cosT.getUpperLimit();
 
  393             return cosT.getLowerLimit() < 
object.cosT.getLowerLimit();
 
  398           return E.getUpperLimit() < 
object.E.getUpperLimit();
 
  403         return E.getLowerLimit() < 
object.E.getLowerLimit();
 
  415       return (E   .
equals(
object.E) &&
 
  416               cosT.equals(
object.cosT));
 
  488       return program < 
object.program;
 
  501       return program == 
object.program;
 
  552       return alpha < 
object.alpha;
 
  563       return (alpha == 
object.alpha);
 
  593       return (zmin == 
object.zmin &&
 
  594               zmax == 
object.zmax &&
 
  629       return (xcenter == 
object.xcenter &&
 
  630               ycenter == 
object.ycenter &&
 
  631               zmin    == 
object.zmin    &&
 
  632               zmax    == 
object.zmax    &&
 
  633               radius  == 
object.radius);
 
  669       return volume < 
object.volume;
 
  680       return (zmin   == 
object.zmin &&
 
  681               zmax   == 
object.zmax &&
 
  683               volume == 
object.volume);
 
  707                        const double z = 0.0)
 
  709       zmin    = (zmin - z) * factor  +  z;
 
  710       zmax    = (zmax - z) * factor  +  z;
 
  712       volume *= factor * factor * factor;
 
  761       return (
x == 
object.
x &&
 
  809       return (primaryFlux == 
object.primaryFlux);
 
  852       return numberOfSeconds < 
object.numberOfSeconds;
 
  863       return ((numberOfSeconds == 0.0 && 
object.numberOfSeconds == 0.0) ||
 
  864               (numberOfSeconds >  0.0 && 
object.numberOfSeconds >  0.0));
 
  876       errorOfSeconds   = sqrt(errorOfSeconds        * errorOfSeconds  +  
 
  877                               object.errorOfSeconds * 
object.errorOfSeconds);
 
  890       numberOfSeconds /= (factor * factor);
 
  891       errorOfSeconds  /= (factor * factor);
 
  926       return type < 
object.type;
 
  937       return type == 
object.type;
 
  968       return (z == 
object.z);
 
  996       return (z == 
object.z);
 
 1025       return livetime_s < 
object.livetime_s;
 
 1036       return ((livetime_s == 0.0 && 
object.livetime_s == 0.0) ||
 
 1037               (livetime_s >  0.0 && 
object.livetime_s >  0.0));
 
 1079       return livetime_s < 
object.livetime_s;
 
 1090       return ((livetime_s == 0.0 && 
object.livetime_s == 0.0) ||
 
 1091               (livetime_s >  0.0 && 
object.livetime_s >  0.0));
 
 1132       return this->numberOfSeconds == 
object.numberOfSeconds;
 
 1161       return (this->t1 == 
object.t1 && this->t2 == 
object.t2);
 
 1190       return type < 
object.type;
 
 1201       return (type == 
object.type);
 
 1254       copy(header, *
this);
 
 1272       return static_cast<const JHead&
>(*this);
 
 1283       return static_cast<JHead&
>(*this);
 
 1294       static_cast<JHead&
>(*this) = header;
 
 1321       return (this->pull(pd) != this->end());
 
 1336       static const T value;
 
 1338       return (
object.
less(value) || value.less(
object));
 
 1398       if (p != this->end()) {
 
 1399         static_cast<Head*
>(
this)->erase(p);
 
 1412 #define IF_MATCH(A, B, C, D)            \ 
 1413       if (match(B,C,D)) { A.push(D);  } \ 
 1414       else              { A.erase(D); } 
 1462       const JHead head = getMatch(header);
 
 1476       return getNumberOfMatches(header) == getNumberOfMatches(*
this);
 
 1488 #define RETURN_IF_DIFFERENT(A, B)       \ 
 1489       if (less(A,B)) { return true;  }  \ 
 1490       if (less(B,A)) { return false; }  
 1522 #undef RETURN_IF_DIFFERENT 
 1534       if (
match(header)) {
 
 1564                                   const JHead& second)
 
 1566       return first.
match(second);
 
 1578                                  const JHead& second)
 
 1580       return first.
less(second);
 
 1623       static JHead header;
 
 1657       getEquationParameters() = equation;
 
 1667     std::istream& 
read(std::istream& in);
 
 1676     std::ostream& 
write(std::ostream& out) 
const;
 
 1685     std::ostream& 
print(std::ostream& out) 
const;
 
 1699     static inline bool less(
const T& first,
 
 1702       return first.less(second);
 
 1714     static inline bool match(
const T& first,
 
 1717       return first.match(second);
 
 1733       if (first.size() == second.size()) {
 
 1735         for (
size_t i = 0; i != first.size(); ++i) {
 
 1736           if (
less(first[i], second[i])) {
 
 1745         return first.size() < second.size();
 
 1762       for (
size_t i = 0; i != first.size() && i != second.size(); ++i) {
 
 1763         if (!
match(first[i], second[i])) {
 
 1768       return first.size() == second.size();
 
 1782                              const JHead& second,
 
 1787               match(first.*pd, second.*pd));
 
 1834   return header.
read(in);
 
 1847   return header.
write(out);
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
 
#define RETURN_IF_DIFFERENT(A, B)
 
#define IF_MATCH(A, B, C, D)
 
Auxiliary class to define a range between two values.
 
JHead & add(const JHead &header)
Addition of headers.
 
JAANET::spectrum spectrum
 
std::vector< JAANET::simul > simul
 
JAANET::seabottom seabottom
 
std::istream & read(std::istream &in)
Read header from input.
 
JHead(const Head &header)
Copy constructor.
 
virtual ~JHead()
Virtual destructor.
 
JAANET::start_run start_run
 
JAANET::coord_origin coord_origin
 
friend bool operator<(const JHead &first, const JHead &second)
Less than operator.
 
static bool is_valid(const T &object)
Check validity of given data member in JHead.
 
const JHead & getHeader() const
Get header.
 
JAANET::livetime livetime
 
std::ostream & write(std::ostream &out) const
Write header to output.
 
JHead()
Default constructor.
 
static bool match(const JHead &first, const JHead &second, T JHead::*pd)
Test match of given data member of headers.
 
void push(T JHead::*pd)
Push given data member to Head.
 
void createUUID()
Create UUID if not already set.
 
static bool less(const T &first, const T &second)
Comparison.
 
bool less(const JHead &header) const
Comparison of headers.
 
const_iterator pull(T JHead::*pd) const
Pull given data member from Head.
 
static bool less(const std::vector< T > &first, const std::vector< T > &second)
Comparison of containers.
 
static bool match(const T &first, const T &second)
Test match.
 
static void setEquationParameters(const JLANG::JEquationParameters &equation)
Set equation parameters.
 
JAANET::genhencut genhencut
 
static JLANG::JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
 
std::vector< JAANET::flux > flux
 
std::vector< JAANET::detector > detector
 
JHead & getHeader()
Get header.
 
JAANET::cut_seamuon cut_seamuon
 
JAANET::fixedcan fixedcan
 
JAANET::XSecFile XSecFile
 
JHead getMatch(const JHead &header) const
Get matching fields.
 
void setHeader(const JHead &header)
Set header.
 
friend bool operator==(const JHead &first, const JHead &second)
Equal operator.
 
iterator pull(T JHead::*pd)
Pull given data member from Head.
 
JAANET::calibration calibration
 
static const size_t getMaximumNumberOfMatches()
Get maximum number of matching header fields.
 
JAANET::end_event end_event
 
JAANET::time_interval time_interval
 
bool is_valid(T JHead::*pd) const
Check validity of given data member in JHead.
 
size_t getNumberOfMatches(const JHead &header) const
Get number of matching fields.
 
static bool match(const std::vector< T > &first, const std::vector< T > &second)
Test is containers match.
 
std::vector< JAANET::physics > physics
 
void erase(T JHead::*pd)
Reset and remove given data member from Head.
 
JAANET::cut_primary cut_primary
 
bool match(const JHead &header) const
Test match of headers.
 
JAANET::muon_desc_file muon_desc_file
 
Simple data structure to support I/O of equations (see class JLANG::JEquation).
 
bool write(const Vec &v, std::ostream &os)
Write a Vec(tor) to a stream.
 
Extensions to Evt data format.
 
bool operator==(const Head &first, const Head &second)
Equal operator.
 
static const char AANET_TAG_SEPARATOR
Separator for tag extension of multiple tags in Head ("_<counter>").
 
void copy(const Head &from, JHead &to)
Copy header from from to to.
 
std::string getTag(const std::string &tag, const int counter)
Get tag with aanet extension "_<counter>" for identical tags.
 
bool operator<(const Head &first, const Head &second)
Less than operator.
 
std::ostream & print(std::ostream &out, const JTestSummary &summary, const char delimiter=' ', const bool useColors=true)
Print test summary.
 
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter=' ')
Read test summary.
 
bool is_integer(const std::string &buffer)
Check if string is an integer.
 
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
 
bool equals(const JFirst_t &first, const JSecond_t &second, const double precision=std::numeric_limits< double >::min())
Check equality.
 
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.
 
bool is_valid(const json &js)
Check validity of JSon data.
 
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
 
double livetime_s
Live time [s].
 
DAQ & add(const DAQ &object)
Addition.
 
DAQ()
Default constructor.
 
bool less(const DAQ &object) const
Comparison.
 
bool match(const DAQ &object) const
Test match.
 
Type definition of range.
 
JRange_t(double x, double y)
Constructor.
 
JRange_t()
Default constructor.
 
K40 & add(const K40 &object)
Addition.
 
bool less(const K40 &object) const
Comparison.
 
double livetime_s
Live time [s].
 
K40()
Default constructor.
 
bool match(const K40 &object) const
Test match.
 
General purpose string class.
 
bool match(const String &object) const
Test match.
 
std::string buffer
General purpose name.
 
friend std::istream & operator>>(std::istream &in, String &object)
Read string from input stream.
 
bool less(const String &object) const
Comparison.
 
String()
Default constructor.
 
friend std::ostream & operator<<(std::ostream &out, const String &object)
Write string to output stream.
 
Neutrino cross section file.
 
ClassDefNV(calibration, 1)
 
static const std::string dynamical()
 
static const std::string statical()
 
The cylinder used for photon tracking.
 
bool match(const can &object) const
Test match.
 
can()
Default constructor.
 
coord_origin()
Default constructor.
 
coord_origin(const double x, const double y, const double z)
Constructor.
 
bool match(const coord_origin &object) const
Test match.
 
ClassDefNV(coord_origin, 1)
 
Phase space of incoming particle.
 
Phase space of incident neutrino.
 
Phase space of primary particle.
 
ClassDefNV(cut_primary, 1)
 
Phase space of atmospheric muon generation.
 
ClassDefNV(cut_seamuon, 1)
 
General purpose class of phase space generation.
 
cut(const double Emin, const double Emax, const double cosTmin, const double cosTmax)
Constructor.
 
JRange_t cosT
Cosine zenith angle range
 
bool less(const cut &object) const
Comparison.
 
cut()
Default constructor.
 
cut(const JRange_t &_E, const JRange_t &_cosT)
Constructor.
 
bool match(const cut &object) const
Test match.
 
JRange_t E
Energy range [GeV].
 
depth()
Default constructor.
 
bool match(const depth &object) const
Test match.
 
detector()
Default constructor.
 
friend std::istream & operator>>(std::istream &in, detector &object)
Read detector from input stream.
 
friend std::ostream & operator<<(std::ostream &out, const detector &object)
Write detector to output stream.
 
bool match(const detector &object) const
Test match.
 
end_event()
Default constructor.
 
The fixed cylinder used for photon tracking.
 
bool match(const fixedcan &object) const
Test match.
 
double ycenter
y-center [m]
 
double xcenter
x-center [m]
 
fixedcan()
Default constructor.
 
bool less(const flux &object) const
Comparison.
 
flux()
Default constructor.
 
std::string file_2
File name.
 
std::string file_1
File name.
 
bool match(const flux &object) const
Test match.
 
Description of Monte Carlo event generation applications.
 
bool less(const generator &object) const
Comparison.
 
std::string time
processing time
 
std::string date
processing date
 
bool match(const generator &object) const
Test match.
 
std::string program
program name
 
generator()
Default constructor.
 
std::string version
program version
 
Phase space for incident neutrino.
 
genhencut()
Default constructor.
 
double Emin
Minimal energy [GeV].
 
double numberOfEvents
Number of events.
 
genvol()
Default constructor.
 
genvol & mul(const double factor, const double z=0.0)
Scale.
 
bool less(const genvol &object) const
Comparison.
 
genvol & add(const genvol &object)
Addition.
 
double volume
Volume [m^3].
 
bool match(const genvol &object) const
Test match.
 
Normalisation of MUPAGE events.
 
bool less(const livetime &object) const
Comparison.
 
livetime()
Default constructor.
 
double numberOfSeconds
Live time [s].
 
double errorOfSeconds
Uncertainty on live time [s].
 
livetime & add(const livetime &object)
Addition.
 
livetime & mul(const double factor)
Scale.
 
bool match(const livetime &object) const
Test match.
 
ClassDefNV(muon_desc_file, 1)
 
Normlisation of CORSIKA events.
 
double numberOfPrimaries
Number of primaries.
 
double primaryFlux
Primary flux.
 
norma()
Default constructor.
 
norma & add(const norma &object)
Addition.
 
bool match(const norma &object) const
Test match.
 
bool match(const primary &object) const
Test match.
 
bool less(const primary &object) const
Comparison.
 
primary()
Default constructor.
 
bool match(const seabottom &object) const
Test match.
 
seabottom()
Default constructor.
 
Generator for simulation.
 
Neutrino energy spectrum.
 
spectrum()
Default constructor.
 
bool less(const spectrum &object) const
Comparison.
 
bool match(const spectrum &object) const
Test match.
 
double alpha
Energy spectrum: .
 
start_run()
Default constructor.
 
Time duration of event generation.
 
tgen()
Default constructor.
 
bool match(const tgen &object) const
Test match.
 
double numberOfSeconds
Time in seconds.
 
UTC time interval for event generation.
 
time_interval()
Default constructor.
 
bool match(const time_interval &object) const
Test match.
 
ClassDefNV(time_interval, 1)
 
double t1
Start time in seconds.
 
double t2
Stop time in seconds.
 
static const JUUID & rndm()
Generate random UUID.
 
The Vec class is a straightforward 3-d vector, which also works in pyroot.