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

DAQ frame status. More...

#include <JDAQFrameStatus.hh>

Inheritance diagram for KM3NETDAQ::JDAQFrameStatus:
KM3NETDAQ::JDAQSummaryFrame KM3NETDAQ::JDAQSuperFrameHeader KM3NETDAQ::JDAQSuperFrame

Public Member Functions

 JDAQFrameStatus ()
 Default constructor. More...
 
 JDAQFrameStatus (const int __daq, const int __status, const int __fifo, const int __status_3=0, const int __status_4=0)
 Constructor. More...
 
const JDAQFrameStatusgetDAQFrameStatus () const
 Get DAQ frame status. More...
 
void setDAQFrameStatus (const JDAQFrameStatus &status)
 Set DAQ frame status. More...
 
int getDAQStatus () const
 Get DAQ status. More...
 
int getStatus () const
 Get TDC and White Rabbit status. More...
 
int getFIFOStatus () const
 Get FIFO status. More...
 
bool testDAQStatus () const
 Test DAQ status of packets. More...
 
bool testStatus () const
 Test TDC and White Rabbit status. More...
 
int getUDPNumberOfReceivedPackets () const
 Get number of received UDP packets. More...
 
int getUDPMaximalSequenceNumber () const
 Get maximal sequence number of UDP packet. More...
 
bool testWhiteRabbitStatus () const
 Test White Rabbit status. More...
 
bool testTDCStatus () const
 Test TDC status. More...
 
bool testHighRateVeto () const
 Test high-rate veto status. More...
 
bool testHighRateVeto (const int tdc) const
 Test high-rate veto status. More...
 
int countHighRateVeto () const
 Count high-rate veto status. More...
 
bool testFIFOStatus () const
 Test FIFO status. More...
 
bool testFIFOStatus (const int tdc) const
 Test FIFO status. More...
 
int countFIFOStatus () const
 Count FIFO status. More...
 
int countActiveChannels () const
 Count active channels. More...
 
bool hasUDPTrailer () const
 Get UDP trailer status. More...
 
void setHighRateVeto (const int tdc, const bool value)
 Set high-rate veto. More...
 
 ClassDefNV (JDAQFrameStatus, 1)
 

Static Public Member Functions

static const JDAQFrameStatusgetInstance ()
 Get reference to unique instance of this class object. More...
 

Protected Attributes

int daq
 
int status
 
int fifo
 
int status_3
 
int status_4
 

Friends

size_t getSizeof ()
 Definition of method to get size of data type. More...
 
JReaderoperator>> (JReader &, JDAQFrameStatus &)
 Read DAQ frame status from input. More...
 
JWriteroperator<< (JWriter &, const JDAQFrameStatus &)
 Write DAQ frame status to output. More...
 

Detailed Description

DAQ frame status.

Definition at line 17 of file JDAQFrameStatus.hh.

Constructor & Destructor Documentation

KM3NETDAQ::JDAQFrameStatus::JDAQFrameStatus ( )
inline

Default constructor.

Definition at line 27 of file JDAQFrameStatus.hh.

KM3NETDAQ::JDAQFrameStatus::JDAQFrameStatus ( const int  __daq,
const int  __status,
const int  __fifo,
const int  __status_3 = 0,
const int  __status_4 = 0 
)
inline

Constructor.

Parameters
__daqDAQ status
__statusTDC status
__fifoFIFO status
__status_3spare
__status_4spare

Definition at line 45 of file JDAQFrameStatus.hh.

49  :
50  daq (__daq),
51  status (__status),
52  fifo (__fifo),
53  status_3(__status_3),
54  status_4(__status_4)
55  {}

Member Function Documentation

static const JDAQFrameStatus& KM3NETDAQ::JDAQFrameStatus::getInstance ( )
inlinestatic

Get reference to unique instance of this class object.

This instance has default values which correspond to a valid DAQ frame status.

Returns
reference to this class object

Definition at line 65 of file JDAQFrameStatus.hh.

66  {
70 
71  return status;
72  }
static const JBits DAQ_UDP_RECEIVED_PACKETS(0, 15)
Mask of UDP received packets.
int write(const int value) const
Write given value as bit mask.
Definition: JDAQ.hh:115
int write(const int value) const
Write given value as bit mask.
Definition: JDAQ.hh:238
static const JBits DAQ_FIFO(0, 30)
FIFO almost full bits.
static const JBit DAQ_UDP_TRAILER(31)
UDP trailer.
static const JBit DAQ_WHITE_RABBIT(31)
White Rabbit status.
static const JBits DAQ_UDP_SEQUENCE_NUMBER(16, 31)
Mask of UDP sequence number.
const JDAQFrameStatus& KM3NETDAQ::JDAQFrameStatus::getDAQFrameStatus ( ) const
inline

Get DAQ frame status.

Returns
DAQ frame status

Definition at line 80 of file JDAQFrameStatus.hh.

81  {
82  return static_cast<const JDAQFrameStatus&>(*this);
83  }
void KM3NETDAQ::JDAQFrameStatus::setDAQFrameStatus ( const JDAQFrameStatus status)
inline

Set DAQ frame status.

Parameters
statusDAQ frame status

Definition at line 91 of file JDAQFrameStatus.hh.

92  {
93  static_cast<JDAQFrameStatus&>(*this) = status;
94  }
int KM3NETDAQ::JDAQFrameStatus::getDAQStatus ( ) const
inline

Get DAQ status.

Returns
DAQ status

Definition at line 102 of file JDAQFrameStatus.hh.

103  {
104  return this->daq;
105  }
int KM3NETDAQ::JDAQFrameStatus::getStatus ( ) const
inline

Get TDC and White Rabbit status.

Returns
status

Definition at line 113 of file JDAQFrameStatus.hh.

114  {
115  return this->status;
116  }
int KM3NETDAQ::JDAQFrameStatus::getFIFOStatus ( ) const
inline

Get FIFO status.

Returns
FIFO status

Definition at line 124 of file JDAQFrameStatus.hh.

125  {
126  return this->fifo;
127  }
bool KM3NETDAQ::JDAQFrameStatus::testDAQStatus ( ) const
inline

Test DAQ status of packets.

Returns
true if okay; else false

Definition at line 135 of file JDAQFrameStatus.hh.

136  {
138  }
bool hasUDPTrailer() const
Get UDP trailer status.
int getUDPNumberOfReceivedPackets() const
Get number of received UDP packets.
int getUDPMaximalSequenceNumber() const
Get maximal sequence number of UDP packet.
bool KM3NETDAQ::JDAQFrameStatus::testStatus ( ) const
inline

Test TDC and White Rabbit status.

Returns
true if okay; else false

Definition at line 146 of file JDAQFrameStatus.hh.

147  {
148  return testWhiteRabbitStatus() && testTDCStatus();
149  }
bool testTDCStatus() const
Test TDC status.
bool testWhiteRabbitStatus() const
Test White Rabbit status.
int KM3NETDAQ::JDAQFrameStatus::getUDPNumberOfReceivedPackets ( ) const
inline

Get number of received UDP packets.

Returns
UDP received packets

Definition at line 157 of file JDAQFrameStatus.hh.

158  {
159  return DAQ_UDP_RECEIVED_PACKETS.read(this->daq);
160  }
static const JBits DAQ_UDP_RECEIVED_PACKETS(0, 15)
Mask of UDP received packets.
int read(const int mask) const
Read given bit mask as value.
Definition: JDAQ.hh:250
int KM3NETDAQ::JDAQFrameStatus::getUDPMaximalSequenceNumber ( ) const
inline

Get maximal sequence number of UDP packet.

Returns
UDP sequence number

Definition at line 168 of file JDAQFrameStatus.hh.

169  {
170  return DAQ_UDP_SEQUENCE_NUMBER.read(this->daq);
171  }
int read(const int mask) const
Read given bit mask as value.
Definition: JDAQ.hh:250
static const JBits DAQ_UDP_SEQUENCE_NUMBER(16, 31)
Mask of UDP sequence number.
bool KM3NETDAQ::JDAQFrameStatus::testWhiteRabbitStatus ( ) const
inline

Test White Rabbit status.

Returns
true if okay; else false

Definition at line 179 of file JDAQFrameStatus.hh.

180  {
181  return DAQ_WHITE_RABBIT.has(this->status);
182  }
bool has(const int mask) const
Test bit.
Definition: JDAQ.hh:139
static const JBit DAQ_WHITE_RABBIT(31)
White Rabbit status.
bool KM3NETDAQ::JDAQFrameStatus::testTDCStatus ( ) const
inline

Test TDC status.

Returns
true if okay; else false

Definition at line 190 of file JDAQFrameStatus.hh.

191  {
192  return !testHighRateVeto();
193  }
bool testHighRateVeto() const
Test high-rate veto status.
bool KM3NETDAQ::JDAQFrameStatus::testHighRateVeto ( ) const
inline

Test high-rate veto status.

Returns
true if one of the TDCs is high-rate vetoed; else false

Definition at line 201 of file JDAQFrameStatus.hh.

202  {
203  return DAQ_TDC.has(this->status);
204  }
bool has(const int mask) const
Test bit mask.
Definition: JDAQ.hh:262
static const JBits DAQ_TDC(0, 30)
TDC high-rate veto status.
bool KM3NETDAQ::JDAQFrameStatus::testHighRateVeto ( const int  tdc) const
inline

Test high-rate veto status.

Parameters
tdcTDC
Returns
true if TDC is high-rate vetoed; else false

Definition at line 213 of file JDAQFrameStatus.hh.

214  {
215  return JBit(tdc).has(this->status);
216  }
bool has(const int mask) const
Test bit.
Definition: JDAQ.hh:139
Auxiliary data structure for single bit.
Definition: JDAQ.hh:36
int KM3NETDAQ::JDAQFrameStatus::countHighRateVeto ( ) const
inline

Count high-rate veto status.

Returns
number of the TDCs with high-rate veto

Definition at line 224 of file JDAQFrameStatus.hh.

225  {
226  int n = 0;
227 
228  if (testHighRateVeto()) {
229  for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
230  if (JBit(pmt).has(this->status)) {
231  ++n;
232  }
233  }
234  }
235 
236  return n;
237  }
const int n
Definition: JPolint.hh:660
bool testHighRateVeto() const
Test high-rate veto status.
Auxiliary data structure for single bit.
Definition: JDAQ.hh:36
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26
bool KM3NETDAQ::JDAQFrameStatus::testFIFOStatus ( ) const
inline

Test FIFO status.

Returns
true if one of the TDCs has FIFO almost full; else false

Definition at line 245 of file JDAQFrameStatus.hh.

246  {
247  return DAQ_FIFO.has(this->fifo);
248  }
static const JBits DAQ_FIFO(0, 30)
FIFO almost full bits.
bool has(const int mask) const
Test bit mask.
Definition: JDAQ.hh:262
bool KM3NETDAQ::JDAQFrameStatus::testFIFOStatus ( const int  tdc) const
inline

Test FIFO status.

Parameters
tdcTDC
Returns
true if FIFO is almost full; else false

Definition at line 257 of file JDAQFrameStatus.hh.

258  {
259  return JBit(tdc).has(this->fifo);
260  }
bool has(const int mask) const
Test bit.
Definition: JDAQ.hh:139
Auxiliary data structure for single bit.
Definition: JDAQ.hh:36
int KM3NETDAQ::JDAQFrameStatus::countFIFOStatus ( ) const
inline

Count FIFO status.

Returns
number of the TDCs with FIFO almost full

Definition at line 268 of file JDAQFrameStatus.hh.

269  {
270  int n = 0;
271 
272  if (testFIFOStatus()) {
273  for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
274  if (JBit(pmt).has(this->fifo)) {
275  ++n;
276  }
277  }
278  }
279 
280  return n;
281  }
const int n
Definition: JPolint.hh:660
Auxiliary data structure for single bit.
Definition: JDAQ.hh:36
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26
bool testFIFOStatus() const
Test FIFO status.
int KM3NETDAQ::JDAQFrameStatus::countActiveChannels ( ) const
inline

Count active channels.

Returns
number of TDCs without high rate veto or FIFO almost full

Definition at line 287 of file JDAQFrameStatus.hh.

288  {
289  int n = NUMBER_OF_PMTS;
290 
291  if (testHighRateVeto() || testFIFOStatus()) {
292  for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
293  if ( JBit(pmt).has(this->status) || JBit(pmt).has(this->fifo) ) {
294  --n;
295  }
296  }
297  }
298 
299  return n;
300 
301  }
const int n
Definition: JPolint.hh:660
bool testHighRateVeto() const
Test high-rate veto status.
Auxiliary data structure for single bit.
Definition: JDAQ.hh:36
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26
bool testFIFOStatus() const
Test FIFO status.
bool KM3NETDAQ::JDAQFrameStatus::hasUDPTrailer ( ) const
inline

Get UDP trailer status.

Returns
true if UDP trailer present; else false

Definition at line 309 of file JDAQFrameStatus.hh.

310  {
311  return DAQ_UDP_TRAILER.has(this->fifo);
312  }
static const JBit DAQ_UDP_TRAILER(31)
UDP trailer.
bool has(const int mask) const
Test bit.
Definition: JDAQ.hh:139
void KM3NETDAQ::JDAQFrameStatus::setHighRateVeto ( const int  tdc,
const bool  value 
)
inline

Set high-rate veto.

Parameters
tdcTDC
valuevalue

Definition at line 321 of file JDAQFrameStatus.hh.

322  {
323  JBit(tdc).set(this->status, value);
324  }
void set(int &mask) const
Set bit in given bit mask.
Definition: JDAQ.hh:77
Auxiliary data structure for single bit.
Definition: JDAQ.hh:36
KM3NETDAQ::JDAQFrameStatus::ClassDefNV ( JDAQFrameStatus  ,
 
)

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,
JDAQFrameStatus status 
)
friend

Read DAQ frame status from input.

Parameters
inreader
statusDAQ frame status
Returns
reader

Definition at line 36 of file JDAQFrameStatusIO.hh.

37  {
38  in >> status.daq;
39  in >> status.status;
40  in >> status.fifo;
41  in >> status.status_3;
42  in >> status.status_4;
43 
44  return in;
45  }
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:41
JWriter& operator<< ( JWriter out,
const JDAQFrameStatus status 
)
friend

Write DAQ frame status to output.

Parameters
outwriter
statusDAQ frame status
Returns
writer

Definition at line 55 of file JDAQFrameStatusIO.hh.

56  {
57  out << status.daq;
58  out << status.status;
59  out << status.fifo;
60  out << status.status_3;
61  out << status.status_4;
62 
63  return out;
64  }

Member Data Documentation

int KM3NETDAQ::JDAQFrameStatus::daq
protected

Definition at line 330 of file JDAQFrameStatus.hh.

int KM3NETDAQ::JDAQFrameStatus::status
protected

Definition at line 331 of file JDAQFrameStatus.hh.

int KM3NETDAQ::JDAQFrameStatus::fifo
protected

Definition at line 332 of file JDAQFrameStatus.hh.

int KM3NETDAQ::JDAQFrameStatus::status_3
protected

Definition at line 333 of file JDAQFrameStatus.hh.

int KM3NETDAQ::JDAQFrameStatus::status_4
protected

Definition at line 334 of file JDAQFrameStatus.hh.


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