Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDAQHitIO.hh
Go to the documentation of this file.
1 #ifndef __JDAQHIT_IO__
2 #define __JDAQHIT_IO__
3 
5 
6 #include "JIO/JSerialisable.hh"
7 
8 /**
9  * \author mdejong
10  */
11 namespace 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  */
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 output.
JWriter & operator<<(JWriter &out, const JDAQChronometer &chronometer)
Write DAQ chronometer to output.
JTOT_t tot
time over threshold [ns]
Definition: JDAQHit.hh:160
size_t getSizeof< JDAQHit >()
Get size of type.
Definition: JDAQHitIO.hh:19
Hit data structure.
Definition: JDAQHit.hh:34
Interface for binary input.
JReader & operator>>(JReader &in, JDAQChronometer &chronometer)
Read DAQ chronometer from input.
JTDC_t tdc
leading edge [ns]
Definition: JDAQHit.hh:159
JPMT_t pmt
PMT readout channel in FPGA.
Definition: JDAQHit.hh:158
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:38