Belle II Software  release-08-01-10
ROIpayload Class Reference

ROIpayload TODO: Better explanation, Is there a reason to inherit from TObject and not Relationsobject here? This Object contains a binary blob which is send as whole from the HLT Roi Sender output node to the ONSEN system, containing the trigger decision and the Region od Interest (ROI) for data selection on the PXD modules See Data format definitions [BELLE2-NOTE-TE-2016-009] on https://docs.belle2.org/. More...

#include <ROIpayload.h>

Inheritance diagram for ROIpayload:
Collaboration diagram for ROIpayload:

Public Types

using ubig32_t = boost::endian::big_uint32_t
 Shorthand for 32-bit integer stored in big-endian format.
 

Public Member Functions

 ROIpayload (int rois=0)
 Default constructor.
 
virtual ~ROIpayload ()
 destructor.
 
void setPayloadLength (int length)
 transient value More...
 
void setPayloadLength ()
 set payload length
 
void setHeader (bool Accepted, bool SendAll, bool SendROIs)
 set header More...
 
void setTriggerNumber (unsigned long int triggerNumber)
 set trigger number
 
void setRunSubrunExpNumber (int run, int subrun, int exp)
 set run/ subrun/exp number More...
 
void addROIraw (unsigned long int roiraw)
 add a ROIrawID
 
void setCRC ()
 set CRC
 
int getPacketLengthByte ()
 get packet length in bytes
 
int getLength ()
 get packet length
 
int * getRootdata ()
 get pointer to the data packet
 
void init (int length)
 initializer
 
int getNrROIs () const
 Get the nr of ROIs. More...
 
int getDHHID (int j) const
 Return DHH ID of ROI j. More...
 
int getMinVid (int j) const
 Return MinVid (Row 1) of ROI j. More...
 
int getMaxVid (int j) const
 Return MaxVid (Row 2) of ROI j. More...
 
int getMinUid (int j) const
 Return MinUid (Col 1) of ROI j. More...
 
int getMaxUid (int j) const
 Return MaxUid (Col 2) of ROI j. More...
 
int getType (int j) const
 Return Type (Datcon or HLT) of ROI j. More...
 

Public Attributes

int m_packetLengthByte = 0
 packet length in byte
 
int m_length
 packet length
 
int * m_rootdata
 pointer to data packet of m_length words
 
int m_index
 transient index
 
uint32_t * m_data32
 transient value More...
 
ROIrawID::baseTypem_data64
 transient value More...
 

Private Types

enum  {
  OFFSET_MAGIC = 0 ,
  OFFSET_LENGTH = 1 ,
  OFFSET_HEADER = 2 ,
  OFFSET_TRIGNR = 3 ,
  OFFSET_RUNNR = 4 ,
  OFFSET_ROIS = 5
}
 
enum  {
  HEADER_SIZE_WO_LENGTH = 3 ,
  HEADER_SIZE_WITH_LENGTH = 5 ,
  HEADER_SIZE_WITH_LENGTH_AND_CRC = 6
}
 

Detailed Description

ROIpayload TODO: Better explanation, Is there a reason to inherit from TObject and not Relationsobject here? This Object contains a binary blob which is send as whole from the HLT Roi Sender output node to the ONSEN system, containing the trigger decision and the Region od Interest (ROI) for data selection on the PXD modules See Data format definitions [BELLE2-NOTE-TE-2016-009] on https://docs.belle2.org/.

Warning: The class does not allow to be updated in data store! (BII-3191) -> a module might corrupt entries in the data store if a previous ROIpayload is already in the DataStore A complete rewrite of gthe class might be needed for that. For now, you have to check that there is no object in data store before, and raise a FATAL if so.

Definition at line 35 of file ROIpayload.h.

Member Function Documentation

◆ getDHHID()

int getDHHID ( int  j) const
inline

Return DHH ID of ROI j.

Parameters
jIndex of ROI
Returns
DHH ID

Definition at line 95 of file ROIpayload.h.

96  {
97  if (j < 0 || j >= getNrROIs()) return -1;
98  return (((ubig32_t*)m_rootdata)[HEADER_SIZE_WITH_LENGTH + 2 * j] & 0x3F0) >> 4; // & 0x3F0
99  }
int getNrROIs() const
Get the nr of ROIs.
Definition: ROIpayload.h:86
int * m_rootdata
pointer to data packet of m_length words
Definition: ROIpayload.h:55

◆ getMaxUid()

int getMaxUid ( int  j) const
inline

Return MaxUid (Col 2) of ROI j.

Parameters
jIndex of ROI
Returns
MaxUid

Definition at line 136 of file ROIpayload.h.

◆ getMaxVid()

int getMaxVid ( int  j) const
inline

Return MaxVid (Row 2) of ROI j.

Parameters
jIndex of ROI
Returns
MaxVid

Definition at line 116 of file ROIpayload.h.

◆ getMinUid()

int getMinUid ( int  j) const
inline

Return MinUid (Col 1) of ROI j.

Parameters
jIndex of ROI
Returns
MinUid

Definition at line 126 of file ROIpayload.h.

◆ getMinVid()

int getMinVid ( int  j) const
inline

Return MinVid (Row 1) of ROI j.

Parameters
jIndex of ROI
Returns
MinVid

Definition at line 105 of file ROIpayload.h.

◆ getNrROIs()

int getNrROIs ( ) const
inline

Get the nr of ROIs.

Returns
Nr of ROIs.

Definition at line 86 of file ROIpayload.h.

◆ getType()

int getType ( int  j) const
inline

Return Type (Datcon or HLT) of ROI j.

Parameters
jIndex of ROI
Returns
Type of Roi

Definition at line 146 of file ROIpayload.h.

◆ setHeader()

void setHeader ( bool  Accepted,
bool  SendAll,
bool  SendROIs 
)

set header

For Testbeam/Debugging purpose, we do not do any selection -> move to a downscaler on ONSEN Merger / SlowControl

for debugging purpose, we want to see the ROIs which were send in (esp from DATCON) -> move to a downscaler on ONSEN Merger / SlowControl

Definition at line 58 of file ROIpayload.cc.

59 {
60  unsigned int h = 0xCAFE0000; // Magic
61  if (Accepted) h |= 0x8000;
62  if (SendAll) h |=
63  0x4000;
64  if (SendROIs) h |=
65  0x2000;
66  m_data32[OFFSET_HEADER] = htonl(h);
67 };
uint32_t * m_data32
transient value
Definition: ROIpayload.h:60

◆ setPayloadLength()

void setPayloadLength ( int  length)

transient value

set payload length

Definition at line 37 of file ROIpayload.cc.

◆ setRunSubrunExpNumber()

void setRunSubrunExpNumber ( int  run,
int  subrun,
int  exp 
)

set run/ subrun/exp number

set run, subrun and experiment number

Definition at line 74 of file ROIpayload.cc.

Member Data Documentation

◆ m_data32

uint32_t* m_data32

transient value

pointer to transient 32-bit value

Definition at line 60 of file ROIpayload.h.

◆ m_data64

ROIrawID::baseType* m_data64

transient value

pointer to transient 64-bit value

Definition at line 62 of file ROIpayload.h.


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