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