Jpp  17.1.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JHead.hh
Go to the documentation of this file.
1 #ifndef __JAANET__JHEAD__
2 #define __JAANET__JHEAD__
3 
4 #include <string>
5 #include <vector>
6 #include <cmath>
7 #include <ctype.h>
8 #include <sstream>
9 
10 #include "TObject.h"
11 
14 
15 #include "JLang/JUUID.hh"
16 #include "JLang/JException.hh"
18 #include "JLang/JLangToolkit.hh"
19 
20 #include "JTools/JRange.hh"
21 
22 #include "JROOT/JRootClass.hh"
23 
24 
25 /**
26  * \author mdejong
27  */
28 
29 namespace JAANET {}
30 namespace JPP { using namespace JAANET; }
31 
32 namespace JAANET {
33 
34  using JLANG::JUUID;
35  using JLANG::JException;
37 
38  /**
39  * Type definition of range.
40  */
41  struct JRange_t :
42  public JTOOLS::JRange<double>
43  {
44  /**
45  * Default constructor.
46  */
48  JTOOLS::JRange<double>()
49  {}
50 
51 
52  /**
53  * Constructor.
54  *
55  * \param x lower limit
56  * \param y upper limit
57  */
58  JRange_t(double x,
59  double y) :
60  JTOOLS::JRange<double>(x, y)
61  {}
62  };
63 
64 
65  static const char AANET_TAG_SEPARATOR = '_'; //!< Separator for tag extension of multiple tags in Head ("_<counter>").
66 
67  class JHead; // forward declaration for copy methods
68 
69 
70  /**
71  * Copy header from <tt>from</tt> to <tt>to</tt>.
72  *
73  * \param from header
74  * \param to header
75  */
76  extern void copy(const JHead& from, Head& to);
77 
78 
79  /**
80  * Copy header from <tt>from</tt> to <tt>to</tt>.
81  *
82  * \param from header
83  * \param to header
84  */
85  extern void copy(const Head& from, JHead& to);
86 
87 
88  /**
89  * Get tag without aanet extension "_<counter>" for identical tags.
90  *
91  * \param tag tag
92  * \return tag
93  */
94  inline std::string getTag(const std::string& tag)
95  {
96  using namespace std;
97 
98  const string::size_type pos = tag.find(AANET_TAG_SEPARATOR);
99 
100  if (pos != string::npos) {
101 
102  for (string::size_type i = pos + 1; i != tag.size(); ++i) {
103  if (!isdigit(tag[i])) {
104  return tag;
105  }
106  }
107 
108  return tag.substr(0, pos);
109  }
110 
111  return tag;
112  }
113 
114 
115  /**
116  * Get tag with aanet extension "_<counter>" for identical tags.
117  *
118  * \param tag tag
119  * \param counter counter
120  * \return tag
121  */
122  inline std::string getTag(const std::string& tag, const int counter)
123  {
124  std::ostringstream os;
125 
126  os << tag << AANET_TAG_SEPARATOR << counter;
127 
128  return os.str();
129  }
130 
131 
132  /**
133  * Start of run record.
134  */
135  struct start_run {
136  /**
137  * Default constructor.
138  */
140  run_id(0)
141  {}
142 
143  int run_id; ///< MC run number
144 
146  };
147 
148 
149  /**
150  * General purpose string class.
151  */
152  struct String {
153  /**
154  * Default constructor.
155  */
156  String() :
157  buffer()
158  {}
159 
160  /**
161  * Test match.
162  *
163  * \param object string
164  * \return true if matches; else false
165  */
166  inline bool match(const String& object) const
167  {
168  return !(*this).less(object) && !(object).less(*this);
169  }
170 
171  /**
172  * Comparison.
173  *
174  * \param object string
175  * \return true if this string less than given string; else false
176  */
177  inline bool less(const String& object) const
178  {
179  using namespace std;
180 
181  istringstream i0(this ->buffer);
182  istringstream i1(object.buffer);
183 
184  vector<string> v0;
185  vector<string> v1;
186 
187  copy(istream_iterator<string>(i0), istream_iterator<string>(), back_inserter(v0));
188  copy(istream_iterator<string>(i1), istream_iterator<string>(), back_inserter(v1));
189 
190  return v0 < v1;
191  }
192 
193  /**
194  * Read string from input stream.
195  *
196  * \param in input stream
197  * \param object string
198  * \return input stream
199  */
200  friend inline std::istream& operator>>(std::istream& in, String& object)
201  {
202  return std::getline(in, object.buffer);
203  }
204 
205  /**
206  * Write string to output stream.
207  *
208  * \param out output stream
209  * \param object string
210  * \return output stream
211  */
212  friend inline std::ostream& operator<<(std::ostream& out, const String& object)
213  {
214  return out << object.buffer;
215  }
216 
217  std::string buffer; ///< General purpose name
218 
219  ClassDefNV(String,1);
220  };
221 
222 
223  /**
224  * Detector file.
225  */
226  struct detector
227  {
228  /**
229  * Default constructor.
230  */
232  {}
233 
234  /**
235  * Test match.
236  *
237  * \param object detector
238  * \return true if matches; else false
239  */
240  inline bool match(const detector& object) const
241  {
242  return this->program == object.program && this->filename == object.filename;
243  }
244 
245  /**
246  * Read detector from input stream.
247  *
248  * \param in input stream
249  * \param object detector
250  * \return input stream
251  */
252  friend inline std::istream& operator>>(std::istream& in, detector& object)
253  {
254  using namespace JPP;
255 
256  in >> object.program >> object.filename;
257 
258  if (!in || is_integer(object.filename)) { // legacy
259  object.filename = object.program;
260  object.program = "?";
261  }
262 
263  return in;
264  }
265 
266  /**
267  * Write detector to output stream.
268  *
269  * \param out output stream
270  * \param object detector
271  * \return output stream
272  */
273  friend inline std::ostream& operator<<(std::ostream& out, const detector& object)
274  {
275  return out << object.program << ' ' << object.filename;
276  }
277 
278  std::string program;
279  std::string filename;
280 
281  ClassDefNV(detector,1);
282  };
283 
284 
285  /**
286  * Muon descriptor file.
287  */
288  struct muon_desc_file :
289  public String
290  {
292  };
293 
294 
295  /**
296  * Target.
297  */
298  struct target :
299  public String
300  {
301  ClassDefNV(target,1);
302  };
303 
304 
305  /**
306  * Neutrino cross section file.
307  */
308  struct XSecFile :
309  public String
310  {
311  ClassDefNV(XSecFile,1);
312  };
313 
314 
315  /**
316  * Drawing.
317  */
318  struct drawing :
319  public String
320  {
321  ClassDefNV(drawing,1);
322  };
323 
324 
325  /**
326  * General purpose class of phase space generation.
327  */
328  struct cut {
329  /**
330  * Default constructor.
331  */
332  cut() :
333  E (0.0, 0.0),
334  cosT(0.0, 0.0)
335  {}
336 
337  /**
338  * Constructor.
339  *
340  * \param _E energy range
341  * \param _cosT cosine zenith angle range
342  */
343  cut(const JRange_t& _E,
344  const JRange_t& _cosT) :
345  E (_E),
346  cosT(_cosT)
347  {}
348 
349  /**
350  * Constructor.
351  *
352  * \param Emin energy range lower bound
353  * \param Emax energy range upper bound
354  * \param cosTmin cosine zenith angle lower bound
355  * \param cosTmax cosine zenith angle upper bound
356  */
357  cut(const double Emin,
358  const double Emax,
359  const double cosTmin,
360  const double cosTmax) :
361  E (Emin, Emax),
362  cosT(cosTmin, cosTmax)
363  {}
364 
365  /**
366  * Comparison.
367  *
368  * \param object cut
369  * \return true if this cut less than given cut; else false
370  */
371  inline bool less(const cut& object) const
372  {
373  if (E.getLowerLimit() == object.E.getLowerLimit()) {
374 
375  if (E.getUpperLimit() == object.E.getUpperLimit()) {
376 
377  if (cosT.getLowerLimit() == object.cosT.getLowerLimit()) {
378  return cosT.getUpperLimit() < object.cosT.getUpperLimit();
379  } else {
380  return cosT.getLowerLimit() < object.cosT.getLowerLimit();
381  }
382 
383  } else {
384 
385  return E.getUpperLimit() < object.E.getUpperLimit();
386  }
387 
388  } else {
389 
390  return E.getLowerLimit() < object.E.getLowerLimit();
391  }
392  }
393 
394  /**
395  * Test match.
396  *
397  * \param object cut
398  * \return true if matches; else false
399  */
400  inline bool match(const cut& object) const
401  {
402  return (E .equals(object.E) &&
403  cosT.equals(object.cosT));
404  }
405 
406  JRange_t E; ///< Energy range [GeV]
407  JRange_t cosT; ///< Cosine zenith angle range
408 
409  ClassDefNV(cut,1);
410  };
411 
412 
413  /**
414  * Phase space of primary particle.
415  */
416  struct cut_primary :
417  public cut
418  {
420  };
421 
422 
423  /**
424  * Phase space of atmospheric muon generation.
425  */
426  struct cut_seamuon :
427  public cut
428  {
430  };
431 
432 
433  /**
434  * Phase space of incoming particle
435  */
436  struct cut_in :
437  public cut
438  {
439  ClassDefNV(cut_in,1);
440  };
441 
442 
443  /**
444  * Phase space of incident neutrino.
445  */
446  struct cut_nu :
447  public cut
448  {
449  ClassDefNV(cut_nu,1);
450  };
451 
452 
453  /**
454  * Description of Monte Carlo event generation applications.
455  */
456  struct generator {
457  /**
458  * Default constructor.
459  */
461  program(),
462  version(),
463  date(),
464  time()
465  {}
466 
467  /**
468  * Comparison.
469  *
470  * \param object generator
471  * \return true if this primary particle is less than given primary particle; else false
472  */
473  inline bool less(const generator& object) const
474  {
475  return program < object.program;
476  }
477 
478  /**
479  * Test match.
480  *
481  * Note that only the name of program is matched.
482  *
483  * \param object generator
484  * \return true if matches; else false
485  */
486  inline bool match(const generator& object) const
487  {
488  return program == object.program;
489  }
490 
491  std::string program; ///< program name
492  std::string version; ///< program version
493  std::string date; ///< processing date
494  std::string time; ///< processing time
495 
497  };
498 
499 
500  /**
501  * Physics information.
502  */
503  struct physics :
504  public String
505  {
506  ClassDefNV(physics,1);
507  };
508 
509 
510  /**
511  * Generator for simulation.
512  */
513  struct simul :
514  public generator
515  {
516  ClassDefNV(simul,1);
517  };
518 
519 
520  /**
521  * Neutrino energy spectrum.
522  */
523  struct spectrum {
524  /**
525  * Default constructor.
526  */
527  spectrum() :
528  alpha(0)
529  {}
530 
531  /**
532  * Comparison.
533  *
534  * \param object spectrum
535  * \return true if this spectrum less than given spectrum; else false
536  */
537  inline bool less(const spectrum& object) const
538  {
539  return alpha < object.alpha;
540  }
541 
542  /**
543  * Test match.
544  *
545  * \param object spectrum
546  * \return true if matches; else false
547  */
548  inline bool match(const spectrum& object) const
549  {
550  return (alpha == object.alpha);
551  }
552 
553  double alpha; ///< Energy spectrum: \f$ \Phi \propto E^{-\alpha} \f$
554 
555  ClassDefNV(spectrum,1);
556  };
557 
558 
559  /**
560  * The cylinder used for photon tracking.
561  */
562  struct can {
563  /**
564  * Default constructor.
565  */
566  can() :
567  zmin(0),
568  zmax(0),
569  r(0)
570  {}
571 
572  /**
573  * Test match.
574  *
575  * \param object can
576  * \return true if matches; else false
577  */
578  inline bool match(const can& object) const
579  {
580  return (zmin == object.zmin &&
581  zmax == object.zmax &&
582  r == object.r);
583  }
584 
585  double zmin; ///< Bottom [m]
586  double zmax; ///< Top [m]
587  double r; ///< Radius [m]
588 
589  ClassDefNV(can,1);
590  };
591 
592 
593  /**
594  * The fixed cylinder used for photon tracking.
595  */
596  struct fixedcan {
597  /**
598  * Default constructor.
599  */
601  xcenter(0),
602  ycenter(0),
603  zmin(0),
604  zmax(0),
605  radius(0)
606  {}
607 
608  /**
609  * Test match.
610  *
611  * \param object can
612  * \return true if matches; else false
613  */
614  inline bool match(const fixedcan& object) const
615  {
616  return (xcenter == object.xcenter &&
617  ycenter == object.ycenter &&
618  zmin == object.zmin &&
619  zmax == object.zmax &&
620  radius == object.radius);
621  }
622 
623  double xcenter; ///< x-center [m]
624  double ycenter; ///< y-center [m]
625  double zmin; ///< Bottom [m]
626  double zmax; ///< Top [m]
627  double radius; ///< Radius [m]
628 
629  ClassDefNV(fixedcan,1);
630  };
631 
632 
633  /**
634  * Neutrino vertex volume.
635  */
636  struct genvol {
637  /**
638  * Default constructor.
639  */
640  genvol() :
641  zmin(0),
642  zmax(0),
643  r(0),
644  volume(0),
645  numberOfEvents(0)
646  {}
647 
648  /**
649  * Comparison.
650  *
651  * \param object genvol
652  * \return true if this genvol less than given genvol; else false
653  */
654  inline bool less(const genvol& object) const
655  {
656  return volume < object.volume;
657  }
658 
659  /**
660  * Test match.
661  *
662  * \param object generation volume
663  * \return true if matches; else false
664  */
665  inline bool match(const genvol& object) const
666  {
667  return (zmin == object.zmin &&
668  zmax == object.zmax &&
669  r == object.r &&
670  volume == object.volume);
671  }
672 
673  /**
674  * Addition.
675  *
676  * \param object generation volume
677  * \return this generation volume
678  */
679  inline genvol& add(const genvol& object)
680  {
681  numberOfEvents += object.numberOfEvents;
682 
683  return *this;
684  }
685 
686  /**
687  * Scale.
688  *
689  * \param factor 1D scale factor
690  * \param z z position
691  * \return this genvol
692  */
693  inline genvol& mul(const double factor,
694  const double z = 0.0)
695  {
696  zmin = (zmin - z) * factor + z;
697  zmax = (zmax - z) * factor + z;
698  r *= factor;
699  volume *= factor * factor * factor;
700 
701  return *this;
702  }
703 
704  double zmin; ///< Bottom [m]
705  double zmax; ///< Top [m]
706  double r; ///< Radius [m]
707  double volume; ///< Volume [m^3]
708  double numberOfEvents; ///< Number of events
709 
710  ClassDefNV(genvol,1);
711  };
712 
713 
714  /**
715  * Coordinate origin.
716  */
717  struct coord_origin :
718  public Vec
719  {
720  /**
721  * Default constructor.
722  */
724  Vec()
725  {}
726 
727  /**
728  * Constructor.
729  *
730  * \param x x position
731  * \param y y position
732  * \param z z position
733  */
734  coord_origin(const double x,
735  const double y,
736  const double z) :
737  Vec(x,y,z)
738  {}
739 
740  /**
741  * Test match.
742  *
743  * \param object coordinate origin
744  * \return true if matches; else false
745  */
746  inline bool match(const coord_origin& object) const
747  {
748  return (x == object.x &&
749  y == object.y &&
750  z == object.z);
751  }
752 
754  };
755 
756 
757  /**
758  * Phase space for incident neutrino.
759  */
760  struct genhencut {
761  /**
762  * Default constructor.
763  */
765  gDir(0),
766  Emin(0)
767  {}
768 
769  double gDir; ///< Angle
770  double Emin; ///< Minimal energy [GeV]
771 
773  };
774 
775 
776  /**
777  * Normlisation of CORSIKA events.
778  */
779  struct norma {
780  /**
781  * Default constructor.
782  */
783  norma() :
784  primaryFlux(0),
785  numberOfPrimaries(0)
786  {}
787 
788  /**
789  * Test match.
790  *
791  * \param object normalisation
792  * \return true if matches; else false
793  */
794  inline bool match(const norma& object) const
795  {
796  return (primaryFlux == object.primaryFlux);
797  }
798 
799  /**
800  * Addition.
801  *
802  * \param object normalisation
803  * \return this normalisation
804  */
805  inline norma& add(const norma& object)
806  {
807  numberOfPrimaries += object.numberOfPrimaries;
808 
809  return *this;
810  }
811 
812  double primaryFlux; ///< Primary flux
813  double numberOfPrimaries; ///< Number of primaries
814 
815  ClassDefNV(norma,1);
816  };
817 
818 
819  /**
820  * Normalisation of MUPAGE events.
821  */
822  struct livetime {
823  /**
824  * Default constructor.
825  */
827  numberOfSeconds(0),
828  errorOfSeconds(0)
829  {}
830 
831  /**
832  * Comparison.
833  *
834  * \param object livetime
835  * \return true if this livetime is less than given livetime; else false
836  */
837  inline bool less(const livetime& object) const
838  {
839  return numberOfSeconds < object.numberOfSeconds;
840  }
841 
842  /**
843  * Test match.
844  *
845  * \param object live time
846  * \return true if matches; else false
847  */
848  inline bool match(const livetime& object) const
849  {
850  return ((numberOfSeconds == 0.0 && object.numberOfSeconds == 0.0) ||
851  (numberOfSeconds > 0.0 && object.numberOfSeconds > 0.0));
852  }
853 
854  /**
855  * Addition.
856  *
857  * \param object live time
858  * \return this live time
859  */
860  inline livetime& add(const livetime& object)
861  {
862  numberOfSeconds += object.numberOfSeconds;
863  errorOfSeconds = sqrt(errorOfSeconds * errorOfSeconds +
864  object.errorOfSeconds * object.errorOfSeconds);
865 
866  return *this;
867  }
868 
869  /**
870  * Scale.
871  *
872  * \param factor 1D scale factor
873  * \return this livetime
874  */
875  inline livetime& mul(const double factor)
876  {
877  numberOfSeconds /= (factor * factor);
878  errorOfSeconds /= (factor * factor);
879 
880  return *this;
881  }
882 
883  double numberOfSeconds; ///< Live time [s]
884  double errorOfSeconds; ///< Uncertainty on live time [s]
885 
886  ClassDefNV(livetime,1);
887  };
888 
889 
890  /**
891  * Neutrino flux.
892  */
893  struct flux {
894  public:
895  /**
896  * Default constructor.
897  */
898  flux() :
899  type(0),
900  key(),
901  file_1(),
902  file_2()
903  {}
904 
905  /**
906  * Comparison.
907  *
908  * \param object flux
909  * \return true if this flux is less than given flux; else false
910  */
911  inline bool less(const flux& object) const
912  {
913  return type < object.type;
914  }
915 
916  /**
917  * Test match.
918  *
919  * \param object flux
920  * \return true if matches; else false
921  */
922  inline bool match(const flux& object) const
923  {
924  return type == object.type;
925  }
926 
927  int type; ///< Type
928  std::string key; ///< Key
929  std::string file_1; ///< File name
930  std::string file_2; ///< File name
931 
932  ClassDefNV(flux,1);
933  };
934 
935 
936  /**
937  * The bottom of the sea.
938  */
939  struct seabottom {
940  /**
941  * Default constructor.
942  */
944  z(0)
945  {}
946 
947  /**
948  * Test match.
949  *
950  * \param object sea bottom
951  * \return true if matches; else false
952  */
953  inline bool match(const seabottom& object) const
954  {
955  return (z == object.z);
956  }
957 
958  double z; ///< Sea bottom [m]
959 
961  };
962 
963 
964  /**
965  * Depth.
966  */
967  struct depth {
968  /**
969  * Default constructor.
970  */
971  depth() :
972  z(0)
973  {}
974 
975  /**
976  * Test match.
977  *
978  * \param object sea bottom
979  * \return true if matches; else false
980  */
981  inline bool match(const depth& object) const
982  {
983  return (z == object.z);
984  }
985 
986  double z; ///< Sea bottom [m]
987 
988  ClassDefNV(depth,1);
989  };
990 
991 
992  /**
993  * Livetime of DAQ data.
994  */
995  struct DAQ {
996  public:
997  /**
998  * Default constructor.
999  */
1000  DAQ() :
1001  livetime_s(0.0)
1002  {}
1003 
1004  /**
1005  * Comparison.
1006  *
1007  * \param object DAQ
1008  * \return true if this DAQ is less than given DAQ; else false
1009  */
1010  inline bool less(const DAQ& object) const
1011  {
1012  return livetime_s < object.livetime_s;
1013  }
1014 
1015  /**
1016  * Test match.
1017  *
1018  * \param object DAQ
1019  * \return true if matches; else false
1020  */
1021  inline bool match(const DAQ& object) const
1022  {
1023  return ((livetime_s == 0.0 && object.livetime_s == 0.0) ||
1024  (livetime_s > 0.0 && object.livetime_s > 0.0));
1025  }
1026 
1027  /**
1028  * Addition.
1029  *
1030  * \param object DAQ
1031  * \return this DAQ
1032  */
1033  inline DAQ& add(const DAQ& object)
1034  {
1035  livetime_s += object.livetime_s;
1036 
1037  return *this;
1038  }
1039 
1040  double livetime_s; ///< Live time [s]
1041 
1042  ClassDefNV(DAQ,1);
1043  };
1044 
1045 
1046  /**
1047  * Time duration of event generation.
1048  */
1049  struct tgen {
1050  /**
1051  * Default constructor.
1052  */
1053  tgen() :
1054  numberOfSeconds(0)
1055  {}
1056 
1057  /**
1058  * Test match.
1059  *
1060  * \param object time duration
1061  * \return true if matches; else false
1062  */
1063  inline bool match(const tgen& object) const
1064  {
1065  return this->numberOfSeconds == object.numberOfSeconds;
1066  }
1067 
1068  double numberOfSeconds; ///< Time in seconds
1069 
1070  ClassDefNV(tgen,1);
1071  };
1072 
1073 
1074  /**
1075  * UTC time interval for event generation.
1076  */
1077  struct time_interval {
1078  /**
1079  * Default constructor.
1080  */
1082  t1(0),
1083  t2(0)
1084  {}
1085 
1086  /**
1087  * Test match.
1088  *
1089  * \param object time interval
1090  * \return true if matches; else false
1091  */
1092  inline bool match(const time_interval& object) const
1093  {
1094  return (this->t1 == object.t1 && this->t2 == object.t2);
1095  }
1096 
1097  double t1; ///< Start time in seconds
1098  double t2; ///< Stop time in seconds
1099 
1101  };
1102 
1103 
1104  /**
1105  * Primary particle.
1106  */
1107  struct primary {
1108  /**
1109  * Default constructor.
1110  */
1111  primary() :
1112  type(0)
1113  {}
1114 
1115  /**
1116  * Comparison.
1117  *
1118  * \param object primary particle
1119  * \return true if this primary particle is less than given primary particle; else false
1120  */
1121  inline bool less(const primary& object) const
1122  {
1123  return type < object.type;
1124  }
1125 
1126  /**
1127  * Test match.
1128  *
1129  * \param object primary particle
1130  * \return true if matches; else false
1131  */
1132  inline bool match(const primary& object) const
1133  {
1134  return (type == object.type);
1135  }
1136 
1137  int type; ///< Particle type
1138 
1139  ClassDefNV(primary,1);
1140  };
1141 
1142 
1143  /**
1144  * End of event record.
1145  */
1146  struct end_event {
1147  /**
1148  * Default constructor.
1149  */
1151  {}
1152 
1153  ClassDefNV(end_event,1);
1154  };
1155 
1156 
1157  /**
1158  * Monte Carlo run header.
1159  *
1160  * This class extends the Head class so that the data from specific tags
1161  * can be promoted to concrete data types.
1162  *
1163  * Note that for the copy of new JHead data (e.g.\ data not obtained via a previous JAANET::copy) to become effective,
1164  * the key words in the corresponding map of the Head class should be set. \n
1165  * To this end, member method JHead::push can be used.
1166  */
1167  struct JHead :
1168  public Head
1169  {
1170  /**
1171  * Default constructor.
1172  */
1174  {
1175  createUUID();
1176  }
1177 
1178 
1179  /**
1180  * Copy constructor.
1181  *
1182  * \param header header
1183  */
1184  JHead(const Head& header)
1185  {
1186  copy(header, *this);
1187  }
1188 
1189 
1190  /**
1191  * Virtual destructor.
1192  */
1193  virtual ~JHead()
1194  {}
1195 
1196 
1197  /**
1198  * Get header.
1199  *
1200  * \return header
1201  */
1202  const JHead& getHeader() const
1203  {
1204  return static_cast<const JHead&>(*this);
1205  }
1206 
1207 
1208  /**
1209  * Get header.
1210  *
1211  * \return header
1212  */
1214  {
1215  return static_cast<JHead&>(*this);
1216  }
1217 
1218 
1219  /**
1220  * Set header.
1221  *
1222  * \param header header
1223  */
1224  void setHeader(const JHead& header)
1225  {
1226  static_cast<JHead&>(*this) = header;
1227  }
1228 
1229 
1230  /**
1231  * Create UUID if not already set.
1232  */
1233  void createUUID()
1234  {
1235  if (!is_valid(&JHead::UUID)) {
1236  this->UUID = JUUID::rndm();
1237  this->push(&JHead::UUID);
1238  }
1239  }
1240 
1241 
1242  /**
1243  * Check validity of given data member in JHead.
1244  *
1245  * The validity is defined by the presence of the name of the data member in the underlying map.
1246  *
1247  * \param pd pointer to data member
1248  * \return true if valid; else false
1249  */
1250  template<class T>
1251  inline bool is_valid(T JHead::*pd) const
1252  {
1253  return (this->pull(pd) != this->end());
1254  }
1255 
1256 
1257  /**
1258  * Check validity of given data member in JHead.
1259  *
1260  * The validity is defined by difference between actual and default value.
1261  *
1262  * \param object object
1263  * \return true if valid; else false
1264  */
1265  template<class T>
1266  static bool is_valid(const T& object)
1267  {
1268  static const T value;
1269 
1270  return (object.less(value) || value.less(object));
1271  }
1272 
1273 
1274  /**
1275  * Pull given data member from Head.
1276  *
1277  * \param pd pointer to data member
1278  * \return iterator of Head
1279  */
1280  template<class T>
1281  inline const_iterator pull(T JHead::*pd) const
1282  {
1283  return this->find(JROOT::getDataMember(pd)->GetName());
1284  }
1285 
1286 
1287  /**
1288  * Pull given data member from Head.
1289  *
1290  * \param pd pointer to data member
1291  * \return iterator of Head
1292  */
1293  template<class T>
1294  inline iterator pull(T JHead::*pd)
1295  {
1296  return this->find(JROOT::getDataMember(pd)->GetName());
1297  }
1298 
1299 
1300  /**
1301  * Push given data member to Head.
1302  *
1303  * \param pd pointer to data member
1304  */
1305  template<class T>
1306  inline void push(T JHead::*pd)
1307  {
1308  (*this)[JROOT::getDataMember(pd)->GetName()] = "";
1309  }
1310 
1311 
1312  /**
1313  * Remove given data member from Head.
1314  *
1315  * \param pd pointer to data member
1316  */
1317  template<class T>
1318  inline void erase(T JHead::*pd)
1319  {
1320  iterator p = this->pull(pd);
1321 
1322  if (p != this->end()) {
1323 
1324  this->*pd = T();
1325 
1326  static_cast<Head*>(this)->erase(p);
1327  }
1328  }
1329 
1330 
1331  /**
1332  * Get matching fields.
1333  *
1334  * \param header header
1335  * \return header with matching fields
1336  */
1337  inline JHead getMatch(const JHead& header) const
1338  {
1339  JHead buffer(*this);
1340 
1341  buffer.clear();
1342 
1343  buffer.createUUID();
1344 
1345  if (match(*this, header, &JHead::cut_primary)) { buffer.push(&JHead::cut_primary); }
1346  if (match(*this, header, &JHead::cut_seamuon)) { buffer.push(&JHead::cut_seamuon); }
1347  if (match(*this, header, &JHead::cut_in)) { buffer.push(&JHead::cut_in); }
1348  if (match(*this, header, &JHead::cut_nu)) { buffer.push(&JHead::cut_nu); }
1349  if (match(*this, header, &JHead::simul)) { buffer.push(&JHead::simul); }
1350  if (match(*this, header, &JHead::spectrum)) { buffer.push(&JHead::spectrum); }
1351  if (match(*this, header, &JHead::can)) { buffer.push(&JHead::can); }
1352  if (match(*this, header, &JHead::fixedcan)) { buffer.push(&JHead::fixedcan); }
1353  if (match(*this, header, &JHead::genvol)) { buffer.push(&JHead::genvol); }
1354  if (match(*this, header, &JHead::coord_origin)) { buffer.push(&JHead::coord_origin); }
1355  if (match(*this, header, &JHead::norma)) { buffer.push(&JHead::norma); }
1356  if (match(*this, header, &JHead::livetime)) { buffer.push(&JHead::livetime); }
1357  if (match(*this, header, &JHead::seabottom)) { buffer.push(&JHead::seabottom); }
1358  if (match(*this, header, &JHead::depth)) { buffer.push(&JHead::depth); }
1359  if (match(*this, header, &JHead::tgen)) { buffer.push(&JHead::tgen); }
1360  if (match(*this, header, &JHead::time_interval)) { buffer.push(&JHead::time_interval); }
1361  if (match(*this, header, &JHead::primary)) { buffer.push(&JHead::primary); }
1362  if (match(*this, header, &JHead::flux)) { buffer.push(&JHead::flux); }
1363  if (match(*this, header, &JHead::DAQ)) { buffer.push(&JHead::DAQ); }
1364 
1365  return buffer;
1366  }
1367 
1368 
1369  /**
1370  * Get number of matching fields.
1371  *
1372  * \param header header
1373  * \return number of matching header fields
1374  */
1375  inline size_t getNumberOfMatches(const JHead& header) const
1376  {
1377  const JHead head = getMatch(header);
1378 
1379  return head.size();
1380  }
1381 
1382 
1383  /**
1384  * Test match of headers.
1385  *
1386  * \param header second header
1387  * \return true if all header fields match; else false
1388  */
1389  inline bool match(const JHead& header) const
1390  {
1391  return getNumberOfMatches(header) == getMaximumNumberOfMatches();
1392  }
1393 
1394 
1395  /**
1396  * Comparison of headers.
1397  *
1398  * \param header header
1399  * \return true if this header less than given header; else false
1400  */
1401  inline bool less(const JHead& header) const
1402  {
1403 #define RETURN_IF_DIFFERENT(A, B) \
1404  if (less(A,B)) { return true; } \
1405  if (less(B,A)) { return false; }
1406 
1407  // compare physics
1408 
1409  RETURN_IF_DIFFERENT(this->physics, header.physics);
1410 
1411  // compare simulation
1412 
1413  RETURN_IF_DIFFERENT(this->simul, header.simul);
1414 
1415  // compare generation data
1416 
1417  RETURN_IF_DIFFERENT(this->primary, header.primary);
1418  RETURN_IF_DIFFERENT(this->flux, header.flux);
1419  RETURN_IF_DIFFERENT(this->spectrum, header.spectrum);
1422  RETURN_IF_DIFFERENT(this->cut_in, header.cut_in);
1423  RETURN_IF_DIFFERENT(this->cut_nu, header.cut_nu);
1424  RETURN_IF_DIFFERENT(this->genvol, header.genvol);
1425 
1426  // compare compatibility
1427 
1428  if (is_valid(this->livetime) == is_valid(header.livetime) &&
1429  is_valid(this->DAQ) == is_valid(header.DAQ)) {
1430  return false;
1431  }
1432 
1433  THROW(JException, "JHead::less() headers do not compare.");
1434 
1435 #undef RETURN_IF_DIFFERENT
1436  }
1437 
1438 
1439  /**
1440  * Addition of headers.
1441  *
1442  * \param header header
1443  * \return this header
1444  */
1445  inline JHead& add(const JHead& header)
1446  {
1447  if (match(header)) {
1448 
1449  this->createUUID();
1450  this->UUID = JUUID::rndm();
1451 
1452  genvol .add(header.genvol);
1453  norma .add(header.norma);
1454  livetime.add(header.livetime);
1455  DAQ .add(header.DAQ);
1456 
1457  } else {
1458 
1459  THROW(JException, "JHead::add() headers do not match.");
1460  }
1461 
1462  return *this;
1463  }
1464 
1465 
1466  /**
1467  * Equal operator.
1468  *
1469  * Note that this operator uses the JHead::match method.
1470  *
1471  * \param first first header
1472  * \param second second header
1473  * \return true if two headers are equal; else false
1474  */
1475  friend inline bool operator==(const JHead& first,
1476  const JHead& second)
1477  {
1478  return first.match(second);
1479  }
1480 
1481 
1482  /**
1483  * Less than operator.
1484  *
1485  * \param first first header
1486  * \param second second header
1487  * \return true if first header is less than second header; else false
1488  */
1489  friend inline bool operator<(const JHead& first,
1490  const JHead& second)
1491  {
1492  return first.less(second);
1493  }
1494 
1495  JAANET::start_run start_run; // first data member
1496  JUUID UUID; // header unique identifier
1523  JAANET::end_event end_event; // last data member
1524 
1525 
1526  /**
1527  * Get maximum number of matching header fields.
1528  *
1529  * \return maximum number of matching header fields
1530  */
1531  static inline const size_t getMaximumNumberOfMatches()
1532  {
1533  static const JHead header;
1534  static const size_t value = header.getNumberOfMatches(header);
1535 
1536  return value;
1537  }
1538 
1539 
1540  /**
1541  * Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
1542  * <pre>
1543  * <key>: <value> [<value>]*
1544  * <key>: <value> [<value>]*
1545  * </pre>
1546  *
1547  * \return equation parameters
1548  */
1550  {
1551  static JLANG::JEquationParameters parameters(":", "\n", "", "");
1552 
1553  return parameters;
1554  }
1555 
1556 
1557  /**
1558  * Set equation parameters.
1559  *
1560  * \param equation equation parameters
1561  */
1562  static inline void setEquationParameters(const JLANG::JEquationParameters& equation)
1563  {
1564  getEquationParameters() = equation;
1565  }
1566 
1567 
1568  /**
1569  * Read header from input.
1570  *
1571  * \param in input stream
1572  * \return input stream
1573  */
1574  std::istream& read(std::istream& in);
1575 
1576 
1577  /**
1578  * Write header to output.
1579  *
1580  * \param out output stream
1581  * \return output stream
1582  */
1583  std::ostream& write(std::ostream& out) const;
1584 
1585 
1586  /**
1587  * Print header to output.
1588  *
1589  * \param out output stream
1590  * \return output stream
1591  */
1592  std::ostream& print(std::ostream& out) const;
1593 
1594 
1595  ClassDef(JHead,4);
1596 
1597  private:
1598  /**
1599  * Comparison.
1600  *
1601  * \param first first object
1602  * \param second second object
1603  * \return true if first less than second; else false
1604  */
1605  template<class T>
1606  static inline bool less(const T& first,
1607  const T& second)
1608  {
1609  return first.less(second);
1610  }
1611 
1612 
1613  /**
1614  * Test match.
1615  *
1616  * \param first first object
1617  * \param second second object
1618  * \return true if matches; else false
1619  */
1620  template<class T>
1621  static inline bool match(const T& first,
1622  const T& second)
1623  {
1624  return first.match(second);
1625  }
1626 
1627 
1628  /**
1629  * Comparison of containers.
1630  * It is assumed that the containers are ordered in the same way.
1631  *
1632  * \param first first object
1633  * \param second second object
1634  * \return true if first is less than second; else false
1635  */
1636  template<class T>
1637  static inline bool less(const std::vector<T>& first,
1638  const std::vector<T>& second)
1639  {
1640  if (first.size() == second.size()) {
1641 
1642  for (size_t i = 0; i != first.size(); ++i) {
1643  if (less(first[i], second[i])) {
1644  return true;
1645  }
1646  }
1647 
1648  return false;
1649 
1650  } else {
1651 
1652  return first.size() < second.size();
1653  }
1654  }
1655 
1656 
1657  /**
1658  * Test is containers match.
1659  * It is assumed that the containers are ordered in the same way.
1660  *
1661  * \param first first object
1662  * \param second second object
1663  * \return true if matches; else false
1664  */
1665  template<class T>
1666  static inline bool match(const std::vector<T>& first,
1667  const std::vector<T>& second)
1668  {
1669  for (size_t i = 0; i != first.size() && i != second.size(); ++i) {
1670  if (!match(first[i], second[i])) {
1671  return false;
1672  }
1673  }
1674 
1675  return first.size() == second.size();
1676  }
1677 
1678 
1679  /**
1680  * Test match of given data member of headers.
1681  *
1682  * \param first first header
1683  * \param second second header
1684  * \param pd pointer to data member
1685  * \return true if matches; else false
1686  */
1687  template<class T>
1688  static inline bool match(const JHead& first,
1689  const JHead& second,
1690  T JHead::*pd)
1691  {
1692  return match(first.*pd, second.*pd);
1693  }
1694  };
1695 
1696 
1697  /**
1698  * Equal operator.
1699  *
1700  * Note that this operator uses the JHead::match method.
1701  *
1702  * \param first first header
1703  * \param second second header
1704  * \return true if two headers are equal; else false
1705  */
1706  inline bool operator==(const Head& first,
1707  const Head& second)
1708  {
1709  return JHead(first).match(JHead(second));
1710  }
1711 
1712 
1713  /**
1714  * Less than operator.
1715  *
1716  * Note that this operator uses the JHead::less method.
1717  *
1718  * \param first first header
1719  * \param second second header
1720  * \return true if first header is less than second header; else false
1721  */
1722  inline bool operator<(const Head& first,
1723  const Head& second)
1724  {
1725  return JHead(first).less(JHead(second));
1726  }
1727 }
1728 
1729 
1730 /**
1731  * Read header from input.
1732  *
1733  * \param in input stream
1734  * \param header header
1735  * \return input stream
1736  */
1737 inline std::istream& operator>>(std::istream& in, JAANET::JHead& header)
1738 {
1739  return header.read(in);
1740 }
1741 
1742 
1743 /**
1744  * Write header to output.
1745  *
1746  * \param out output stream
1747  * \param header header
1748  * \return output stream
1749  */
1750 inline std::ostream& operator<<(std::ostream& out, const JAANET::JHead& header)
1751 {
1752  return header.write(out);
1753 }
1754 #endif
norma & add(const norma &object)
Addition.
Definition: JHead.hh:805
bool match(const cut &object) const
Test match.
Definition: JHead.hh:400
bool match(const detector &object) const
Test match.
Definition: JHead.hh:240
double zmin
Bottom [m].
Definition: JHead.hh:585
JAANET::depth depth
Definition: JHead.hh:1517
JAANET::genhencut genhencut
Definition: JHead.hh:1513
static const size_t getMaximumNumberOfMatches()
Get maximum number of matching header fields.
Definition: JHead.hh:1531
General exception.
Definition: JException.hh:23
Phase space of incident neutrino.
Definition: JHead.hh:446
Drawing.
Definition: JHead.hh:318
static bool is_valid(const T &object)
Check validity of given data member in JHead.
Definition: JHead.hh:1266
JHead getMatch(const JHead &header) const
Get matching fields.
Definition: JHead.hh:1337
livetime & mul(const double factor)
Scale.
Definition: JHead.hh:875
JAANET::genvol genvol
Definition: JHead.hh:1511
Neutrino vertex volume.
Definition: JHead.hh:636
Exceptions.
bool less(const String &object) const
Comparison.
Definition: JHead.hh:177
double r
Radius [m].
Definition: JHead.hh:706
JAANET::norma norma
Definition: JHead.hh:1514
std::vector< JAANET::flux > flux
Definition: JHead.hh:1522
JRange()
Default constructor.
Definition: JRange.hh:54
Target.
Definition: JHead.hh:298
genvol & mul(const double factor, const double z=0.0)
Scale.
Definition: JHead.hh:693
double volume
Volume [m^3].
Definition: JHead.hh:707
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
then usage E
Definition: JMuonPostfit.sh:35
Livetime of DAQ data.
Definition: JHead.hh:995
double t1
Start time in seconds.
Definition: JHead.hh:1097
bool match(const tgen &object) const
Test match.
Definition: JHead.hh:1063
seabottom()
Default constructor.
Definition: JHead.hh:943
livetime & add(const livetime &object)
Addition.
Definition: JHead.hh:860
friend bool operator<(const JHead &first, const JHead &second)
Less than operator.
Definition: JHead.hh:1489
Depth.
Definition: JHead.hh:967
version
Definition: JEditTuneHV.sh:5
bool less(const DAQ &object) const
Comparison.
Definition: JHead.hh:1010
void setHeader(const JHead &header)
Set header.
Definition: JHead.hh:1224
friend std::istream & operator>>(std::istream &in, String &object)
Read string from input stream.
Definition: JHead.hh:200
#define RETURN_IF_DIFFERENT(A, B)
const JHead & getHeader() const
Get header.
Definition: JHead.hh:1202
Phase space of incoming particle.
Definition: JHead.hh:436
Generator for simulation.
Definition: JHead.hh:513
bool operator<(const Head &first, const Head &second)
Less than operator.
Definition: JHead.hh:1722
double alpha
Energy spectrum: .
Definition: JHead.hh:553
const TDataMember * getDataMember(const JRootClass &parent, const JRootClass &member)
Get ROOT data member for given parent and member class.
Definition: JRootClass.hh:637
Phase space for incident neutrino.
Definition: JHead.hh:760
JAANET::drawing drawing
Definition: JHead.hh:1498
double numberOfEvents
Number of events.
Definition: JHead.hh:708
bool less(const generator &object) const
Comparison.
Definition: JHead.hh:473
static bool less(const T &first, const T &second)
Comparison.
Definition: JHead.hh:1606
friend std::istream & operator>>(std::istream &in, detector &object)
Read detector from input stream.
Definition: JHead.hh:252
std::string program
program name
Definition: JHead.hh:491
depth()
Default constructor.
Definition: JHead.hh:971
Neutrino cross section file.
Definition: JHead.hh:308
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
double t2
Stop time in seconds.
Definition: JHead.hh:1098
livetime()
Default constructor.
Definition: JHead.hh:826
double zmax
Top [m].
Definition: JHead.hh:626
Normlisation of CORSIKA events.
Definition: JHead.hh:779
JAANET::cut_primary cut_primary
Definition: JHead.hh:1504
double errorOfSeconds
Uncertainty on live time [s].
Definition: JHead.hh:884
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
std::vector< JAANET::physics > physics
Definition: JHead.hh:1502
Simple data structure to support I/O of equations (see class JLANG::JEquation).
bool match(const generator &object) const
Test match.
Definition: JHead.hh:486
JRange_t E
Energy range [GeV].
Definition: JHead.hh:406
static void setEquationParameters(const JLANG::JEquationParameters &equation)
Set equation parameters.
Definition: JHead.hh:1562
bool match(const time_interval &object) const
Test match.
Definition: JHead.hh:1092
bool match(const JHead &header) const
Test match of headers.
Definition: JHead.hh:1389
data_type r[M+1]
Definition: JPolint.hh:758
std::vector< JAANET::simul > simul
Definition: JHead.hh:1503
double livetime_s
Live time [s].
Definition: JHead.hh:1040
JHead & add(const JHead &header)
Addition of headers.
Definition: JHead.hh:1445
genhencut()
Default constructor.
Definition: JHead.hh:764
JRange_t()
Default constructor.
Definition: JHead.hh:47
General purpose class of phase space generation.
Definition: JHead.hh:328
bool match(const spectrum &object) const
Test match.
Definition: JHead.hh:548
void createUUID()
Create UUID if not already set.
Definition: JHead.hh:1233
DAQ & add(const DAQ &object)
Addition.
Definition: JHead.hh:1033
bool match(const can &object) const
Test match.
Definition: JHead.hh:578
Coordinate origin.
Definition: JHead.hh:717
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Physics information.
Definition: JHead.hh:503
Description of Monte Carlo event generation applications.
Definition: JHead.hh:456
double ycenter
y-center [m]
Definition: JHead.hh:624
then JCookie sh JDataQuality D $DETECTOR_ID R $RUNS[*] o $QUALITY_TXT d $DEBUG!fi fi JDataQuality f $QUALITY_TXT Q livetime_s
Definition: JDataQuality.sh:49
genvol & add(const genvol &object)
Addition.
Definition: JHead.hh:679
ClassDefNV(start_run, 1)
Start of run record.
Definition: JHead.hh:135
spectrum()
Default constructor.
Definition: JHead.hh:527
JAANET::end_event end_event
Definition: JHead.hh:1523
bool less(const JHead &header) const
Comparison of headers.
Definition: JHead.hh:1401
double zmax
Top [m].
Definition: JHead.hh:705
JAANET::fixedcan fixedcan
Definition: JHead.hh:1510
static const JUUID & rndm()
Generate random UUID.
Definition: JUUID.hh:67
JAANET::can can
Definition: JHead.hh:1509
std::string buffer
General purpose name.
Definition: JHead.hh:217
double xcenter
x-center [m]
Definition: JHead.hh:623
JRange_t(double x, double y)
Constructor.
Definition: JHead.hh:58
bool operator==(Packet const &p, ID const &id)
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
void push(T JHead::*pd)
Push given data member to Head.
Definition: JHead.hh:1306
Type definition of range.
Definition: JHead.hh:41
int type
Particle type.
Definition: JHead.hh:1137
bool match(const fixedcan &object) const
Test match.
Definition: JHead.hh:614
Detector file.
Definition: JHead.hh:226
JNET::JTag getTag(JLANG::JType< KM3NETDAQ::JDAQTimeslice >)
Definition: JDAQTags.hh:82
JUUID UUID
Definition: JHead.hh:1496
JAANET::cut_seamuon cut_seamuon
Definition: JHead.hh:1505
generator()
Default constructor.
Definition: JHead.hh:460
double numberOfPrimaries
Number of primaries.
Definition: JHead.hh:813
JAANET::livetime livetime
Definition: JHead.hh:1515
static JLANG::JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
Definition: JHead.hh:1549
JHead()
Default constructor.
Definition: JHead.hh:1173
flux()
Default constructor.
Definition: JHead.hh:898
cut(const double Emin, const double Emax, const double cosTmin, const double cosTmax)
Constructor.
Definition: JHead.hh:357
std::istream & read(std::istream &in)
Read header from input.
Definition: JHead.cc:30
bool less(const primary &object) const
Comparison.
Definition: JHead.hh:1121
cut(const JRange_t &_E, const JRange_t &_cosT)
Constructor.
Definition: JHead.hh:343
void erase(T JHead::*pd)
Remove given data member from Head.
Definition: JHead.hh:1318
JAANET::seabottom seabottom
Definition: JHead.hh:1516
bool less(const flux &object) const
Comparison.
Definition: JHead.hh:911
cut()
Default constructor.
Definition: JHead.hh:332
Neutrino flux.
Definition: JHead.hh:893
do set_variable OUTPUT_DIRECTORY $WORKDIR T
friend std::ostream & operator<<(std::ostream &out, const String &object)
Write string to output stream.
Definition: JHead.hh:212
JAANET::start_run start_run
Definition: JHead.hh:1495
bool match(const depth &object) const
Test match.
Definition: JHead.hh:981
bool is_valid(const json &js)
Check validity of JSon data.
ClassDefNV(String, 1)
friend bool operator==(const JHead &first, const JHead &second)
Equal operator.
Definition: JHead.hh:1475
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:478
std::string version
program version
Definition: JHead.hh:492
Time duration of event generation.
Definition: JHead.hh:1049
JAANET::spectrum spectrum
Definition: JHead.hh:1508
std::string file_2
File name.
Definition: JHead.hh:930
bool match(const norma &object) const
Test match.
Definition: JHead.hh:794
time_interval()
Default constructor.
Definition: JHead.hh:1081
std::string key
Key.
Definition: JHead.hh:928
bool match(const flux &object) const
Test match.
Definition: JHead.hh:922
int type
Type.
Definition: JHead.hh:927
DAQ()
Default constructor.
Definition: JHead.hh:1000
bool is_integer(const std::string &buffer)
Check if string is an integer.
Definition: JLangToolkit.hh:58
JAANET::primary primary
Definition: JHead.hh:1521
double z
Sea bottom [m].
Definition: JHead.hh:986
JRange_t cosT
Cosine zenith angle range.
Definition: JHead.hh:407
double zmin
Bottom [m].
Definition: JHead.hh:625
print
Definition: JConvertDusj.sh:44
Range of values.
Definition: JRange.hh:38
bool match(const livetime &object) const
Test match.
Definition: JHead.hh:848
double zmin
Bottom [m].
Definition: JHead.hh:704
Monte Carlo run header.
Definition: JHead.hh:1167
genvol()
Default constructor.
Definition: JHead.hh:640
bool less(const spectrum &object) const
Comparison.
Definition: JHead.hh:537
int run_id
MC run number.
Definition: JHead.hh:143
double Emin
Minimal energy [GeV].
Definition: JHead.hh:770
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Definition: Head.hh:65
can()
Default constructor.
Definition: JHead.hh:566
std::string filename
Definition: JHead.hh:279
JAANET::time_interval time_interval
Definition: JHead.hh:1520
size_t getNumberOfMatches(const JHead &header) const
Get number of matching fields.
Definition: JHead.hh:1375
static bool match(const std::vector< T > &first, const std::vector< T > &second)
Test is containers match.
Definition: JHead.hh:1666
JAANET::muon_desc_file muon_desc_file
Definition: JHead.hh:1500
#define ClassDef(name, version)
Definition: JRoot.hh:32
norma()
Default constructor.
Definition: JHead.hh:783
virtual ~JHead()
Virtual destructor.
Definition: JHead.hh:1193
std::string program
Definition: JHead.hh:278
bool match(const coord_origin &object) const
Test match.
Definition: JHead.hh:746
double r
Radius [m].
Definition: JHead.hh:587
coord_origin(const double x, const double y, const double z)
Constructor.
Definition: JHead.hh:734
bool match(const genvol &object) const
Test match.
Definition: JHead.hh:665
std::vector< JAANET::detector > detector
Definition: JHead.hh:1499
Normalisation of MUPAGE events.
Definition: JHead.hh:822
static bool match(const JHead &first, const JHead &second, T JHead::*pd)
Test match of given data member of headers.
Definition: JHead.hh:1688
bool less(const genvol &object) const
Comparison.
Definition: JHead.hh:654
bool match(const seabottom &object) const
Test match.
Definition: JHead.hh:953
detector()
Default constructor.
Definition: JHead.hh:231
Auxiliary class to define a range between two values.
iterator pull(T JHead::*pd)
Pull given data member from Head.
Definition: JHead.hh:1294
std::string date
processing date
Definition: JHead.hh:493
bool write(const Vec &v, std::ostream &os)
Write a Vec(tor) to a stream.
Definition: io_ascii.hh:155
primary()
Default constructor.
Definition: JHead.hh:1111
JAANET::tgen tgen
Definition: JHead.hh:1519
JAANET::cut_in cut_in
Definition: JHead.hh:1506
Simple wrapper for UUID.
Definition: JUUID.hh:22
JHead & getHeader()
Get header.
Definition: JHead.hh:1213
static bool less(const std::vector< T > &first, const std::vector< T > &second)
Comparison of containers.
Definition: JHead.hh:1637
bool less(const cut &object) const
Comparison.
Definition: JHead.hh:371
General purpose string class.
Definition: JHead.hh:152
start_run()
Default constructor.
Definition: JHead.hh:139
double gDir
Angle.
Definition: JHead.hh:769
double primaryFlux
Primary flux.
Definition: JHead.hh:812
double radius
Radius [m].
Definition: JHead.hh:627
bool match(const DAQ &object) const
Test match.
Definition: JHead.hh:1021
JAANET::target target
Definition: JHead.hh:1501
void copy(const Head &from, JHead &to)
Copy header from from to to.
Definition: JHead.cc:139
Primary particle.
Definition: JHead.hh:1107
Muon descriptor file.
Definition: JHead.hh:288
fixedcan()
Default constructor.
Definition: JHead.hh:600
The fixed cylinder used for photon tracking.
Definition: JHead.hh:596
static bool match(const T &first, const T &second)
Test match.
Definition: JHead.hh:1621
double z
Sea bottom [m].
Definition: JHead.hh:958
bool equals(const JFirst_t &first, const JSecond_t &second, const double precision=std::numeric_limits< double >::min())
Check equality.
Definition: JMathToolkit.hh:86
JAANET::cut_nu cut_nu
Definition: JHead.hh:1507
bool less(const livetime &object) const
Comparison.
Definition: JHead.hh:837
UTC time interval for event generation.
Definition: JHead.hh:1077
end_event()
Default constructor.
Definition: JHead.hh:1150
Phase space of atmospheric muon generation.
Definition: JHead.hh:426
double numberOfSeconds
Time in seconds.
Definition: JHead.hh:1068
std::string time
processing time
Definition: JHead.hh:494
tgen()
Default constructor.
Definition: JHead.hh:1053
End of event record.
Definition: JHead.hh:1146
Phase space of primary particle.
Definition: JHead.hh:416
JAANET::coord_origin coord_origin
Definition: JHead.hh:1512
static const char AANET_TAG_SEPARATOR
Separator for tag extension of multiple tags in Head (&quot;_&lt;counter&gt;&quot;).
Definition: JHead.hh:65
bool is_valid(T JHead::*pd) const
Check validity of given data member in JHead.
Definition: JHead.hh:1251
JAANET::XSecFile XSecFile
Definition: JHead.hh:1497
JAANET::DAQ DAQ
Definition: JHead.hh:1518
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
double numberOfSeconds
Live time [s].
Definition: JHead.hh:883
bool match(const primary &object) const
Test match.
Definition: JHead.hh:1132
Vec coord_origin() const
Get coordinate origin.
Definition: Head.hh:395
JHead(const Head &header)
Copy constructor.
Definition: JHead.hh:1184
friend std::ostream & operator<<(std::ostream &out, const detector &object)
Write detector to output stream.
Definition: JHead.hh:273
bool match(const String &object) const
Test match.
Definition: JHead.hh:166
Neutrino energy spectrum.
Definition: JHead.hh:523
The bottom of the sea.
Definition: JHead.hh:939
std::ostream & write(std::ostream &out) const
Write header to output.
Definition: JHead.cc:68
String()
Default constructor.
Definition: JHead.hh:156
double zmax
Top [m].
Definition: JHead.hh:586
const_iterator pull(T JHead::*pd) const
Pull given data member from Head.
Definition: JHead.hh:1281
The cylinder used for photon tracking.
Definition: JHead.hh:562
std::string file_1
File name.
Definition: JHead.hh:929
coord_origin()
Default constructor.
Definition: JHead.hh:723