Jpp  15.0.1-rc.1-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDAQEvaluator.hh
Go to the documentation of this file.
1 #ifndef __JDAQEVALUATOR__
2 #define __JDAQEVALUATOR__
3 
7 
8 
9 /**
10  * \author mdejong
11  */
12 
13 namespace KM3NETDAQ {
14 
15  /**
16  * Auxiliary class to determine value of DAQ objects.
17  */
18  struct JDAQEvaluator {
19  /**
20  * Default constructor.
21  */
23  {}
24 
25 
26  /**
27  * Get value of object.
28  *
29  * \param object UTC time
30  * \return value
31  */
32  inline double operator()(const JDAQUTCExtended& object) const
33  {
34  return object.getTimeNanoSecond() * 1.0e-9;
35  }
36 
37 
38  /**
39  * Get value of object.
40  *
41  * \param object event
42  * \return value
43  */
44  inline double operator()(const JDAQHeader& object) const
45  {
46  return(*this)(object.getTimesliceStart());
47  }
48 
49 
50  /**
51  * Get value of event.
52  *
53  * \param object event
54  * \return value
55  */
56  inline double operator()(const JDAQEvent& object) const
57  {
58  return object.getTimesliceStart().getTimeNanoSecond() * 1.0e-9 + object.getCounter() * getWeight();
59  }
60 
61 
62  /**
63  * Get relative weight for JDAQEvent evaluation.
64  *
65  * This value should be less than the ratio of
66  * the expected maximum number of events in a single data taking run and
67  * the frame duration in units of nano seconds.
68  *
69  * \return weigth [ns]
70  */
71  static double getWeight()
72  {
73  return 1.0e-6; // [ns]
74  }
75  };
76 
77 
78  /**
79  * Function object for evaluation of DAQ objects.
80  */
81  static const JDAQEvaluator getDAQValue;
82 }
83 
84 #endif
double operator()(const JDAQUTCExtended &object) const
Get value of object.
static const JDAQEvaluator getDAQValue
Function object for evaluation of DAQ objects.
JDAQEvaluator()
Default constructor.
Data structure for UTC time.
double operator()(const JDAQEvent &object) const
Get value of event.
Auxiliary class to determine value of DAQ objects.
double operator()(const JDAQHeader &object) const
Get value of object.
static double getWeight()
Get relative weight for JDAQEvent evaluation.