Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JParameters.hh
Go to the documentation of this file.
1 #ifndef __JCALIBRATE_JPARAMETERS__
2 #define __JCALIBRATE_JPARAMETERS__
3 
4 #include <istream>
5 #include <ostream>
6 
7 /**
8  * \author acreusot
9  */
10 
11 
12 namespace JCALIBRATE {}
13 namespace JPP { using namespace JCALIBRATE; }
14 
15 /**
16  * Auxiliary class for PMT parameters including threshold
17  */
18 
19 namespace JCALIBRATE {
20 
21  struct JParameters {
22 
23  friend std::ostream& operator<<(std::ostream& out, const JParameters& par)
24  {
25  out << par.runId << ' ' << par.domId << ' ' << par.pmtId << ' '
26  << par.threshold << ' ' << par.noise << ' ' << par.signal << ' '
27  << par.badChannel;
28  return out;
29  }
30 
31  friend std::istream& operator>>(std::istream& in, JParameters& par)
32  {
33  in >> par.runId >> par.domId >> par.pmtId >> par.threshold
34  >> par.noise >> par.signal >> par.badChannel;
35  return in;
36  }
37 
38  bool operator<(const JParameters& par) const
39  {
40  if (domId < par.domId) {
41  return true;
42  } else if (domId == par.domId) {
43  if (pmtId < par.pmtId) {
44  return true;
45  } else if (pmtId == par.pmtId) {
46  if (threshold < par.threshold) {
47  return true;
48  }
49  }
50  }
51  return false;
52  }
53 
54 
56  runId(0),
57  domId(0),
58  pmtId(0),
59  threshold(0),
60  noise(0),
61  signal(0),
62  badChannel(false)
63  {}
64 
65  JParameters(int runId, int domId, int pmtId, double threshold,
66  double noise, double signal, bool badChannel) :
67  runId(runId),
68  domId(domId),
69  pmtId(pmtId),
70  threshold(threshold),
71  noise(noise),
72  signal(signal),
73  badChannel(badChannel)
74  {}
75 
76  int runId;
77  int domId;
78  int pmtId;
79  double threshold;
80  double noise;
81  double signal;
82  bool badChannel;
83  };
84 
85 }
86 
87 #endif
88 
89 
90 
friend std::istream & operator>>(std::istream &in, JParameters &par)
Definition: JParameters.hh:31
JParameters(int runId, int domId, int pmtId, double threshold, double noise, double signal, bool badChannel)
Definition: JParameters.hh:65
friend std::ostream & operator<<(std::ostream &out, const JParameters &par)
Definition: JParameters.hh:23
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:38
bool operator<(const JParameters &par) const
Definition: JParameters.hh:38