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