Jpp  18.6.0-rc.1
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 time of DAQ objects.
17  *
18  * The time is relative to the fixed time defined in JDAQUTCExtended.\n
19  * For DAQ events, the time is offset by the product of the event counter and a constant weight.\n
20  * To correlate DAQ events with summary data, the weight should be set to a value such that
21  * this product is strictly less than half of the frame duration.
22  */
23  struct JDAQEvaluator {
24  /**
25  * Default constructor.
26  */
28  {}
29 
30 
31  /**
32  * Get time of object.
33  *
34  * \param object UTC time
35  * \return time [s]
36  */
37  inline double operator()(const JDAQUTCExtended& object) const
38  {
40  }
41 
42 
43  /**
44  * Get time of object.
45  *
46  * \param object DAQ header
47  * \return time [s]
48  */
49  inline double operator()(const JDAQHeader& object) const
50  {
51  return(*this)(object.getTimesliceStart());
52  }
53 
54 
55  /**
56  * Get time of event.
57  *
58  * \param object event header
59  * \return time [s]
60  */
61  inline double operator()(const JDAQEventHeader& object) const
62  {
63  return getTimeDifference(JDAQUTCExtended::getInstance(), object.getTimesliceStart()) + object.getCounter() * getWeight();
64  }
65 
66 
67  /**
68  * Get relative weight for JDAQEventHeader evaluation.
69  *
70  * This value should be less than half of the frame duration in units of seconds
71  * divided by the expected maximum number of events in a single data taking run.
72  *
73  * \return weigth [s]
74  */
75  static double getWeight()
76  {
77  return 1.0e-7; // [s]
78  }
79  };
80 
81 
82  /**
83  * Function object for evaluation of DAQ objects.
84  */
85  static const JDAQEvaluator getDAQValue;
86 }
87 
88 #endif
double operator()(const JDAQUTCExtended &object) const
Get time of object.
static const JDAQEvaluator getDAQValue
Function object for evaluation of DAQ objects.
double operator()(const JDAQEventHeader &object) const
Get time of event.
JDAQEvaluator()
Default constructor.
Data structure for UTC time.
double getTimeDifference(const JDAQChronometer &first, const JDAQChronometer &second)
Get time difference between two chronometers.
Auxiliary class to determine time of DAQ objects.
double operator()(const JDAQHeader &object) const
Get time of object.
static double getWeight()
Get relative weight for JDAQEventHeader evaluation.
static const JDAQUTCExtended & getInstance()
Get arbitrary offset (e.g.