Jpp  17.0.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
KM3NETDAQ::JDAQHit Class Reference

Hit data structure. More...

#include <JDAQHit.hh>

Inheritance diagram for KM3NETDAQ::JDAQHit:
KM3NETDAQ::JDAQKeyHit KM3NETDAQ::JDAQTriggeredHit

Public Types

typedef unsigned char JPMT_t
 PMT channel in FPGA. More...
 
typedef unsigned int JTDC_t
 leading edge [ns] More...
 
typedef unsigned char JTOT_t
 time over threshold [ns] More...
 

Public Member Functions

 JDAQHit ()
 Default constructor. More...
 
 JDAQHit (const JPMT_t pmt_id, const JTDC_t tdc_ns, const JTOT_t tot_ns)
 Constructor. More...
 
JPMT_t getPMT () const
 Get PMT. More...
 
JTDC_t getT () const
 Get time. More...
 
JTOT_t getToT () const
 Get time-over-threshold. More...
 
 ClassDefNV (JDAQHit, 1)
 

Static Public Member Functions

static JTOT_t getMaximalToT ()
 Get maximal time-over-threshold. More...
 

Protected Attributes

JPMT_t pmt
 PMT readout channel in FPGA. More...
 
JTDC_t tdc
 leading edge [ns] More...
 
JTOT_t tot
 time over threshold [ns] More...
 

Friends

size_t getSizeof ()
 Definition of method to get size of data type. More...
 
JReaderoperator>> (JReader &, JDAQHit &)
 Read DAQ hit from input. More...
 
JWriteroperator<< (JWriter &, const JDAQHit &)
 Write DAQ hit to output. More...
 
std::istream & operator>> (std::istream &in, JDAQHit &hit)
 Read DAQ hit from input. More...
 
std::ostream & operator<< (std::ostream &out, const JDAQHit &hit)
 Write DAQ hit to output. More...
 

Detailed Description

Hit data structure.

N.B. The size of this data structure (i.e. the value obtained with the sizeof() operator should exactly match the preset number of bytes from the DAQ system. The pragma statement is necessary to ensure the correct size of this object. Furthermore, this data structure should have no virtual methods and no virtual destructor. Consequently, the standard ROOT CLassDef() macro is replaced by the designated ClassDefNV() macro.

Definition at line 34 of file JDAQHit.hh.

Member Typedef Documentation

typedef unsigned char KM3NETDAQ::JDAQHit::JPMT_t

PMT channel in FPGA.

Definition at line 38 of file JDAQHit.hh.

typedef unsigned int KM3NETDAQ::JDAQHit::JTDC_t

leading edge [ns]

Definition at line 39 of file JDAQHit.hh.

typedef unsigned char KM3NETDAQ::JDAQHit::JTOT_t

time over threshold [ns]

Definition at line 40 of file JDAQHit.hh.

Constructor & Destructor Documentation

KM3NETDAQ::JDAQHit::JDAQHit ( )
inline

Default constructor.

Definition at line 49 of file JDAQHit.hh.

50  {}
KM3NETDAQ::JDAQHit::JDAQHit ( const JPMT_t  pmt_id,
const JTDC_t  tdc_ns,
const JTOT_t  tot_ns 
)
inline

Constructor.

Parameters
pmt_idPMT channel
tdc_nstime of hit [ns]
tot_nstime over threshold [ns]

Definition at line 60 of file JDAQHit.hh.

62  :
63  pmt(pmt_id),
64  tdc(htonl(tdc_ns)),
65  //tdc(tdc_ns),
66  tot(tot_ns)
67  {}
JTOT_t tot
time over threshold [ns]
Definition: JDAQHit.hh:160
JTDC_t tdc
leading edge [ns]
Definition: JDAQHit.hh:159
JPMT_t pmt
PMT readout channel in FPGA.
Definition: JDAQHit.hh:158

Member Function Documentation

JPMT_t KM3NETDAQ::JDAQHit::getPMT ( ) const
inline

Get PMT.

Returns
PMT

Definition at line 75 of file JDAQHit.hh.

76  {
77  return pmt;
78  }
JPMT_t pmt
PMT readout channel in FPGA.
Definition: JDAQHit.hh:158
JTDC_t KM3NETDAQ::JDAQHit::getT ( ) const
inline

Get time.

Returns
time [ns]

Definition at line 86 of file JDAQHit.hh.

87  {
88  return ntohl(tdc);
89  }
JTDC_t tdc
leading edge [ns]
Definition: JDAQHit.hh:159
JTOT_t KM3NETDAQ::JDAQHit::getToT ( ) const
inline

Get time-over-threshold.

Returns
time-over-threshold [ns]

Definition at line 97 of file JDAQHit.hh.

98  {
99  return tot;
100  }
JTOT_t tot
time over threshold [ns]
Definition: JDAQHit.hh:160
static JTOT_t KM3NETDAQ::JDAQHit::getMaximalToT ( )
inlinestatic

Get maximal time-over-threshold.

Returns
time-over-threshold [ns]

Definition at line 108 of file JDAQHit.hh.

109  {
110  return 0xFF;
111  }
KM3NETDAQ::JDAQHit::ClassDefNV ( JDAQHit  ,
 
)

Friends And Related Function Documentation

size_t getSizeof ( )
friend

Definition of method to get size of data type.

This method should be specialised for each desired data type with fixed length.

Returns
number of bytes
JReader& operator>> ( JReader in,
JDAQHit hit 
)
friend

Read DAQ hit from input.

Parameters
inreader
hitDAQ hit
Returns
reader

Definition at line 34 of file JDAQHitIO.hh.

35  {
36  in >> hit.pmt;
37  in >> hit.tdc;
38  in >> hit.tot;
39 
40  return in;
41  }
JTOT_t tot
time over threshold [ns]
Definition: JDAQHit.hh:160
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
JWriter& operator<< ( JWriter out,
const JDAQHit hit 
)
friend

Write DAQ hit to output.

Parameters
outwriter
hitDAQ hit
Returns
writer

Definition at line 51 of file JDAQHitIO.hh.

52  {
53  out << hit.pmt;
54  out << hit.tdc;
55  out << hit.tot;
56 
57  return out;
58  }
JTOT_t tot
time over threshold [ns]
Definition: JDAQHit.hh:160
JTDC_t tdc
leading edge [ns]
Definition: JDAQHit.hh:159
JPMT_t pmt
PMT readout channel in FPGA.
Definition: JDAQHit.hh:158
std::istream& operator>> ( std::istream &  in,
JDAQHit hit 
)
friend

Read DAQ hit from input.

Parameters
ininput stream
hithit
Returns
input stream

Definition at line 121 of file JDAQHit.hh.

122  {
123  int pmt;
124  int tdc;
125  int tot;
126 
127  if (in >> pmt >> tdc >> tot) {
128  hit = JDAQHit(pmt, tdc, tot);
129  }
130 
131  return in;
132  }
JDAQHit()
Default constructor.
Definition: JDAQHit.hh:49
JTOT_t tot
time over threshold [ns]
Definition: JDAQHit.hh:160
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
std::ostream& operator<< ( std::ostream &  out,
const JDAQHit hit 
)
friend

Write DAQ hit to output.

Parameters
outoutput stream
hithit
Returns
output stream

Definition at line 142 of file JDAQHit.hh.

143  {
144  using namespace std;
145 
146  out << setw(2) << (int) hit.getPMT() << ' '
147  << setw(8) << (int) hit.getT() << ' '
148  << setw(3) << (int) hit.getToT();
149 
150  return out;
151  }
JTDC_t getT() const
Get time.
Definition: JDAQHit.hh:86
JPMT_t getPMT() const
Get PMT.
Definition: JDAQHit.hh:75
JTOT_t getToT() const
Get time-over-threshold.
Definition: JDAQHit.hh:97

Member Data Documentation

JPMT_t KM3NETDAQ::JDAQHit::pmt
protected

PMT readout channel in FPGA.

Definition at line 158 of file JDAQHit.hh.

JTDC_t KM3NETDAQ::JDAQHit::tdc
protected

leading edge [ns]

Definition at line 159 of file JDAQHit.hh.

JTOT_t KM3NETDAQ::JDAQHit::tot
protected

time over threshold [ns]

Definition at line 160 of file JDAQHit.hh.


The documentation for this class was generated from the following file: