Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
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#include <cmath>
9
10/**
11 * \author mdejong
12 */
13namespace JDATABASE {}
14namespace JPP {
15 using namespace JDATABASE;
16}
17
18namespace JDATABASE {
19
20 struct JToAshort :
21 public TObject
22 {
23 static const char* const getName() { return "toashort"; } //!< Table name
24
25 std::string DETID; ///< constraint
26 int RUN; ///
27 int RUNNUMBER; ///
28 double UNIXTIMEBASE; ///< [s]
29 int DOMID; ///
30 int EMITTERID; ///< waveform identifier
31 double TOA_S; ///< [s]
34
35 static constexpr int64_t NANOSECONDS_IN_ONE_SECOND = 1000000000;
36 static constexpr int64_t ONE_TICK_NS = 16;
37
38 /** return the absolute Time Of Arrival, in nanoseconds
39 * (since Unix epoch 1 January 1970 00:00:00 UTC)
40 */
41 int64_t getAbsoluteToA_ns() const
42 {
43 return llrint((TOA_S + UNIXTIMEBASE) * NANOSECONDS_IN_ONE_SECOND);
44 }
45
46 /** get the number of nanoseconds (since Unix epoch) of the DAQ Frame start time */
47 int64_t getDAQFrameNanoseconds() const
48 {
50 }
51
52 /** get the number of seconds (since Unix epoch) of the DAQ Frame start time */
53 uint32_t getDAQFrameSeconds() const
54 {
56 }
57
58 /** get the number of ticks (16 ns) of the DAQ Frame start time */
63
65 };
66
67
68} // namespace JDATABASE
69
70#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:53
int EMITTERID
waveform identifier
Definition JToAshort.hh:30
static constexpr int64_t ONE_TICK_NS
Definition JToAshort.hh:36
uint32_t getDAQFrameTicks() const
get the number of ticks (16 ns) of the DAQ Frame start time
Definition JToAshort.hh:59
static const char *const getName()
Table name.
Definition JToAshort.hh:23
int64_t getDAQFrameNanoseconds() const
get the number of nanoseconds (since Unix epoch) of the DAQ Frame start time
Definition JToAshort.hh:47
static constexpr int64_t NANOSECONDS_IN_ONE_SECOND
Definition JToAshort.hh:35
std::string DETID
constraint
Definition JToAshort.hh:25
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:41
double UNIXTIMEBASE
[s]
Definition JToAshort.hh:28