Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JDAQHitIO.hh
Go to the documentation of this file.
1#ifndef __JDAQHIT_IO__
2#define __JDAQHIT_IO__
3
5
7
8/**
9 * \author mdejong
10 */
11namespace KM3NETDAQ {
12
13 /**
14 * Get size of type.
15 *
16 * \return number of bytes
17 */
18 template<>
19 inline size_t getSizeof<JDAQHit>()
20 {
21 return (sizeof(JDAQHit::pmt) +
22 sizeof(JDAQHit::tdc) +
23 sizeof(JDAQHit::tot));
24 }
25
26
27 /**
28 * Read DAQ hit from input.
29 *
30 * \param in reader
31 * \param hit DAQ hit
32 * \return reader
33 */
34 inline JReader& operator>>(JReader& in, JDAQHit& hit)
35 {
36 in >> hit.pmt;
37 in >> hit.tdc;
38 in >> hit.tot;
39
40 return in;
41 }
42
43
44 /**
45 * Write DAQ hit to output.
46 *
47 * \param out writer
48 * \param hit DAQ hit
49 * \return writer
50 */
51 inline JWriter& operator<<(JWriter& out, const JDAQHit& hit)
52 {
53 out << hit.pmt;
54 out << hit.tdc;
55 out << hit.tot;
56
57 return out;
58 }
59}
60
61#endif
Interface for binary input.
Interface for binary output.
Hit data structure.
Definition JDAQHit.hh:35
JPMT_t pmt
PMT readout channel in FPGA.
Definition JDAQHit.hh:158
JTDC_t tdc
leading edge [ns]
Definition JDAQHit.hh:159
JTOT_t tot
time over threshold [ns]
Definition JDAQHit.hh:160
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
JWriter & operator<<(JWriter &out, const JDAQChronometer &chronometer)
Write DAQ chronometer to output.
size_t getSizeof< JDAQHit >()
Get size of type.
Definition JDAQHitIO.hh:19
JReader & operator>>(JReader &in, JDAQChronometer &chronometer)
Read DAQ chronometer from input.