Jpp
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...
 
static int sizeOf ()
 Get size of object. 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

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...
 
JReaderoperator>> (JReader &in, JDAQHit &hit)
 Read DAQ hit from input. More...
 
JWriteroperator<< (JWriter &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 40 of file JDAQHit.hh.

Member Typedef Documentation

◆ JPMT_t

typedef unsigned char KM3NETDAQ::JDAQHit::JPMT_t

PMT channel in FPGA.

Definition at line 44 of file JDAQHit.hh.

◆ JTDC_t

typedef unsigned int KM3NETDAQ::JDAQHit::JTDC_t

leading edge [ns]

Definition at line 45 of file JDAQHit.hh.

◆ JTOT_t

typedef unsigned char KM3NETDAQ::JDAQHit::JTOT_t

time over threshold [ns]

Definition at line 46 of file JDAQHit.hh.

Constructor & Destructor Documentation

◆ JDAQHit() [1/2]

KM3NETDAQ::JDAQHit::JDAQHit ( )
inline

Default constructor.

Definition at line 52 of file JDAQHit.hh.

53  {}

◆ JDAQHit() [2/2]

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 63 of file JDAQHit.hh.

65  :
66  pmt(pmt_id),
67  tdc(htonl(tdc_ns)),
68  //tdc(tdc_ns),
69  tot(tot_ns)
70  {}

Member Function Documentation

◆ getPMT()

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

Get PMT.

Returns
PMT

Definition at line 78 of file JDAQHit.hh.

79  {
80  return pmt;
81  }

◆ getT()

JTDC_t KM3NETDAQ::JDAQHit::getT ( ) const
inline

Get time.

Returns
time [ns]

Definition at line 89 of file JDAQHit.hh.

90  {
91  return ntohl(tdc);
92  }

◆ getToT()

JTOT_t KM3NETDAQ::JDAQHit::getToT ( ) const
inline

Get time-over-threshold.

Returns
time-over-threshold [ns]

Definition at line 100 of file JDAQHit.hh.

101  {
102  return tot;
103  }

◆ getMaximalToT()

static JTOT_t KM3NETDAQ::JDAQHit::getMaximalToT ( )
inlinestatic

Get maximal time-over-threshold.

Returns
time-over-threshold [ns]

Definition at line 111 of file JDAQHit.hh.

112  {
113  return 0xFF;
114  }

◆ sizeOf()

static int KM3NETDAQ::JDAQHit::sizeOf ( )
inlinestatic

Get size of object.

Returns
number of bytes

Definition at line 196 of file JDAQHit.hh.

197  {
198  return sizeof(JDAQHit);
199  }

◆ ClassDefNV()

KM3NETDAQ::JDAQHit::ClassDefNV ( JDAQHit  ,
 
)

Friends And Related Function Documentation

◆ operator>> [1/2]

std::istream& operator>> ( std::istream &  in,
JDAQHit hit 
)
friend

Read DAQ hit from input.

Parameters
ininput stream
hithit
Returns
input stream

Definition at line 124 of file JDAQHit.hh.

125  {
126  int pmt;
127  int tdc;
128  int tot;
129 
130  if (in >> pmt >> tdc >> tot) {
131  hit = JDAQHit(pmt, tdc, tot);
132  }
133 
134  return in;
135  }

◆ operator<< [1/2]

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 145 of file JDAQHit.hh.

146  {
147  using namespace std;
148 
149  out << setw(2) << (int) hit.getPMT() << ' '
150  << setw(8) << (int) hit.getT() << ' '
151  << setw(3) << (int) hit.getToT();
152 
153  return out;
154  }

◆ operator>> [2/2]

JReader& operator>> ( JReader in,
JDAQHit hit 
)
friend

Read DAQ hit from input.

Parameters
inJReader
hitJDAQHit
Returns
JReader

Definition at line 164 of file JDAQHit.hh.

165  {
166  in >> hit.pmt;
167  in >> hit.tdc;
168  in >> hit.tot;
169 
170  return in;
171  }

◆ operator<< [2/2]

JWriter& operator<< ( JWriter out,
const JDAQHit hit 
)
friend

Write DAQ hit to output.

Parameters
outJWriter
hitJDAQHit
Returns
JWriter

Definition at line 181 of file JDAQHit.hh.

182  {
183  out << hit.pmt;
184  out << hit.tdc;
185  out << hit.tot;
186 
187  return out;
188  }

Member Data Documentation

◆ pmt

JPMT_t KM3NETDAQ::JDAQHit::pmt
protected

PMT readout channel in FPGA.

Definition at line 206 of file JDAQHit.hh.

◆ tdc

JTDC_t KM3NETDAQ::JDAQHit::tdc
protected

leading edge [ns]

Definition at line 207 of file JDAQHit.hh.

◆ tot

JTOT_t KM3NETDAQ::JDAQHit::tot
protected

time over threshold [ns]

Definition at line 208 of file JDAQHit.hh.


The documentation for this class was generated from the following file:
KM3NETDAQ::JDAQHit::pmt
JPMT_t pmt
PMT readout channel in FPGA.
Definition: JDAQHit.hh:206
KM3NETDAQ::JDAQHit::tot
JTOT_t tot
time over threshold [ns]
Definition: JDAQHit.hh:208
KM3NETDAQ::JDAQHit::JDAQHit
JDAQHit()
Default constructor.
Definition: JDAQHit.hh:52
std
Definition: jaanetDictionary.h:36
KM3NETDAQ::JDAQHit::tdc
JTDC_t tdc
leading edge [ns]
Definition: JDAQHit.hh:207