Jpp  18.2.1
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 
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  * Calibration.
327  */
328  struct calibration :
329  public String
330  {
331  static const std::string statical() { return "statical"; }
332  static const std::string dynamical() { return "dynamical"; }
333 
335  };
336 
337 
338  /**
339  * General purpose class of phase space generation.
340  */
341  struct cut {
342  /**
343  * Default constructor.
344  */
345  cut() :
346  E (0.0, 0.0),
347  cosT(0.0, 0.0)
348  {}
349 
350  /**
351  * Constructor.
352  *
353  * \param _E energy range
354  * \param _cosT cosine zenith angle range
355  */
356  cut(const JRange_t& _E,
357  const JRange_t& _cosT) :
358  E (_E),
359  cosT(_cosT)
360  {}
361 
362  /**
363  * Constructor.
364  *
365  * \param Emin energy range lower bound
366  * \param Emax energy range upper bound
367  * \param cosTmin cosine zenith angle lower bound
368  * \param cosTmax cosine zenith angle upper bound
369  */
370  cut(const double Emin,
371  const double Emax,
372  const double cosTmin,
373  const double cosTmax) :
374  E (Emin, Emax),
375  cosT(cosTmin, cosTmax)
376  {}
377 
378  /**
379  * Comparison.
380  *
381  * \param object cut
382  * \return true if this cut less than given cut; else false
383  */
384  inline bool less(const cut& object) const
385  {
386  if (E.getLowerLimit() == object.E.getLowerLimit()) {
387 
388  if (E.getUpperLimit() == object.E.getUpperLimit()) {
389 
390  if (cosT.getLowerLimit() == object.cosT.getLowerLimit()) {
391  return cosT.getUpperLimit() < object.cosT.getUpperLimit();
392  } else {
393  return cosT.getLowerLimit() < object.cosT.getLowerLimit();
394  }
395 
396  } else {
397 
398  return E.getUpperLimit() < object.E.getUpperLimit();
399  }
400 
401  } else {
402 
403  return E.getLowerLimit() < object.E.getLowerLimit();
404  }
405  }
406 
407  /**
408  * Test match.
409  *
410  * \param object cut
411  * \return true if matches; else false
412  */
413  inline bool match(const cut& object) const
414  {
415  return (E .equals(object.E) &&
416  cosT.equals(object.cosT));
417  }
418 
419  JRange_t E; ///< Energy range [GeV]
420  JRange_t cosT; ///< Cosine zenith angle range
421 
422  ClassDefNV(cut,1);
423  };
424 
425 
426  /**
427  * Phase space of primary particle.
428  */
429  struct cut_primary :
430  public cut
431  {
433  };
434 
435 
436  /**
437  * Phase space of atmospheric muon generation.
438  */
439  struct cut_seamuon :
440  public cut
441  {
443  };
444 
445 
446  /**
447  * Phase space of incoming particle
448  */
449  struct cut_in :
450  public cut
451  {
452  ClassDefNV(cut_in,1);
453  };
454 
455 
456  /**
457  * Phase space of incident neutrino.
458  */
459  struct cut_nu :
460  public cut
461  {
462  ClassDefNV(cut_nu,1);
463  };
464 
465 
466  /**
467  * Description of Monte Carlo event generation applications.
468  */
469  struct generator {
470  /**
471  * Default constructor.
472  */
474  program(),
475  version(),
476  date(),
477  time()
478  {}
479 
480  /**
481  * Comparison.
482  *
483  * \param object generator
484  * \return true if this primary particle is less than given primary particle; else false
485  */
486  inline bool less(const generator& object) const
487  {
488  return program < object.program;
489  }
490 
491  /**
492  * Test match.
493  *
494  * Note that only the name of program is matched.
495  *
496  * \param object generator
497  * \return true if matches; else false
498  */
499  inline bool match(const generator& object) const
500  {
501  return program == object.program;
502  }
503 
504  std::string program; ///< program name
505  std::string version; ///< program version
506  std::string date; ///< processing date
507  std::string time; ///< processing time
508 
510  };
511 
512 
513  /**
514  * Physics information.
515  */
516  struct physics :
517  public String
518  {
519  ClassDefNV(physics,1);
520  };
521 
522 
523  /**
524  * Generator for simulation.
525  */
526  struct simul :
527  public generator
528  {
529  ClassDefNV(simul,1);
530  };
531 
532 
533  /**
534  * Neutrino energy spectrum.
535  */
536  struct spectrum {
537  /**
538  * Default constructor.
539  */
540  spectrum() :
541  alpha(0)
542  {}
543 
544  /**
545  * Comparison.
546  *
547  * \param object spectrum
548  * \return true if this spectrum less than given spectrum; else false
549  */
550  inline bool less(const spectrum& object) const
551  {
552  return alpha < object.alpha;
553  }
554 
555  /**
556  * Test match.
557  *
558  * \param object spectrum
559  * \return true if matches; else false
560  */
561  inline bool match(const spectrum& object) const
562  {
563  return (alpha == object.alpha);
564  }
565 
566  double alpha; ///< Energy spectrum: \f$ \Phi \propto E^{-\alpha} \f$
567 
568  ClassDefNV(spectrum,1);
569  };
570 
571 
572  /**
573  * The cylinder used for photon tracking.
574  */
575  struct can {
576  /**
577  * Default constructor.
578  */
579  can() :
580  zmin(0),
581  zmax(0),
582  r(0)
583  {}
584 
585  /**
586  * Test match.
587  *
588  * \param object can
589  * \return true if matches; else false
590  */
591  inline bool match(const can& object) const
592  {
593  return (zmin == object.zmin &&
594  zmax == object.zmax &&
595  r == object.r);
596  }
597 
598  double zmin; ///< Bottom [m]
599  double zmax; ///< Top [m]
600  double r; ///< Radius [m]
601 
602  ClassDefNV(can,1);
603  };
604 
605 
606  /**
607  * The fixed cylinder used for photon tracking.
608  */
609  struct fixedcan {
610  /**
611  * Default constructor.
612  */
614  xcenter(0),
615  ycenter(0),
616  zmin(0),
617  zmax(0),
618  radius(0)
619  {}
620 
621  /**
622  * Test match.
623  *
624  * \param object can
625  * \return true if matches; else false
626  */
627  inline bool match(const fixedcan& object) const
628  {
629  return (xcenter == object.xcenter &&
630  ycenter == object.ycenter &&
631  zmin == object.zmin &&
632  zmax == object.zmax &&
633  radius == object.radius);
634  }
635 
636  double xcenter; ///< x-center [m]
637  double ycenter; ///< y-center [m]
638  double zmin; ///< Bottom [m]
639  double zmax; ///< Top [m]
640  double radius; ///< Radius [m]
641 
642  ClassDefNV(fixedcan,1);
643  };
644 
645 
646  /**
647  * Neutrino vertex volume.
648  */
649  struct genvol {
650  /**
651  * Default constructor.
652  */
653  genvol() :
654  zmin(0),
655  zmax(0),
656  r(0),
657  volume(0),
658  numberOfEvents(0)
659  {}
660 
661  /**
662  * Comparison.
663  *
664  * \param object genvol
665  * \return true if this genvol less than given genvol; else false
666  */
667  inline bool less(const genvol& object) const
668  {
669  return volume < object.volume;
670  }
671 
672  /**
673  * Test match.
674  *
675  * \param object generation volume
676  * \return true if matches; else false
677  */
678  inline bool match(const genvol& object) const
679  {
680  return (zmin == object.zmin &&
681  zmax == object.zmax &&
682  r == object.r &&
683  volume == object.volume);
684  }
685 
686  /**
687  * Addition.
688  *
689  * \param object generation volume
690  * \return this generation volume
691  */
692  inline genvol& add(const genvol& object)
693  {
694  numberOfEvents += object.numberOfEvents;
695 
696  return *this;
697  }
698 
699  /**
700  * Scale.
701  *
702  * \param factor 1D scale factor
703  * \param z z position
704  * \return this genvol
705  */
706  inline genvol& mul(const double factor,
707  const double z = 0.0)
708  {
709  zmin = (zmin - z) * factor + z;
710  zmax = (zmax - z) * factor + z;
711  r *= factor;
712  volume *= factor * factor * factor;
713 
714  return *this;
715  }
716 
717  double zmin; ///< Bottom [m]
718  double zmax; ///< Top [m]
719  double r; ///< Radius [m]
720  double volume; ///< Volume [m^3]
721  double numberOfEvents; ///< Number of events
722 
723  ClassDefNV(genvol,1);
724  };
725 
726 
727  /**
728  * Coordinate origin.
729  */
730  struct coord_origin :
731  public Vec
732  {
733  /**
734  * Default constructor.
735  */
737  Vec()
738  {}
739 
740  /**
741  * Constructor.
742  *
743  * \param x x position
744  * \param y y position
745  * \param z z position
746  */
747  coord_origin(const double x,
748  const double y,
749  const double z) :
750  Vec(x,y,z)
751  {}
752 
753  /**
754  * Test match.
755  *
756  * \param object coordinate origin
757  * \return true if matches; else false
758  */
759  inline bool match(const coord_origin& object) const
760  {
761  return (x == object.x &&
762  y == object.y &&
763  z == object.z);
764  }
765 
767  };
768 
769 
770  /**
771  * Phase space for incident neutrino.
772  */
773  struct genhencut {
774  /**
775  * Default constructor.
776  */
778  gDir(0),
779  Emin(0)
780  {}
781 
782  double gDir; ///< Angle
783  double Emin; ///< Minimal energy [GeV]
784 
786  };
787 
788 
789  /**
790  * Normlisation of CORSIKA events.
791  */
792  struct norma {
793  /**
794  * Default constructor.
795  */
796  norma() :
797  primaryFlux(0),
798  numberOfPrimaries(0)
799  {}
800 
801  /**
802  * Test match.
803  *
804  * \param object normalisation
805  * \return true if matches; else false
806  */
807  inline bool match(const norma& object) const
808  {
809  return (primaryFlux == object.primaryFlux);
810  }
811 
812  /**
813  * Addition.
814  *
815  * \param object normalisation
816  * \return this normalisation
817  */
818  inline norma& add(const norma& object)
819  {
820  numberOfPrimaries += object.numberOfPrimaries;
821 
822  return *this;
823  }
824 
825  double primaryFlux; ///< Primary flux
826  double numberOfPrimaries; ///< Number of primaries
827 
828  ClassDefNV(norma,1);
829  };
830 
831 
832  /**
833  * Normalisation of MUPAGE events.
834  */
835  struct livetime {
836  /**
837  * Default constructor.
838  */
840  numberOfSeconds(0),
841  errorOfSeconds(0)
842  {}
843 
844  /**
845  * Comparison.
846  *
847  * \param object livetime
848  * \return true if this livetime is less than given livetime; else false
849  */
850  inline bool less(const livetime& object) const
851  {
852  return numberOfSeconds < object.numberOfSeconds;
853  }
854 
855  /**
856  * Test match.
857  *
858  * \param object live time
859  * \return true if matches; else false
860  */
861  inline bool match(const livetime& object) const
862  {
863  return ((numberOfSeconds == 0.0 && object.numberOfSeconds == 0.0) ||
864  (numberOfSeconds > 0.0 && object.numberOfSeconds > 0.0));
865  }
866 
867  /**
868  * Addition.
869  *
870  * \param object live time
871  * \return this live time
872  */
873  inline livetime& add(const livetime& object)
874  {
875  numberOfSeconds += object.numberOfSeconds;
876  errorOfSeconds = sqrt(errorOfSeconds * errorOfSeconds +
877  object.errorOfSeconds * object.errorOfSeconds);
878 
879  return *this;
880  }
881 
882  /**
883  * Scale.
884  *
885  * \param factor 1D scale factor
886  * \return this livetime
887  */
888  inline livetime& mul(const double factor)
889  {
890  numberOfSeconds /= (factor * factor);
891  errorOfSeconds /= (factor * factor);
892 
893  return *this;
894  }
895 
896  double numberOfSeconds; ///< Live time [s]
897  double errorOfSeconds; ///< Uncertainty on live time [s]
898 
899  ClassDefNV(livetime,1);
900  };
901 
902 
903  /**
904  * Neutrino flux.
905  */
906  struct flux {
907  public:
908  /**
909  * Default constructor.
910  */
911  flux() :
912  type(0),
913  key(),
914  file_1(),
915  file_2()
916  {}
917 
918  /**
919  * Comparison.
920  *
921  * \param object flux
922  * \return true if this flux is less than given flux; else false
923  */
924  inline bool less(const flux& object) const
925  {
926  return type < object.type;
927  }
928 
929  /**
930  * Test match.
931  *
932  * \param object flux
933  * \return true if matches; else false
934  */
935  inline bool match(const flux& object) const
936  {
937  return type == object.type;
938  }
939 
940  int type; ///< Type
941  std::string key; ///< Key
942  std::string file_1; ///< File name
943  std::string file_2; ///< File name
944 
945  ClassDefNV(flux,1);
946  };
947 
948 
949  /**
950  * The bottom of the sea.
951  */
952  struct seabottom {
953  /**
954  * Default constructor.
955  */
957  z(0)
958  {}
959 
960  /**
961  * Test match.
962  *
963  * \param object sea bottom
964  * \return true if matches; else false
965  */
966  inline bool match(const seabottom& object) const
967  {
968  return (z == object.z);
969  }
970 
971  double z; ///< Sea bottom [m]
972 
974  };
975 
976 
977  /**
978  * Depth.
979  */
980  struct depth {
981  /**
982  * Default constructor.
983  */
984  depth() :
985  z(0)
986  {}
987 
988  /**
989  * Test match.
990  *
991  * \param object sea bottom
992  * \return true if matches; else false
993  */
994  inline bool match(const depth& object) const
995  {
996  return (z == object.z);
997  }
998 
999  double z; ///< Sea bottom [m]
1000 
1001  ClassDefNV(depth,1);
1002  };
1003 
1004 
1005  /**
1006  * Livetime of DAQ data.
1007  */
1008  struct DAQ {
1009  public:
1010  /**
1011  * Default constructor.
1012  */
1013  DAQ() :
1014  livetime_s(0.0)
1015  {}
1016 
1017  /**
1018  * Comparison.
1019  *
1020  * \param object DAQ
1021  * \return true if this DAQ is less than given DAQ; else false
1022  */
1023  inline bool less(const DAQ& object) const
1024  {
1025  return livetime_s < object.livetime_s;
1026  }
1027 
1028  /**
1029  * Test match.
1030  *
1031  * \param object DAQ
1032  * \return true if matches; else false
1033  */
1034  inline bool match(const DAQ& object) const
1035  {
1036  return ((livetime_s == 0.0 && object.livetime_s == 0.0) ||
1037  (livetime_s > 0.0 && object.livetime_s > 0.0));
1038  }
1039 
1040  /**
1041  * Addition.
1042  *
1043  * \param object DAQ
1044  * \return this DAQ
1045  */
1046  inline DAQ& add(const DAQ& object)
1047  {
1048  livetime_s += object.livetime_s;
1049 
1050  return *this;
1051  }
1052 
1053  double livetime_s; ///< Live time [s]
1054 
1055  ClassDefNV(DAQ,1);
1056  };
1057 
1058 
1059  /**
1060  * Livetime of noise data.
1061  */
1062  struct K40 {
1063  public:
1064  /**
1065  * Default constructor.
1066  */
1067  K40() :
1068  livetime_s(0.0)
1069  {}
1070 
1071  /**
1072  * Comparison.
1073  *
1074  * \param object K40
1075  * \return true if this K40 is less than given K40; else false
1076  */
1077  inline bool less(const K40& object) const
1078  {
1079  return livetime_s < object.livetime_s;
1080  }
1081 
1082  /**
1083  * Test match.
1084  *
1085  * \param object K40
1086  * \return true if matches; else false
1087  */
1088  inline bool match(const K40& object) const
1089  {
1090  return ((livetime_s == 0.0 && object.livetime_s == 0.0) ||
1091  (livetime_s > 0.0 && object.livetime_s > 0.0));
1092  }
1093 
1094  /**
1095  * Addition.
1096  *
1097  * \param object K40
1098  * \return this K40
1099  */
1100  inline K40& add(const K40& object)
1101  {
1102  livetime_s += object.livetime_s;
1103 
1104  return *this;
1105  }
1106 
1107  double livetime_s; ///< Live time [s]
1108 
1109  ClassDefNV(K40,1);
1110  };
1111 
1112 
1113  /**
1114  * Time duration of event generation.
1115  */
1116  struct tgen {
1117  /**
1118  * Default constructor.
1119  */
1120  tgen() :
1121  numberOfSeconds(0)
1122  {}
1123 
1124  /**
1125  * Test match.
1126  *
1127  * \param object time duration
1128  * \return true if matches; else false
1129  */
1130  inline bool match(const tgen& object) const
1131  {
1132  return this->numberOfSeconds == object.numberOfSeconds;
1133  }
1134 
1135  double numberOfSeconds; ///< Time in seconds
1136 
1137  ClassDefNV(tgen,1);
1138  };
1139 
1140 
1141  /**
1142  * UTC time interval for event generation.
1143  */
1144  struct time_interval {
1145  /**
1146  * Default constructor.
1147  */
1149  t1(0),
1150  t2(0)
1151  {}
1152 
1153  /**
1154  * Test match.
1155  *
1156  * \param object time interval
1157  * \return true if matches; else false
1158  */
1159  inline bool match(const time_interval& object) const
1160  {
1161  return (this->t1 == object.t1 && this->t2 == object.t2);
1162  }
1163 
1164  double t1; ///< Start time in seconds
1165  double t2; ///< Stop time in seconds
1166 
1168  };
1169 
1170 
1171  /**
1172  * Primary particle.
1173  */
1174  struct primary {
1175  /**
1176  * Default constructor.
1177  */
1178  primary() :
1179  type(0)
1180  {}
1181 
1182  /**
1183  * Comparison.
1184  *
1185  * \param object primary particle
1186  * \return true if this primary particle is less than given primary particle; else false
1187  */
1188  inline bool less(const primary& object) const
1189  {
1190  return type < object.type;
1191  }
1192 
1193  /**
1194  * Test match.
1195  *
1196  * \param object primary particle
1197  * \return true if matches; else false
1198  */
1199  inline bool match(const primary& object) const
1200  {
1201  return (type == object.type);
1202  }
1203 
1204  int type; ///< Particle type
1205 
1206  ClassDefNV(primary,1);
1207  };
1208 
1209 
1210  /**
1211  * End of event record.
1212  */
1213  struct end_event {
1214  /**
1215  * Default constructor.
1216  */
1218  {}
1219 
1220  ClassDefNV(end_event,1);
1221  };
1222 
1223 
1224  /**
1225  * Monte Carlo run header.
1226  *
1227  * This class extends the Head class so that the data from specific tags
1228  * can be promoted to concrete data types.
1229  *
1230  * Note that for the copy of new JHead data (e.g.\ data not obtained via a previous JAANET::copy) to become effective,
1231  * the key words in the corresponding map of the Head class should be set. \n
1232  * To this end, member method JHead::push can be used.
1233  */
1234  class JHead :
1235  public Head
1236  {
1237  public:
1238  /**
1239  * Default constructor.
1240  */
1242  {
1243  createUUID();
1244  }
1245 
1246 
1247  /**
1248  * Copy constructor.
1249  *
1250  * \param header header
1251  */
1252  JHead(const Head& header)
1253  {
1254  copy(header, *this);
1255  }
1256 
1257 
1258  /**
1259  * Virtual destructor.
1260  */
1261  virtual ~JHead()
1262  {}
1263 
1264 
1265  /**
1266  * Get header.
1267  *
1268  * \return header
1269  */
1270  const JHead& getHeader() const
1271  {
1272  return static_cast<const JHead&>(*this);
1273  }
1274 
1275 
1276  /**
1277  * Get header.
1278  *
1279  * \return header
1280  */
1282  {
1283  return static_cast<JHead&>(*this);
1284  }
1285 
1286 
1287  /**
1288  * Set header.
1289  *
1290  * \param header header
1291  */
1292  void setHeader(const JHead& header)
1293  {
1294  static_cast<JHead&>(*this) = header;
1295  }
1296 
1297 
1298  /**
1299  * Create UUID if not already set.
1300  */
1301  void createUUID()
1302  {
1303  if (!is_valid(&JHead::UUID)) {
1304  this->UUID = JUUID::rndm();
1305  this->push(&JHead::UUID);
1306  }
1307  }
1308 
1309 
1310  /**
1311  * Check validity of given data member in JHead.
1312  *
1313  * The validity is defined by the presence of the name of the data member in the underlying map.
1314  *
1315  * \param pd pointer to data member
1316  * \return true if valid; else false
1317  */
1318  template<class T>
1319  inline bool is_valid(T JHead::*pd) const
1320  {
1321  return (this->pull(pd) != this->end());
1322  }
1323 
1324 
1325  /**
1326  * Check validity of given data member in JHead.
1327  *
1328  * The validity is defined by difference between actual and default value.
1329  *
1330  * \param object object
1331  * \return true if valid; else false
1332  */
1333  template<class T>
1334  static bool is_valid(const T& object)
1335  {
1336  static const T value;
1337 
1338  return (object.less(value) || value.less(object));
1339  }
1340 
1341 
1342  /**
1343  * Pull given data member from Head.
1344  *
1345  * \param pd pointer to data member
1346  * \return iterator of Head
1347  */
1348  template<class T>
1349  inline const_iterator pull(T JHead::*pd) const
1350  {
1351  return this->find(JROOT::getDataMember(pd)->GetName());
1352  }
1353 
1354 
1355  /**
1356  * Pull given data member from Head.
1357  *
1358  * \param pd pointer to data member
1359  * \return iterator of Head
1360  */
1361  template<class T>
1362  inline iterator pull(T JHead::*pd)
1363  {
1364  return this->find(JROOT::getDataMember(pd)->GetName());
1365  }
1366 
1367 
1368  /**
1369  * Push given data member to Head.
1370  *
1371  * \param pd pointer to data member
1372  */
1373  template<class T>
1374  inline void push(T JHead::*pd)
1375  {
1376  (*this)[JROOT::getDataMember(pd)->GetName()] = "";
1377  }
1378 
1379 
1380  /**
1381  * Push all data members to Head.
1382  */
1383  void push();
1384 
1385 
1386  /**
1387  * Reset and remove given data member from Head.
1388  *
1389  * \param pd pointer to data member
1390  */
1391  template<class T>
1392  inline void erase(T JHead::*pd)
1393  {
1394  this->*pd = T();
1395 
1396  iterator p = this->pull(pd);
1397 
1398  if (p != this->end()) {
1399  static_cast<Head*>(this)->erase(p);
1400  }
1401  }
1402 
1403 
1404  /**
1405  * Get matching fields.
1406  *
1407  * \param header header
1408  * \return header with matching fields
1409  */
1410  inline JHead getMatch(const JHead& header) const
1411  {
1412 #define IF_MATCH(A, B, C, D) \
1413  if (match(B,C,D)) { A.push(D); } \
1414  else { A.erase(D); }
1415 
1416  JHead buffer(*this);
1417 
1418  buffer.clear();
1419 
1420  buffer.createUUID();
1421 
1422  IF_MATCH(buffer, *this, header, &JHead::cut_primary);
1423  IF_MATCH(buffer, *this, header, &JHead::cut_seamuon);
1424  IF_MATCH(buffer, *this, header, &JHead::cut_in);
1425  IF_MATCH(buffer, *this, header, &JHead::cut_nu);
1426  IF_MATCH(buffer, *this, header, &JHead::simul);
1427  IF_MATCH(buffer, *this, header, &JHead::spectrum);
1428  IF_MATCH(buffer, *this, header, &JHead::can);
1429  IF_MATCH(buffer, *this, header, &JHead::fixedcan);
1430  IF_MATCH(buffer, *this, header, &JHead::genvol);
1431  IF_MATCH(buffer, *this, header, &JHead::coord_origin);
1432 
1433  IF_MATCH(buffer, *this, header, &JHead::norma);
1434  IF_MATCH(buffer, *this, header, &JHead::livetime);
1435 
1436  IF_MATCH(buffer, *this, header, &JHead::seabottom);
1437  IF_MATCH(buffer, *this, header, &JHead::depth);
1438  IF_MATCH(buffer, *this, header, &JHead::tgen);
1439  IF_MATCH(buffer, *this, header, &JHead::time_interval);
1440 
1441  IF_MATCH(buffer, *this, header, &JHead::primary);
1442  IF_MATCH(buffer, *this, header, &JHead::flux);
1443  IF_MATCH(buffer, *this, header, &JHead::DAQ);
1444  IF_MATCH(buffer, *this, header, &JHead::K40);
1445 
1446  return buffer;
1447 
1448 #undef IF_MATCH
1449  }
1450 
1451 
1452  /**
1453  * Get number of matching fields.
1454  *
1455  * \param header header
1456  * \return number of matching header fields
1457  */
1458  inline size_t getNumberOfMatches(const JHead& header) const
1459  {
1460  const JHead head = getMatch(header);
1461 
1462  return head.size();
1463  }
1464 
1465 
1466  /**
1467  * Test match of headers.
1468  *
1469  * \param header second header
1470  * \return true if all header fields match; else false
1471  */
1472  inline bool match(const JHead& header) const
1473  {
1474  return getNumberOfMatches(header) == getNumberOfMatches(*this);
1475  }
1476 
1477 
1478  /**
1479  * Comparison of headers.
1480  *
1481  * \param header header
1482  * \return true if this header less than given header; else false
1483  */
1484  inline bool less(const JHead& header) const
1485  {
1486 #define RETURN_IF_DIFFERENT(A, B) \
1487  if (less(A,B)) { return true; } \
1488  if (less(B,A)) { return false; }
1489 
1490  // compare physics
1491 
1492  RETURN_IF_DIFFERENT(this->physics, header.physics);
1493 
1494  // compare simulation
1495 
1496  RETURN_IF_DIFFERENT(this->simul, header.simul);
1497 
1498  // compare generation data
1499 
1500  RETURN_IF_DIFFERENT(this->primary, header.primary);
1501  RETURN_IF_DIFFERENT(this->flux, header.flux);
1502  RETURN_IF_DIFFERENT(this->spectrum, header.spectrum);
1505  RETURN_IF_DIFFERENT(this->cut_in, header.cut_in);
1506  RETURN_IF_DIFFERENT(this->cut_nu, header.cut_nu);
1507  RETURN_IF_DIFFERENT(this->genvol, header.genvol);
1508 
1509  // compare compatibility
1510 
1511  if (is_valid(this->livetime) == is_valid(header.livetime) &&
1512  is_valid(this->DAQ) == is_valid(header.DAQ) &&
1513  is_valid(this->K40) == is_valid(header.K40)) {
1514  return false;
1515  }
1516 
1517  THROW(JException, "JHead::less() headers do not compare.");
1518 
1519 #undef RETURN_IF_DIFFERENT
1520  }
1521 
1522 
1523  /**
1524  * Addition of headers.
1525  *
1526  * \param header header
1527  * \return this header
1528  */
1529  inline JHead& add(const JHead& header)
1530  {
1531  if (match(header)) {
1532 
1533  this->createUUID();
1534  this->UUID = JUUID::rndm();
1535 
1536  genvol .add(header.genvol);
1537  norma .add(header.norma);
1538  livetime.add(header.livetime);
1539  DAQ .add(header.DAQ);
1540  K40 .add(header.K40);
1541 
1542  } else {
1543 
1544  THROW(JException, "JHead::add() headers do not match.");
1545  }
1546 
1547  return *this;
1548  }
1549 
1550 
1551  /**
1552  * Equal operator.
1553  *
1554  * Note that this operator uses the JHead::match method.
1555  *
1556  * \param first first header
1557  * \param second second header
1558  * \return true if two headers are equal; else false
1559  */
1560  friend inline bool operator==(const JHead& first,
1561  const JHead& second)
1562  {
1563  return first.match(second);
1564  }
1565 
1566 
1567  /**
1568  * Less than operator.
1569  *
1570  * \param first first header
1571  * \param second second header
1572  * \return true if first header is less than second header; else false
1573  */
1574  friend inline bool operator<(const JHead& first,
1575  const JHead& second)
1576  {
1577  return first.less(second);
1578  }
1579 
1580  JAANET::start_run start_run; // first data member
1581  JUUID UUID; // header unique identifier
1610  JAANET::end_event end_event; // last data member
1611 
1612 
1613  /**
1614  * Get maximum number of matching header fields.
1615  *
1616  * \return maximum number of matching header fields
1617  */
1618  static inline const size_t getMaximumNumberOfMatches()
1619  {
1620  static JHead header;
1621 
1622  header.push();
1623 
1624  static const size_t value = header.getNumberOfMatches(header);
1625 
1626  return value;
1627  }
1628 
1629 
1630  /**
1631  * Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
1632  * <pre>
1633  * <key>: <value> [<value>]*
1634  * <key>: <value> [<value>]*
1635  * </pre>
1636  *
1637  * \return equation parameters
1638  */
1640  {
1641  static JLANG::JEquationParameters parameters(":", "\n", "", "");
1642 
1643  return parameters;
1644  }
1645 
1646 
1647  /**
1648  * Set equation parameters.
1649  *
1650  * \param equation equation parameters
1651  */
1652  static inline void setEquationParameters(const JLANG::JEquationParameters& equation)
1653  {
1654  getEquationParameters() = equation;
1655  }
1656 
1657 
1658  /**
1659  * Read header from input.
1660  *
1661  * \param in input stream
1662  * \return input stream
1663  */
1664  std::istream& read(std::istream& in);
1665 
1666 
1667  /**
1668  * Write header to output.
1669  *
1670  * \param out output stream
1671  * \return output stream
1672  */
1673  std::ostream& write(std::ostream& out) const;
1674 
1675 
1676  /**
1677  * Print header to output.
1678  *
1679  * \param out output stream
1680  * \return output stream
1681  */
1682  std::ostream& print(std::ostream& out) const;
1683 
1684 
1685  ClassDef(JHead,5);
1686 
1687  private:
1688  /**
1689  * Comparison.
1690  *
1691  * \param first first object
1692  * \param second second object
1693  * \return true if first less than second; else false
1694  */
1695  template<class T>
1696  static inline bool less(const T& first,
1697  const T& second)
1698  {
1699  return first.less(second);
1700  }
1701 
1702 
1703  /**
1704  * Test match.
1705  *
1706  * \param first first object
1707  * \param second second object
1708  * \return true if matches; else false
1709  */
1710  template<class T>
1711  static inline bool match(const T& first,
1712  const T& second)
1713  {
1714  return first.match(second);
1715  }
1716 
1717 
1718  /**
1719  * Comparison of containers.
1720  * It is assumed that the containers are ordered in the same way.
1721  *
1722  * \param first first object
1723  * \param second second object
1724  * \return true if first is less than second; else false
1725  */
1726  template<class T>
1727  static inline bool less(const std::vector<T>& first,
1728  const std::vector<T>& second)
1729  {
1730  if (first.size() == second.size()) {
1731 
1732  for (size_t i = 0; i != first.size(); ++i) {
1733  if (less(first[i], second[i])) {
1734  return true;
1735  }
1736  }
1737 
1738  return false;
1739 
1740  } else {
1741 
1742  return first.size() < second.size();
1743  }
1744  }
1745 
1746 
1747  /**
1748  * Test is containers match.
1749  * It is assumed that the containers are ordered in the same way.
1750  *
1751  * \param first first object
1752  * \param second second object
1753  * \return true if matches; else false
1754  */
1755  template<class T>
1756  static inline bool match(const std::vector<T>& first,
1757  const std::vector<T>& second)
1758  {
1759  for (size_t i = 0; i != first.size() && i != second.size(); ++i) {
1760  if (!match(first[i], second[i])) {
1761  return false;
1762  }
1763  }
1764 
1765  return first.size() == second.size();
1766  }
1767 
1768 
1769  /**
1770  * Test match of given data member of headers.
1771  *
1772  * \param first first header
1773  * \param second second header
1774  * \param pd pointer to data member
1775  * \return true if matches; else false
1776  */
1777  template<class T>
1778  static inline bool match(const JHead& first,
1779  const JHead& second,
1780  T JHead::*pd)
1781  {
1782  return (first .is_valid(pd) &&
1783  second.is_valid(pd) &&
1784  match(first.*pd, second.*pd));
1785  }
1786  };
1787 
1788 
1789  /**
1790  * Equal operator.
1791  *
1792  * Note that this operator uses the JHead::match method.
1793  *
1794  * \param first first header
1795  * \param second second header
1796  * \return true if two headers are equal; else false
1797  */
1798  inline bool operator==(const Head& first,
1799  const Head& second)
1800  {
1801  return JHead(first).match(JHead(second));
1802  }
1803 
1804 
1805  /**
1806  * Less than operator.
1807  *
1808  * Note that this operator uses the JHead::less method.
1809  *
1810  * \param first first header
1811  * \param second second header
1812  * \return true if first header is less than second header; else false
1813  */
1814  inline bool operator<(const Head& first,
1815  const Head& second)
1816  {
1817  return JHead(first).less(JHead(second));
1818  }
1819 }
1820 
1821 
1822 /**
1823  * Read header from input.
1824  *
1825  * \param in input stream
1826  * \param header header
1827  * \return input stream
1828  */
1829 inline std::istream& operator>>(std::istream& in, JAANET::JHead& header)
1830 {
1831  return header.read(in);
1832 }
1833 
1834 
1835 /**
1836  * Write header to output.
1837  *
1838  * \param out output stream
1839  * \param header header
1840  * \return output stream
1841  */
1842 inline std::ostream& operator<<(std::ostream& out, const JAANET::JHead& header)
1843 {
1844  return header.write(out);
1845 }
1846 #endif
norma & add(const norma &object)
Addition.
Definition: JHead.hh:818
bool match(const cut &object) const
Test match.
Definition: JHead.hh:413
bool match(const detector &object) const
Test match.
Definition: JHead.hh:240
double zmin
Bottom [m].
Definition: JHead.hh:598
General exception.
Definition: JException.hh:24
Phase space of incident neutrino.
Definition: JHead.hh:459
bool is_valid(T JHead::*pd) const
Check validity of given data member in JHead.
Definition: JHead.hh:1319
Drawing.
Definition: JHead.hh:318
livetime & mul(const double factor)
Scale.
Definition: JHead.hh:888
Neutrino vertex volume.
Definition: JHead.hh:649
Exceptions.
bool less(const String &object) const
Comparison.
Definition: JHead.hh:177
double r
Radius [m].
Definition: JHead.hh:719
friend bool operator==(const JHead &first, const JHead &second)
Equal operator.
Definition: JHead.hh:1560
JRange()
Default constructor.
Definition: JRange.hh:54
Target.
Definition: JHead.hh:298
static const std::string dynamical()
Definition: JHead.hh:332
genvol & mul(const double factor, const double z=0.0)
Scale.
Definition: JHead.hh:706
double volume
Volume [m^3].
Definition: JHead.hh:720
bool less(const K40 &object) const
Comparison.
Definition: JHead.hh:1077
JAANET::primary primary
Definition: JHead.hh:1608
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
const_iterator pull(T JHead::*pd) const
Pull given data member from Head.
Definition: JHead.hh:1349
Livetime of DAQ data.
Definition: JHead.hh:1008
double t1
Start time in seconds.
Definition: JHead.hh:1164
bool match(const tgen &object) const
Test match.
Definition: JHead.hh:1130
seabottom()
Default constructor.
Definition: JHead.hh:956
livetime & add(const livetime &object)
Addition.
Definition: JHead.hh:873
Depth.
Definition: JHead.hh:980
version
Definition: JEditTuneHV.sh:5
bool less(const DAQ &object) const
Comparison.
Definition: JHead.hh:1023
bool less(const JHead &header) const
Comparison of headers.
Definition: JHead.hh:1484
friend std::istream & operator>>(std::istream &in, String &object)
Read string from input stream.
Definition: JHead.hh:200
#define RETURN_IF_DIFFERENT(A, B)
Phase space of incoming particle.
Definition: JHead.hh:449
Generator for simulation.
Definition: JHead.hh:526
static bool less(const T &first, const T &second)
Comparison.
Definition: JHead.hh:1696
bool operator<(const Head &first, const Head &second)
Less than operator.
Definition: JHead.hh:1814
double alpha
Energy spectrum: .
Definition: JHead.hh:566
const TDataMember * getDataMember(const JRootClass &parent, const JRootClass &member)
Get ROOT data member for given parent and member class.
Definition: JRootClass.hh:641
bool is_valid(const json &js)
Check validity of JSon data.
static const std::string statical()
Definition: JHead.hh:331
Phase space for incident neutrino.
Definition: JHead.hh:773
double numberOfEvents
Number of events.
Definition: JHead.hh:721
bool less(const generator &object) const
Comparison.
Definition: JHead.hh:486
static bool match(const T &first, const T &second)
Test match.
Definition: JHead.hh:1711
K40()
Default constructor.
Definition: JHead.hh:1067
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:504
JAANET::cut_in cut_in
Definition: JHead.hh:1592
depth()
Default constructor.
Definition: JHead.hh:984
Neutrino cross section file.
Definition: JHead.hh:308
JHead & getHeader()
Get header.
Definition: JHead.hh:1281
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
double t2
Stop time in seconds.
Definition: JHead.hh:1165
JAANET::start_run start_run
Definition: JHead.hh:1580
livetime()
Default constructor.
Definition: JHead.hh:839
double zmax
Top [m].
Definition: JHead.hh:639
Normlisation of CORSIKA events.
Definition: JHead.hh:792
static void setEquationParameters(const JLANG::JEquationParameters &equation)
Set equation parameters.
Definition: JHead.hh:1652
double errorOfSeconds
Uncertainty on live time [s].
Definition: JHead.hh:897
JAANET::norma norma
Definition: JHead.hh:1600
*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
Simple data structure to support I/O of equations (see class JLANG::JEquation).
bool match(const generator &object) const
Test match.
Definition: JHead.hh:499
JRange_t E
Energy range [GeV].
Definition: JHead.hh:419
bool match(const K40 &object) const
Test match.
Definition: JHead.hh:1088
bool match(const time_interval &object) const
Test match.
Definition: JHead.hh:1159
void erase(T JHead::*pd)
Reset and remove given data member from Head.
Definition: JHead.hh:1392
data_type r[M+1]
Definition: JPolint.hh:868
double livetime_s
Live time [s].
Definition: JHead.hh:1053
JAANET::K40 K40
Definition: JHead.hh:1605
genhencut()
Default constructor.
Definition: JHead.hh:777
JRange_t()
Default constructor.
Definition: JHead.hh:47
General purpose class of phase space generation.
Definition: JHead.hh:341
JAANET::time_interval time_interval
Definition: JHead.hh:1607
static bool less(const std::vector< T > &first, const std::vector< T > &second)
Comparison of containers.
Definition: JHead.hh:1727
bool match(const spectrum &object) const
Test match.
Definition: JHead.hh:561
std::istream & read(std::istream &in)
Read header from input.
Definition: JHead.cc:53
DAQ & add(const DAQ &object)
Addition.
Definition: JHead.hh:1046
bool match(const can &object) const
Test match.
Definition: JHead.hh:591
Coordinate origin.
Definition: JHead.hh:730
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Physics information.
Definition: JHead.hh:516
Calibration.
Definition: JHead.hh:328
Description of Monte Carlo event generation applications.
Definition: JHead.hh:469
JAANET::calibration calibration
Definition: JHead.hh:1589
double ycenter
y-center [m]
Definition: JHead.hh:637
Q JDAQEvent livetime_s
Definition: JDataQuality.sh:57
genvol & add(const genvol &object)
Addition.
Definition: JHead.hh:692
size_t getNumberOfMatches(const JHead &header) const
Get number of matching fields.
Definition: JHead.hh:1458
std::vector< JAANET::flux > flux
Definition: JHead.hh:1609
virtual ~JHead()
Virtual destructor.
Definition: JHead.hh:1261
ClassDefNV(start_run, 1)
std::vector< JAANET::detector > detector
Definition: JHead.hh:1584
Start of run record.
Definition: JHead.hh:135
spectrum()
Default constructor.
Definition: JHead.hh:540
iterator pull(T JHead::*pd)
Pull given data member from Head.
Definition: JHead.hh:1362
JAANET::tgen tgen
Definition: JHead.hh:1606
double zmax
Top [m].
Definition: JHead.hh:718
static const JUUID & rndm()
Generate random UUID.
Definition: JUUID.hh:78
std::string buffer
General purpose name.
Definition: JHead.hh:217
double xcenter
x-center [m]
Definition: JHead.hh:636
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
Type definition of range.
Definition: JHead.hh:41
int type
Particle type.
Definition: JHead.hh:1204
bool match(const fixedcan &object) const
Test match.
Definition: JHead.hh:627
Detector file.
Definition: JHead.hh:226
JNET::JTag getTag(JLANG::JType< KM3NETDAQ::JDAQTimeslice >)
Definition: JDAQTags.hh:88
JAANET::coord_origin coord_origin
Definition: JHead.hh:1598
Monte Carlo run header.
Definition: JHead.hh:1234
generator()
Default constructor.
Definition: JHead.hh:473
JUUID UUID
Definition: JHead.hh:1581
double numberOfPrimaries
Number of primaries.
Definition: JHead.hh:826
void createUUID()
Create UUID if not already set.
Definition: JHead.hh:1301
flux()
Default constructor.
Definition: JHead.hh:911
cut(const double Emin, const double Emax, const double cosTmin, const double cosTmax)
Constructor.
Definition: JHead.hh:370
bool less(const primary &object) const
Comparison.
Definition: JHead.hh:1188
cut(const JRange_t &_E, const JRange_t &_cosT)
Constructor.
Definition: JHead.hh:356
bool less(const flux &object) const
Comparison.
Definition: JHead.hh:924
cut()
Default constructor.
Definition: JHead.hh:345
JHead getMatch(const JHead &header) const
Get matching fields.
Definition: JHead.hh:1410
Neutrino flux.
Definition: JHead.hh:906
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
bool match(const depth &object) const
Test match.
Definition: JHead.hh:994
ClassDefNV(String, 1)
then awk string
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:505
Time duration of event generation.
Definition: JHead.hh:1116
JAANET::cut_nu cut_nu
Definition: JHead.hh:1593
std::string file_2
File name.
Definition: JHead.hh:943
bool match(const norma &object) const
Test match.
Definition: JHead.hh:807
time_interval()
Default constructor.
Definition: JHead.hh:1148
std::string key
Key.
Definition: JHead.hh:941
bool match(const flux &object) const
Test match.
Definition: JHead.hh:935
int type
Type.
Definition: JHead.hh:940
DAQ()
Default constructor.
Definition: JHead.hh:1013
bool is_integer(const std::string &buffer)
Check if string is an integer.
Definition: JLangToolkit.hh:58
JAANET::seabottom seabottom
Definition: JHead.hh:1602
JAANET::drawing drawing
Definition: JHead.hh:1583
static bool match(const std::vector< T > &first, const std::vector< T > &second)
Test is containers match.
Definition: JHead.hh:1756
double z
Sea bottom [m].
Definition: JHead.hh:999
JRange_t cosT
Cosine zenith angle range.
Definition: JHead.hh:420
JHead(const Head &header)
Copy constructor.
Definition: JHead.hh:1252
double zmin
Bottom [m].
Definition: JHead.hh:638
print
Definition: JConvertDusj.sh:44
JHead & add(const JHead &header)
Addition of headers.
Definition: JHead.hh:1529
Range of values.
Definition: JRange.hh:38
bool match(const livetime &object) const
Test match.
Definition: JHead.hh:861
double zmin
Bottom [m].
Definition: JHead.hh:717
genvol()
Default constructor.
Definition: JHead.hh:653
bool less(const spectrum &object) const
Comparison.
Definition: JHead.hh:550
int run_id
MC run number.
Definition: JHead.hh:143
double Emin
Minimal energy [GeV].
Definition: JHead.hh:783
JAANET::genvol genvol
Definition: JHead.hh:1597
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Definition: Head.hh:65
void push(T JHead::*pd)
Push given data member to Head.
Definition: JHead.hh:1374
can()
Default constructor.
Definition: JHead.hh:579
static bool match(const JHead &first, const JHead &second, T JHead::*pd)
Test match of given data member of headers.
Definition: JHead.hh:1778
std::string filename
Definition: JHead.hh:279
#define ClassDef(name, version)
Definition: JRoot.hh:32
norma()
Default constructor.
Definition: JHead.hh:796
std::string program
Definition: JHead.hh:278
JAANET::XSecFile XSecFile
Definition: JHead.hh:1582
bool match(const coord_origin &object) const
Test match.
Definition: JHead.hh:759
double r
Radius [m].
Definition: JHead.hh:600
coord_origin(const double x, const double y, const double z)
Constructor.
Definition: JHead.hh:747
JAANET::depth depth
Definition: JHead.hh:1603
bool match(const genvol &object) const
Test match.
Definition: JHead.hh:678
Normalisation of MUPAGE events.
Definition: JHead.hh:835
std::vector< JAANET::simul > simul
Definition: JHead.hh:1588
bool less(const genvol &object) const
Comparison.
Definition: JHead.hh:667
static const size_t getMaximumNumberOfMatches()
Get maximum number of matching header fields.
Definition: JHead.hh:1618
bool match(const seabottom &object) const
Test match.
Definition: JHead.hh:966
detector()
Default constructor.
Definition: JHead.hh:231
Auxiliary class to define a range between two values.
std::string date
processing date
Definition: JHead.hh:506
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:1178
JAANET::genhencut genhencut
Definition: JHead.hh:1599
Simple wrapper for UUID.
Definition: JUUID.hh:22
friend bool operator<(const JHead &first, const JHead &second)
Less than operator.
Definition: JHead.hh:1574
void setHeader(const JHead &header)
Set header.
Definition: JHead.hh:1292
bool less(const cut &object) const
Comparison.
Definition: JHead.hh:384
General purpose string class.
Definition: JHead.hh:152
start_run()
Default constructor.
Definition: JHead.hh:139
double gDir
Angle.
Definition: JHead.hh:782
double primaryFlux
Primary flux.
Definition: JHead.hh:825
double radius
Radius [m].
Definition: JHead.hh:640
JAANET::spectrum spectrum
Definition: JHead.hh:1594
bool match(const DAQ &object) const
Test match.
Definition: JHead.hh:1034
void copy(const Head &from, JHead &to)
Copy header from from to to.
Definition: JHead.cc:162
Primary particle.
Definition: JHead.hh:1174
bool match(const JHead &header) const
Test match of headers.
Definition: JHead.hh:1472
static JLANG::JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
Definition: JHead.hh:1639
Muon descriptor file.
Definition: JHead.hh:288
fixedcan()
Default constructor.
Definition: JHead.hh:613
The fixed cylinder used for photon tracking.
Definition: JHead.hh:609
JAANET::end_event end_event
Definition: JHead.hh:1610
const JHead & getHeader() const
Get header.
Definition: JHead.hh:1270
double z
Sea bottom [m].
Definition: JHead.hh:971
std::ostream & write(std::ostream &out) const
Write header to output.
Definition: JHead.cc:91
bool equals(const JFirst_t &first, const JSecond_t &second, const double precision=std::numeric_limits< double >::min())
Check equality.
Definition: JMathToolkit.hh:86
#define IF_MATCH(A, B, C, D)
bool less(const livetime &object) const
Comparison.
Definition: JHead.hh:850
JAANET::can can
Definition: JHead.hh:1595
static bool is_valid(const T &object)
Check validity of given data member in JHead.
Definition: JHead.hh:1334
JHead()
Default constructor.
Definition: JHead.hh:1241
JAANET::cut_primary cut_primary
Definition: JHead.hh:1590
UTC time interval for event generation.
Definition: JHead.hh:1144
end_event()
Default constructor.
Definition: JHead.hh:1217
Phase space of atmospheric muon generation.
Definition: JHead.hh:439
double numberOfSeconds
Time in seconds.
Definition: JHead.hh:1135
std::string time
processing time
Definition: JHead.hh:507
tgen()
Default constructor.
Definition: JHead.hh:1120
End of event record.
Definition: JHead.hh:1213
Phase space of primary particle.
Definition: JHead.hh:429
static const char AANET_TAG_SEPARATOR
Separator for tag extension of multiple tags in Head (&quot;_&lt;counter&gt;&quot;).
Definition: JHead.hh:65
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
JAANET::DAQ DAQ
Definition: JHead.hh:1604
std::vector< JAANET::physics > physics
Definition: JHead.hh:1587
double numberOfSeconds
Live time [s].
Definition: JHead.hh:896
bool match(const primary &object) const
Test match.
Definition: JHead.hh:1199
JAANET::cut_seamuon cut_seamuon
Definition: JHead.hh:1591
Livetime of noise data.
Definition: JHead.hh:1062
Vec coord_origin() const
Get coordinate origin.
Definition: Head.hh:398
friend std::ostream & operator<<(std::ostream &out, const detector &object)
Write detector to output stream.
Definition: JHead.hh:273
double livetime_s
Live time [s].
Definition: JHead.hh:1107
bool match(const String &object) const
Test match.
Definition: JHead.hh:166
Neutrino energy spectrum.
Definition: JHead.hh:536
The bottom of the sea.
Definition: JHead.hh:952
JAANET::target target
Definition: JHead.hh:1586
JAANET::muon_desc_file muon_desc_file
Definition: JHead.hh:1585
K40 & add(const K40 &object)
Addition.
Definition: JHead.hh:1100
String()
Default constructor.
Definition: JHead.hh:156
double zmax
Top [m].
Definition: JHead.hh:599
JAANET::fixedcan fixedcan
Definition: JHead.hh:1596
The cylinder used for photon tracking.
Definition: JHead.hh:575
std::string file_1
File name.
Definition: JHead.hh:942
coord_origin()
Default constructor.
Definition: JHead.hh:736
JAANET::livetime livetime
Definition: JHead.hh:1601