Jpp
JDAQEvaluator.hh
Go to the documentation of this file.
1 #ifndef __JDAQEVALUATOR__
2 #define __JDAQEVALUATOR__
3 
5 #include "JDAQ/JDAQHeader.hh"
6 #include "JDAQ/JDAQEvent.hh"
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();
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() + 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 1e-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
KM3NETDAQ::getDAQValue
static const JDAQEvaluator getDAQValue
Function object for evaluation of DAQ objects.
Definition: JDAQEvaluator.hh:81
KM3NETDAQ::JDAQEvent
DAQ Event.
Definition: JDAQEvent.hh:34
KM3NETDAQ::JDAQEvaluator::JDAQEvaluator
JDAQEvaluator()
Default constructor.
Definition: JDAQEvaluator.hh:22
KM3NETDAQ::JDAQUTCExtended
Data structure for UTC time.
Definition: JDAQUTCExtended.hh:27
KM3NETDAQ::JDAQHeader
DAQ header.
Definition: JDAQHeader.hh:24
KM3NETDAQ::JDAQEvaluator::operator()
double operator()(const JDAQHeader &object) const
Get value of object.
Definition: JDAQEvaluator.hh:44
KM3NETDAQ::JDAQEvaluator::operator()
double operator()(const JDAQEvent &object) const
Get value of event.
Definition: JDAQEvaluator.hh:56
JDAQHeader.hh
KM3NETDAQ::JDAQEvaluator::getWeight
static double getWeight()
Get relative weight for JDAQEvent evaluation.
Definition: JDAQEvaluator.hh:71
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
KM3NETDAQ::JDAQEvaluator::operator()
double operator()(const JDAQUTCExtended &object) const
Get value of object.
Definition: JDAQEvaluator.hh:32
JDAQEvent.hh
JDAQUTCExtended.hh
KM3NETDAQ::JDAQEvaluator
Auxiliary class to determine value of DAQ objects.
Definition: JDAQEvaluator.hh:18