Jpp  19.1.0
the software that should make you happy
JToAshort.hh
Go to the documentation of this file.
1 #ifndef __JDB_JTOASHORT__
2 #define __JDB_JTOASHORT__
3 
4 #include <TROOT.h>
5 #include <TObject.h>
6 #include <cstdint>
7 #include <string>
8 
9 /**
10  * \author mdejong
11  */
12 namespace JDATABASE {}
13 namespace JPP {
14  using namespace JDATABASE;
15 }
16 
17 namespace JDATABASE {
18 
19  struct JToAshort :
20  public TObject
21  {
22  static const char* const getName() { return "toashort"; } //!< Table name
23 
24  std::string DETID; ///< constraint
25  int RUN; ///
26  int RUNNUMBER; ///
27  double UNIXTIMEBASE; ///< [s]
28  int DOMID; ///
29  int EMITTERID; ///< waveform identifier
30  double TOA_S; ///< [s]
31  int QUALITYFACTOR; ///
32  int QUALITYNORMALISATION = 0; ///
33 
34  static constexpr int64_t NANOSECONDS_IN_ONE_SECOND = 1000000000;
35  static constexpr int64_t ONE_TICK_NS = 16;
36 
37  /** return the absolute Time Of Arrival, in nanoseconds
38  * (since Unix epoch 1 January 1970 00:00:00 UTC)
39  */
40  int64_t getAbsoluteToA_ns() const
41  {
42  return llrint((TOA_S + UNIXTIMEBASE) * NANOSECONDS_IN_ONE_SECOND);
43  }
44 
45  /** get the number of nanoseconds (since Unix epoch) of the DAQ Frame start time */
46  int64_t getDAQFrameNanoseconds() const
47  {
48  return llrint(UNIXTIMEBASE * NANOSECONDS_IN_ONE_SECOND);
49  }
50 
51  /** get the number of seconds (since Unix epoch) of the DAQ Frame start time */
52  uint32_t getDAQFrameSeconds() const
53  {
55  }
56 
57  /** get the number of ticks (16 ns) of the DAQ Frame start time */
58  uint32_t getDAQFrameTicks() const
59  {
61  }
62 
64  };
65 
66 
67 } // namespace JDATABASE
68 
69 #endif
Auxiliary classes and methods for database I/O.
Definition: JAHRS.hh:14
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
uint32_t getDAQFrameSeconds() const
get the number of seconds (since Unix epoch) of the DAQ Frame start time
Definition: JToAshort.hh:52
int EMITTERID
waveform identifier
Definition: JToAshort.hh:29
static constexpr int64_t ONE_TICK_NS
Definition: JToAshort.hh:35
uint32_t getDAQFrameTicks() const
get the number of ticks (16 ns) of the DAQ Frame start time
Definition: JToAshort.hh:58
int64_t getDAQFrameNanoseconds() const
get the number of nanoseconds (since Unix epoch) of the DAQ Frame start time
Definition: JToAshort.hh:46
static constexpr int64_t NANOSECONDS_IN_ONE_SECOND
Definition: JToAshort.hh:34
std::string DETID
constraint
Definition: JToAshort.hh:24
static const char *const getName()
Table name.
Definition: JToAshort.hh:22
ClassDef(JToAshort, 1)
int64_t getAbsoluteToA_ns() const
return the absolute Time Of Arrival, in nanoseconds (since Unix epoch 1 January 1970 00:00:00 UTC)
Definition: JToAshort.hh:40
double UNIXTIMEBASE
[s]
Definition: JToAshort.hh:27
Definition: JRoot.hh:19