Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
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.
 
typedef unsigned int JTDC_t
 leading edge [ns]
 
typedef unsigned char JTOT_t
 time over threshold [ns]
 

Public Member Functions

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

Static Public Member Functions

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

Protected Attributes

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

Friends

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

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

◆ JPMT_t

PMT channel in FPGA.

Definition at line 38 of file JDAQHit.hh.

◆ JTDC_t

leading edge [ns]

Definition at line 39 of file JDAQHit.hh.

◆ JTOT_t

time over threshold [ns]

Definition at line 40 of file JDAQHit.hh.

Constructor & Destructor Documentation

◆ JDAQHit() [1/2]

KM3NETDAQ::JDAQHit::JDAQHit ( )
inline

Default constructor.

Definition at line 49 of file JDAQHit.hh.

50 {}

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

62 :
63 pmt(pmt_id),
64 tdc(htonl(tdc_ns)),
65 //tdc(tdc_ns),
66 tot(tot_ns)
67 {}
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

Member Function Documentation

◆ getPMT()

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

Get PMT.

Returns
PMT

Definition at line 75 of file JDAQHit.hh.

76 {
77 return pmt;
78 }

◆ getT()

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 }

◆ getToT()

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 }

◆ getMaximalToT()

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 }

◆ ClassDefNV()

KM3NETDAQ::JDAQHit::ClassDefNV ( JDAQHit ,
2  )

Friends And Related Symbol Documentation

◆ getSizeof

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

◆ operator>> [1/2]

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 }

◆ operator<< [1/2]

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 }

◆ operator>> [2/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 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

◆ operator<< [2/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 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 }
JPMT_t getPMT() const
Get PMT.
Definition JDAQHit.hh:75
JTDC_t getT() const
Get time.
Definition JDAQHit.hh:86
JTOT_t getToT() const
Get time-over-threshold.
Definition JDAQHit.hh:97

Member Data Documentation

◆ pmt

JPMT_t KM3NETDAQ::JDAQHit::pmt
protected

PMT readout channel in FPGA.

Definition at line 158 of file JDAQHit.hh.

◆ tdc

JTDC_t KM3NETDAQ::JDAQHit::tdc
protected

leading edge [ns]

Definition at line 159 of file JDAQHit.hh.

◆ tot

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: