Jpp  16.0.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/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  }
669 
670  /**
671  * Addition.
672  *
673  * \param object generation volume
674  * \return this generation volume
675  */
676  inline genvol& add(const genvol& object)
677  {
678  numberOfEvents += object.numberOfEvents;
679 
680  return *this;
681  }
682 
683  /**
684  * Scale.
685  *
686  * \param factor 1D scale factor
687  * \param z z position
688  * \return this genvol
689  */
690  inline genvol& mul(const double factor,
691  const double z = 0.0)
692  {
693  zmin = (zmin - z) * factor + z;
694  zmax = (zmax - z) * factor + z;
695  r *= factor;
696  volume *= factor * factor * factor;
697 
698  return *this;
699  }
700 
701  double zmin; ///< Bottom [m]
702  double zmax; ///< Top [m]
703  double r; ///< Radius [m]
704  double volume; ///< Volume [m^3]
705  double numberOfEvents; ///< Number of events
706 
707  ClassDefNV(genvol,1);
708  };
709 
710 
711  /**
712  * Coordinate origin.
713  */
714  struct coord_origin :
715  public Vec
716  {
717  /**
718  * Default constructor.
719  */
721  Vec()
722  {}
723 
724  /**
725  * Constructor.
726  *
727  * \param x x position
728  * \param y y position
729  * \param z z position
730  */
731  coord_origin(const double x,
732  const double y,
733  const double z) :
734  Vec(x,y,z)
735  {}
736 
737  /**
738  * Test match.
739  *
740  * \param object coordinate origin
741  * \return true if matches; else false
742  */
743  inline bool match(const coord_origin& object) const
744  {
745  return (x == object.x &&
746  y == object.y &&
747  z == object.z);
748  }
749 
751  };
752 
753 
754  /**
755  * Phase space for incident neutrino.
756  */
757  struct genhencut {
758  /**
759  * Default constructor.
760  */
762  gDir(0),
763  Emin(0)
764  {}
765 
766  double gDir; ///< Angle
767  double Emin; ///< Minimal energy [GeV]
768 
770  };
771 
772 
773  /**
774  * Normlisation of CORSIKA events.
775  */
776  struct norma {
777  /**
778  * Default constructor.
779  */
780  norma() :
781  primaryFlux(0),
782  numberOfPrimaries(0)
783  {}
784 
785  /**
786  * Test match.
787  *
788  * \param object normalisation
789  * \return true if matches; else false
790  */
791  inline bool match(const norma& object) const
792  {
793  return (primaryFlux == object.primaryFlux);
794  }
795 
796  /**
797  * Addition.
798  *
799  * \param object normalisation
800  * \return this normalisation
801  */
802  inline norma& add(const norma& object)
803  {
804  numberOfPrimaries += object.numberOfPrimaries;
805 
806  return *this;
807  }
808 
809  double primaryFlux; ///< Primary flux
810  double numberOfPrimaries; ///< Number of primaries
811 
812  ClassDefNV(norma,1);
813  };
814 
815 
816  /**
817  * Normalisation of MUPAGE events.
818  */
819  struct livetime {
820  /**
821  * Default constructor.
822  */
824  numberOfSeconds(0),
825  errorOfSeconds(0)
826  {}
827 
828  /**
829  * Comparison.
830  *
831  * \param object livetime
832  * \return true if this livetime is less than given livetime; else false
833  */
834  inline bool less(const livetime& object) const
835  {
836  return numberOfSeconds < object.numberOfSeconds;
837  }
838 
839  /**
840  * Test match.
841  *
842  * \param object live time
843  * \return true if matches; else false
844  */
845  inline bool match(const livetime& object) const
846  {
847  return ((numberOfSeconds == 0.0 && object.numberOfSeconds == 0.0) ||
848  (numberOfSeconds > 0.0 && object.numberOfSeconds > 0.0));
849  }
850 
851  /**
852  * Addition.
853  *
854  * \param object live time
855  * \return this live time
856  */
857  inline livetime& add(const livetime& object)
858  {
859  numberOfSeconds += object.numberOfSeconds;
860  errorOfSeconds = sqrt(errorOfSeconds * errorOfSeconds +
861  object.errorOfSeconds * object.errorOfSeconds);
862 
863  return *this;
864  }
865 
866  /**
867  * Scale.
868  *
869  * \param factor 1D scale factor
870  * \return this livetime
871  */
872  inline livetime& mul(const double factor)
873  {
874  numberOfSeconds /= (factor * factor);
875  errorOfSeconds /= (factor * factor);
876 
877  return *this;
878  }
879 
880  double numberOfSeconds; ///< Live time [s]
881  double errorOfSeconds; ///< Uncertainty on live time [s]
882 
883  ClassDefNV(livetime,1);
884  };
885 
886 
887  /**
888  * Neutrino flux.
889  */
890  struct flux {
891  public:
892  /**
893  * Default constructor.
894  */
895  flux() :
896  type(0),
897  key(),
898  file_1(),
899  file_2()
900  {}
901 
902  /**
903  * Comparison.
904  *
905  * \param object flux
906  * \return true if this flux is less than given flux; else false
907  */
908  inline bool less(const flux& object) const
909  {
910  return type < object.type;
911  }
912 
913  /**
914  * Test match.
915  *
916  * \param object flux
917  * \return true if matches; else false
918  */
919  inline bool match(const flux& object) const
920  {
921  return type == object.type;
922  }
923 
924  int type; ///< Type
925  std::string key; ///< Key
926  std::string file_1; ///< File name
927  std::string file_2; ///< File name
928 
929  ClassDefNV(flux,1);
930  };
931 
932 
933  /**
934  * The bottom of the sea.
935  */
936  struct seabottom {
937  /**
938  * Default constructor.
939  */
941  z(0)
942  {}
943 
944  /**
945  * Test match.
946  *
947  * \param object sea bottom
948  * \return true if matches; else false
949  */
950  inline bool match(const seabottom& object) const
951  {
952  return (z == object.z);
953  }
954 
955  double z; ///< Sea bottom [m]
956 
958  };
959 
960 
961  /**
962  * Depth.
963  */
964  struct depth {
965  /**
966  * Default constructor.
967  */
968  depth() :
969  z(0)
970  {}
971 
972  /**
973  * Test match.
974  *
975  * \param object sea bottom
976  * \return true if matches; else false
977  */
978  inline bool match(const depth& object) const
979  {
980  return (z == object.z);
981  }
982 
983  double z; ///< Sea bottom [m]
984 
985  ClassDefNV(depth,1);
986  };
987 
988 
989  /**
990  * Livetime of DAQ data.
991  */
992  struct DAQ {
993  public:
994  /**
995  * Default constructor.
996  */
997  DAQ() :
998  livetime_s(0.0)
999  {}
1000 
1001  /**
1002  * Comparison.
1003  *
1004  * \param object DAQ
1005  * \return true if this DAQ is less than given DAQ; else false
1006  */
1007  inline bool less(const DAQ& object) const
1008  {
1009  return livetime_s < object.livetime_s;
1010  }
1011 
1012  /**
1013  * Test match.
1014  *
1015  * \param object DAQ
1016  * \return true if matches; else false
1017  */
1018  inline bool match(const DAQ& object) const
1019  {
1020  return ((livetime_s == 0.0 && object.livetime_s == 0.0) ||
1021  (livetime_s > 0.0 && object.livetime_s > 0.0));
1022  }
1023 
1024  /**
1025  * Addition.
1026  *
1027  * \param object DAQ
1028  * \return this DAQ
1029  */
1030  inline DAQ& add(const DAQ& object)
1031  {
1032  livetime_s += object.livetime_s;
1033 
1034  return *this;
1035  }
1036 
1037  double livetime_s; ///< Live time [s]
1038 
1039  ClassDefNV(DAQ,1);
1040  };
1041 
1042 
1043  /**
1044  * Time duration of event generation.
1045  */
1046  struct tgen {
1047  /**
1048  * Default constructor.
1049  */
1050  tgen() :
1051  numberOfSeconds(0)
1052  {}
1053 
1054  /**
1055  * Test match.
1056  *
1057  * \param object time duration
1058  * \return true if matches; else false
1059  */
1060  inline bool match(const tgen& object) const
1061  {
1062  return this->numberOfSeconds == object.numberOfSeconds;
1063  }
1064 
1065  double numberOfSeconds; ///< Time in seconds
1066 
1067  ClassDefNV(tgen,1);
1068  };
1069 
1070 
1071  /**
1072  * UTC time interval for event generation.
1073  */
1074  struct time_interval {
1075  /**
1076  * Default constructor.
1077  */
1079  t1(0),
1080  t2(0)
1081  {}
1082 
1083  /**
1084  * Test match.
1085  *
1086  * \param object time interval
1087  * \return true if matches; else false
1088  */
1089  inline bool match(const time_interval& object) const
1090  {
1091  return (this->t1 == object.t1 && this->t2 == object.t2);
1092  }
1093 
1094  double t1; ///< Start time in seconds
1095  double t2; ///< Stop time in seconds
1096 
1098  };
1099 
1100 
1101  /**
1102  * Primary particle.
1103  */
1104  struct primary {
1105  /**
1106  * Default constructor.
1107  */
1108  primary() :
1109  type(0)
1110  {}
1111 
1112  /**
1113  * Comparison.
1114  *
1115  * \param object primary particle
1116  * \return true if this primary particle is less than given primary particle; else false
1117  */
1118  inline bool less(const primary& object) const
1119  {
1120  return type < object.type;
1121  }
1122 
1123  /**
1124  * Test match.
1125  *
1126  * \param object primary particle
1127  * \return true if matches; else false
1128  */
1129  inline bool match(const primary& object) const
1130  {
1131  return (type == object.type);
1132  }
1133 
1134  int type; ///< Particle type
1135 
1136  ClassDefNV(primary,1);
1137  };
1138 
1139 
1140  /**
1141  * End of event record.
1142  */
1143  struct end_event {
1144  /**
1145  * Default constructor.
1146  */
1148  {}
1149 
1150  ClassDefNV(end_event,1);
1151  };
1152 
1153 
1154  /**
1155  * Monte Carlo run header.
1156  *
1157  * This class extends the Head class so that the data from specific tags
1158  * can be promoted to concrete data types.
1159  *
1160  * Note that for the copy of new JHead data (e.g.\ data not obtained via a previous JAANET::copy) to become effective,
1161  * the key words in the corresponding map of the Head class should be set. \n
1162  * To this end, member method JHead::push can be used.
1163  */
1164  struct JHead :
1165  public Head
1166  {
1167  /**
1168  * Default constructor.
1169  */
1171  {}
1172 
1173 
1174  /**
1175  * Copy constructor.
1176  *
1177  * \param header header
1178  */
1179  JHead(const Head& header)
1180  {
1181  copy(header, *this);
1182  }
1183 
1184 
1185  /**
1186  * Virtual destructor.
1187  */
1188  virtual ~JHead()
1189  {}
1190 
1191 
1192  /**
1193  * Get header.
1194  *
1195  * \return header
1196  */
1197  const JHead& getHeader() const
1198  {
1199  return static_cast<const JHead&>(*this);
1200  }
1201 
1202 
1203  /**
1204  * Get header.
1205  *
1206  * \return header
1207  */
1209  {
1210  return static_cast<JHead&>(*this);
1211  }
1212 
1213 
1214  /**
1215  * Set header.
1216  *
1217  * \param header header
1218  */
1219  void setHeader(const JHead& header)
1220  {
1221  static_cast<JHead&>(*this) = header;
1222  }
1223 
1224 
1225  /**
1226  * Check validity of given data member in JHead.
1227  *
1228  * The validity is defined by the presence of the name of the data member in the underlying map.
1229  *
1230  * \param pd pointer to data member
1231  * \return true if valid; else false
1232  */
1233  template<class T>
1234  inline bool is_valid(T JHead::*pd) const
1235  {
1236  return (this->pull(pd) != this->end());
1237  }
1238 
1239 
1240  /**
1241  * Check validity of given data member in JHead.
1242  *
1243  * The validity is defined by difference between actual and default value.
1244  *
1245  * \param object object
1246  * \return true if valid; else false
1247  */
1248  template<class T>
1249  static bool is_valid(const T& object)
1250  {
1251  static const T value;
1252 
1253  return (object.less(value) || value.less(object));
1254  }
1255 
1256 
1257  /**
1258  * Pull given data member from Head.
1259  *
1260  * \param pd pointer to data member
1261  * \return iterator of Head
1262  */
1263  template<class T>
1264  inline const_iterator pull(T JHead::*pd) const
1265  {
1266  return this->find(JROOT::getDataMember(pd)->GetName());
1267  }
1268 
1269 
1270  /**
1271  * Pull given data member from Head.
1272  *
1273  * \param pd pointer to data member
1274  * \return iterator of Head
1275  */
1276  template<class T>
1277  inline iterator pull(T JHead::*pd)
1278  {
1279  return this->find(JROOT::getDataMember(pd)->GetName());
1280  }
1281 
1282 
1283  /**
1284  * Push given data member to Head.
1285  *
1286  * \param pd pointer to data member
1287  */
1288  template<class T>
1289  inline void push(T JHead::*pd)
1290  {
1291  (*this)[JROOT::getDataMember(pd)->GetName()] = "";
1292  }
1293 
1294 
1295  /**
1296  * Remove given data member from Head.
1297  *
1298  * \param pd pointer to data member
1299  */
1300  template<class T>
1301  inline void erase(T JHead::*pd)
1302  {
1303  iterator p = this->pull(pd);
1304 
1305  if (p != this->end()) {
1306 
1307  this->*pd = T();
1308 
1309  static_cast<Head*>(this)->erase(p);
1310  }
1311  }
1312 
1313 
1314  /**
1315  * Get number of matching fields.
1316  *
1317  * \param header second header
1318  * \return number of matching header fields
1319  */
1320  inline int getNumberOfMatches(const JHead& header) const
1321  {
1322  return ((int) match(*this, header, &JHead::cut_primary) +
1323  (int) match(*this, header, &JHead::cut_seamuon) +
1324  (int) match(*this, header, &JHead::cut_in) +
1325  (int) match(*this, header, &JHead::cut_nu) +
1326  (int) match(*this, header, &JHead::simul) +
1327  (int) match(*this, header, &JHead::spectrum) +
1328  (int) match(*this, header, &JHead::can) +
1329  (int) match(*this, header, &JHead::fixedcan) +
1330  (int) match(*this, header, &JHead::genvol) +
1331  (int) match(*this, header, &JHead::coord_origin) +
1332  (int) match(*this, header, &JHead::norma) +
1333  (int) match(*this, header, &JHead::livetime) +
1334  (int) match(*this, header, &JHead::seabottom) +
1335  (int) match(*this, header, &JHead::depth) +
1336  (int) match(*this, header, &JHead::tgen) +
1337  (int) match(*this, header, &JHead::time_interval) +
1338  (int) match(*this, header, &JHead::primary) +
1339  (int) match(*this, header, &JHead::flux) +
1340  (int) match(*this, header, &JHead::DAQ));
1341  }
1342 
1343 
1344  /**
1345  * Test match of headers.
1346  *
1347  * \param header second header
1348  * \return true if all header fields match; else false
1349  */
1350  inline bool match(const JHead& header) const
1351  {
1352  return getNumberOfMatches(header) == getMaximumNumberOfMatches();
1353  }
1354 
1355 
1356  /**
1357  * Comparison of headers.
1358  *
1359  * \param header header
1360  * \return true if this header less than given header; else false
1361  */
1362  inline bool less(const JHead& header) const
1363  {
1364 #define RETURN_IF_DIFFERENT(A, B) \
1365  if (less(A,B)) { return true; } \
1366  if (less(B,A)) { return false; }
1367 
1368  // compare physics
1369 
1370  RETURN_IF_DIFFERENT(this->physics, header.physics);
1371 
1372  // compare simulation
1373 
1374  RETURN_IF_DIFFERENT(this->simul, header.simul);
1375 
1376  // compare generation data
1377 
1378  RETURN_IF_DIFFERENT(this->primary, header.primary);
1379  RETURN_IF_DIFFERENT(this->flux, header.flux);
1380  RETURN_IF_DIFFERENT(this->spectrum, header.spectrum);
1383  RETURN_IF_DIFFERENT(this->cut_in, header.cut_in);
1384  RETURN_IF_DIFFERENT(this->cut_nu, header.cut_nu);
1385  RETURN_IF_DIFFERENT(this->genvol, header.genvol);
1386 
1387  // compare compatibility
1388 
1389  if (is_valid(this->livetime) == is_valid(header.livetime) &&
1390  is_valid(this->DAQ) == is_valid(header.DAQ)) {
1391  return false;
1392  }
1393 
1394  THROW(JException, "JHead::less() headers do not compare.");
1395 
1396 #undef RETURN_IF_DIFFERENT
1397  }
1398 
1399 
1400  /**
1401  * Addition of headers.
1402  *
1403  * \param header header
1404  * \return this header
1405  */
1406  inline JHead& add(const JHead& header)
1407  {
1408  if (match(header)) {
1409 
1410  genvol .add(header.genvol);
1411  norma .add(header.norma);
1412  livetime.add(header.livetime);
1413  DAQ .add(header.DAQ);
1414 
1415  } else {
1416 
1417  THROW(JException, "JHead::add() headers do not match.");
1418  }
1419 
1420  return *this;
1421  }
1422 
1423 
1424  /**
1425  * Equal operator.
1426  *
1427  * Note that this operator uses the JHead::match method.
1428  *
1429  * \param first first header
1430  * \param second second header
1431  * \return true if two headers are equal; else false
1432  */
1433  friend inline bool operator==(const JHead& first,
1434  const JHead& second)
1435  {
1436  return first.match(second);
1437  }
1438 
1439 
1440  /**
1441  * Less than operator.
1442  *
1443  * \param first first header
1444  * \param second second header
1445  * \return true if first header is less than second header; else false
1446  */
1447  friend inline bool operator<(const JHead& first,
1448  const JHead& second)
1449  {
1450  return first.less(second);
1451  }
1452 
1453 
1454  JAANET::start_run start_run; // first data member
1481  JAANET::end_event end_event; // last data member
1482 
1483 
1484  /**
1485  * Get maximum number of matching header fields.
1486  *
1487  * \return maximum number of matching header fields
1488  */
1489  static inline const int getMaximumNumberOfMatches()
1490  {
1491  static const JHead header;
1492  static const int value = header.getNumberOfMatches(header);
1493 
1494  return value;
1495  }
1496 
1497 
1498  /**
1499  * Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
1500  * <pre>
1501  * <key>: <value> [<value>]*
1502  * <key>: <value> [<value>]*
1503  * </pre>
1504  *
1505  * \return equation parameters
1506  */
1508  {
1509  static JLANG::JEquationParameters parameters(":", "\n", "", "");
1510 
1511  return parameters;
1512  }
1513 
1514 
1515  /**
1516  * Set equation parameters.
1517  *
1518  * \param equation equation parameters
1519  */
1520  static inline void setEquationParameters(const JLANG::JEquationParameters& equation)
1521  {
1522  getEquationParameters() = equation;
1523  }
1524 
1525 
1526  /**
1527  * Read header from input.
1528  *
1529  * \param in input stream
1530  * \return input stream
1531  */
1532  std::istream& read(std::istream& in);
1533 
1534 
1535  /**
1536  * Write header to output.
1537  *
1538  * \param out output stream
1539  * \return output stream
1540  */
1541  std::ostream& write(std::ostream& out) const;
1542 
1543 
1544  /**
1545  * Print header to output.
1546  *
1547  * \param out output stream
1548  * \return output stream
1549  */
1550  std::ostream& print(std::ostream& out) const;
1551 
1552 
1553  ClassDef(JHead,3);
1554 
1555  private:
1556  /**
1557  * Comparison.
1558  *
1559  * \param first first object
1560  * \param second second object
1561  * \return true if first less than second; else false
1562  */
1563  template<class T>
1564  static inline bool less(const T& first,
1565  const T& second)
1566  {
1567  return first.less(second);
1568  }
1569 
1570 
1571  /**
1572  * Test match.
1573  *
1574  * \param first first object
1575  * \param second second object
1576  * \return true if matches; else false
1577  */
1578  template<class T>
1579  static inline bool match(const T& first,
1580  const T& second)
1581  {
1582  return first.match(second);
1583  }
1584 
1585 
1586  /**
1587  * Comparison of containers.
1588  * It is assumed that the containers are ordered in the same way.
1589  *
1590  * \param first first object
1591  * \param second second object
1592  * \return true if first is less than second; else false
1593  */
1594  template<class T>
1595  static inline bool less(const std::vector<T>& first,
1596  const std::vector<T>& second)
1597  {
1598  if (first.size() == second.size()) {
1599 
1600  for (size_t i = 0; i != first.size(); ++i) {
1601  if (less(first[i], second[i])) {
1602  return true;
1603  }
1604  }
1605 
1606  return false;
1607 
1608  } else {
1609 
1610  return first.size() < second.size();
1611  }
1612  }
1613 
1614 
1615  /**
1616  * Test is containers match.
1617  * It is assumed that the containers are ordered in the same way.
1618  *
1619  * \param first first object
1620  * \param second second object
1621  * \return true if matches; else false
1622  */
1623  template<class T>
1624  static inline bool match(const std::vector<T>& first,
1625  const std::vector<T>& second)
1626  {
1627  for (size_t i = 0; i != first.size() && i != second.size(); ++i) {
1628  if (!match(first[i], second[i])) {
1629  return false;
1630  }
1631  }
1632 
1633  return first.size() == second.size();
1634  }
1635 
1636 
1637  /**
1638  * Test match of given data member of headers.
1639  *
1640  * \param first first header
1641  * \param second second header
1642  * \param pd pointer to data member
1643  * \return true if matches; else false
1644  */
1645  template<class T>
1646  static inline bool match(const JHead& first,
1647  const JHead& second,
1648  T JHead::*pd)
1649  {
1650  return match(first.*pd, second.*pd);
1651  }
1652  };
1653 
1654 
1655  /**
1656  * Equal operator.
1657  *
1658  * Note that this operator uses the JHead::match method.
1659  *
1660  * \param first first header
1661  * \param second second header
1662  * \return true if two headers are equal; else false
1663  */
1664  inline bool operator==(const Head& first,
1665  const Head& second)
1666  {
1667  return JHead(first).match(JHead(second));
1668  }
1669 
1670 
1671  /**
1672  * Less than operator.
1673  *
1674  * \param first first header
1675  * \param second second header
1676  * \return true if first header is less than second header; else false
1677  */
1678  inline bool operator<(const Head& first,
1679  const Head& second)
1680  {
1681  return JHead(first).less(JHead(second));
1682  }
1683 }
1684 
1685 
1686 /**
1687  * Read header from input.
1688  *
1689  * \param in input stream
1690  * \param header header
1691  * \return input stream
1692  */
1693 inline std::istream& operator>>(std::istream& in, JAANET::JHead& header)
1694 {
1695  return header.read(in);
1696 }
1697 
1698 
1699 /**
1700  * Write header to output.
1701  *
1702  * \param out output stream
1703  * \param header header
1704  * \return output stream
1705  */
1706 inline std::ostream& operator<<(std::ostream& out, const JAANET::JHead& header)
1707 {
1708  return header.write(out);
1709 }
1710 #endif
norma & add(const norma &object)
Addition.
Definition: JHead.hh:802
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:1475
JAANET::genhencut genhencut
Definition: JHead.hh:1471
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:1249
livetime & mul(const double factor)
Scale.
Definition: JHead.hh:872
JAANET::genvol genvol
Definition: JHead.hh:1469
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:703
JAANET::norma norma
Definition: JHead.hh:1472
std::vector< JAANET::flux > flux
Definition: JHead.hh:1480
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:690
double volume
Volume [m^3].
Definition: JHead.hh:704
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:992
double t1
Start time in seconds.
Definition: JHead.hh:1094
bool match(const tgen &object) const
Test match.
Definition: JHead.hh:1060
seabottom()
Default constructor.
Definition: JHead.hh:940
livetime & add(const livetime &object)
Addition.
Definition: JHead.hh:857
friend bool operator<(const JHead &first, const JHead &second)
Less than operator.
Definition: JHead.hh:1447
Depth.
Definition: JHead.hh:964
bool less(const DAQ &object) const
Comparison.
Definition: JHead.hh:1007
void setHeader(const JHead &header)
Set header.
Definition: JHead.hh:1219
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:1197
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:1678
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:757
JAANET::drawing drawing
Definition: JHead.hh:1456
double numberOfEvents
Number of events.
Definition: JHead.hh:705
bool less(const generator &object) const
Comparison.
Definition: JHead.hh:471
static bool less(const T &first, const T &second)
Comparison.
Definition: JHead.hh:1564
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:968
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:1095
livetime()
Default constructor.
Definition: JHead.hh:823
double zmax
Top [m].
Definition: JHead.hh:624
Normlisation of CORSIKA events.
Definition: JHead.hh:776
JAANET::cut_primary cut_primary
Definition: JHead.hh:1462
double errorOfSeconds
Uncertainty on live time [s].
Definition: JHead.hh:881
*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:1460
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:1520
bool match(const time_interval &object) const
Test match.
Definition: JHead.hh:1089
bool match(const JHead &header) const
Test match of headers.
Definition: JHead.hh:1350
data_type r[M+1]
Definition: JPolint.hh:758
std::vector< JAANET::simul > simul
Definition: JHead.hh:1461
double livetime_s
Live time [s].
Definition: JHead.hh:1037
JHead & add(const JHead &header)
Addition of headers.
Definition: JHead.hh:1406
genhencut()
Default constructor.
Definition: JHead.hh:761
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:1030
bool match(const can &object) const
Test match.
Definition: JHead.hh:576
Coordinate origin.
Definition: JHead.hh:714
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:676
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:1481
bool less(const JHead &header) const
Comparison of headers.
Definition: JHead.hh:1362
double zmax
Top [m].
Definition: JHead.hh:702
JAANET::fixedcan fixedcan
Definition: JHead.hh:1468
JAANET::can can
Definition: JHead.hh:1467
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:1289
Type definition of range.
Definition: JHead.hh:39
int type
Particle type.
Definition: JHead.hh:1134
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:1463
generator()
Default constructor.
Definition: JHead.hh:458
double numberOfPrimaries
Number of primaries.
Definition: JHead.hh:810
JAANET::livetime livetime
Definition: JHead.hh:1473
static JLANG::JEquationParameters & getEquationParameters()
Get equation parameters corresponding to Monte Carlo ASCII format, i.e:
Definition: JHead.hh:1507
JHead()
Default constructor.
Definition: JHead.hh:1170
flux()
Default constructor.
Definition: JHead.hh:895
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:1118
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:1301
JAANET::seabottom seabottom
Definition: JHead.hh:1474
bool less(const flux &object) const
Comparison.
Definition: JHead.hh:908
cut()
Default constructor.
Definition: JHead.hh:330
Neutrino flux.
Definition: JHead.hh:890
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:1454
bool match(const depth &object) const
Test match.
Definition: JHead.hh:978
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:1433
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:1046
JAANET::spectrum spectrum
Definition: JHead.hh:1466
std::string file_2
File name.
Definition: JHead.hh:927
bool match(const norma &object) const
Test match.
Definition: JHead.hh:791
time_interval()
Default constructor.
Definition: JHead.hh:1078
std::string key
Key.
Definition: JHead.hh:925
bool match(const flux &object) const
Test match.
Definition: JHead.hh:919
int type
Type.
Definition: JHead.hh:924
DAQ()
Default constructor.
Definition: JHead.hh:997
bool is_integer(const std::string &buffer)
Check if string is an integer.
Definition: JLangToolkit.hh:58
JAANET::primary primary
Definition: JHead.hh:1479
double z
Sea bottom [m].
Definition: JHead.hh:983
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:845
double zmin
Bottom [m].
Definition: JHead.hh:701
Monte Carlo run header.
Definition: JHead.hh:1164
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:767
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:1478
static bool match(const std::vector< T > &first, const std::vector< T > &second)
Test is containers match.
Definition: JHead.hh:1624
JAANET::muon_desc_file muon_desc_file
Definition: JHead.hh:1458
#define ClassDef(name, version)
Definition: JRoot.hh:32
norma()
Default constructor.
Definition: JHead.hh:780
virtual ~JHead()
Virtual destructor.
Definition: JHead.hh:1188
std::string program
Definition: JHead.hh:276
bool match(const coord_origin &object) const
Test match.
Definition: JHead.hh:743
double r
Radius [m].
Definition: JHead.hh:585
coord_origin(const double x, const double y, const double z)
Constructor.
Definition: JHead.hh:731
bool match(const genvol &object) const
Test match.
Definition: JHead.hh:663
std::vector< JAANET::detector > detector
Definition: JHead.hh:1457
Normalisation of MUPAGE events.
Definition: JHead.hh:819
static bool match(const JHead &first, const JHead &second, T JHead::*pd)
Test match of given data member of headers.
Definition: JHead.hh:1646
bool less(const genvol &object) const
Comparison.
Definition: JHead.hh:652
bool match(const seabottom &object) const
Test match.
Definition: JHead.hh:950
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:1277
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:154
primary()
Default constructor.
Definition: JHead.hh:1108
JAANET::tgen tgen
Definition: JHead.hh:1477
JAANET::cut_in cut_in
Definition: JHead.hh:1464
JHead & getHeader()
Get header.
Definition: JHead.hh:1208
static bool less(const std::vector< T > &first, const std::vector< T > &second)
Comparison of containers.
Definition: JHead.hh:1595
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
static const int getMaximumNumberOfMatches()
Get maximum number of matching header fields.
Definition: JHead.hh:1489
double gDir
Angle.
Definition: JHead.hh:766
double primaryFlux
Primary flux.
Definition: JHead.hh:809
double radius
Radius [m].
Definition: JHead.hh:625
bool match(const DAQ &object) const
Test match.
Definition: JHead.hh:1018
JAANET::target target
Definition: JHead.hh:1459
void copy(const Head &from, JHead &to)
Copy header from from to to.
Definition: JHead.cc:139
Primary particle.
Definition: JHead.hh:1104
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:1579
double z
Sea bottom [m].
Definition: JHead.hh:955
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:1465
bool less(const livetime &object) const
Comparison.
Definition: JHead.hh:834
UTC time interval for event generation.
Definition: JHead.hh:1074
end_event()
Default constructor.
Definition: JHead.hh:1147
Phase space of atmospheric muon generation.
Definition: JHead.hh:424
double numberOfSeconds
Time in seconds.
Definition: JHead.hh:1065
std::string time
processing time
Definition: JHead.hh:492
tgen()
Default constructor.
Definition: JHead.hh:1050
End of event record.
Definition: JHead.hh:1143
Phase space of primary particle.
Definition: JHead.hh:414
JAANET::coord_origin coord_origin
Definition: JHead.hh:1470
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:1234
JAANET::XSecFile XSecFile
Definition: JHead.hh:1455
JAANET::DAQ DAQ
Definition: JHead.hh:1476
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
double numberOfSeconds
Live time [s].
Definition: JHead.hh:880
bool match(const primary &object) const
Test match.
Definition: JHead.hh:1129
Vec coord_origin() const
Get coordinate origin.
Definition: Head.hh:393
JHead(const Head &header)
Copy constructor.
Definition: JHead.hh:1179
version
Definition: JCalibratePMT.sh:7
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:936
int getNumberOfMatches(const JHead &header) const
Get number of matching fields.
Definition: JHead.hh:1320
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:1264
The cylinder used for photon tracking.
Definition: JHead.hh:560
std::string file_1
File name.
Definition: JHead.hh:926
coord_origin()
Default constructor.
Definition: JHead.hh:720