![]() |
Project
|
#include <HmpidDecoder2.h>
Public Member Functions | |
| HmpidDecoder2 (int *EqIds, int *CruIds, int *LinkIds, int numOfEquipments) | |
| HmpidDecoder2 (int numOfEquipments) | |
| ~HmpidDecoder2 () | |
| Destructor : remove the Equipments instances. | |
| void | init () |
| Init all the members variables. | |
| bool | setUpStream (void *Buffer, long BufferLen) |
| void | setVerbosity (int Level) |
| int | getVerbosity () |
| int | getNumberOfEquipments () |
| int | getEquipmentIndex (int EquipmentId) |
| int | getEquipmentIndex (int CruID, int LinkId) |
| int | getEquipmentID (int CruId, int LinkId) |
| void | decodePage (uint32_t **streamBuffer) |
| void | decodePageFast (uint32_t **streamBuf) |
| bool | decodeBuffer () |
| bool | decodeBufferFast () |
| uint16_t | getChannelSamples (int Equipment, int Column, int Dilogic, int Channel) |
| double | getChannelSum (int Equipment, int Column, int Dilogic, int Channel) |
| double | getChannelSquare (int Equipment, int Column, int Dilogic, int Channel) |
| uint16_t | getPadSamples (int Module, int Row, int Column) |
| double | getPadSum (int Module, int Row, int Column) |
| double | getPadSquares (int Module, int Row, int Column) |
| void | dumpErrors (int Equipment) |
| void | dumpPads (int Equipment, int type=0) |
| void | writeSummaryFile (char *summaryFileName) |
| float | getAverageEventSize (int Equipment) |
| float | getAverageBusyTime (int Equipment) |
| bool | decodeHmpidError (int ErrorField, char *outbuf) |
| void | dumpHmpidError (HmpidEquipment *eq, int ErrorField, int mHeBCDI, int mHeORBIT) |
| void | dumpMemory (const void *MemoryStartPtr, std::size_t Dimension) |
| bool | isPadWord (uint32_t wp, int *Err, int *Col, int *Dilogic, int *Channel, int *Charge) |
| int | decodeHeader (uint32_t *streamPtrAdr, int *EquipIndex) |
| HmpidEquipment * | evaluateHeaderContents (int EquipmentIndex) |
| void | updateStatistics (HmpidEquipment *eq) |
Public Attributes | |
| int | mVerbose |
| HmpidEquipment * | mTheEquipments [Geo::MAXEQUIPMENTS] |
| int | mNumberOfEquipments |
| uint64_t | mHeEvent |
| int | mHeBusy |
| int | mNumberWordToRead |
| int | mPayloadTail |
| int | mHeFEEID |
| int | mHeSize |
| int | mHeVer |
| int | mHePrior |
| int | mHeStop |
| int | mHePages |
| int | mEquipment |
| int | mHeOffsetNewPack |
| int | mHeMemorySize |
| int | mHeDetectorID |
| int | mHeDW |
| int | mHeCruID |
| int | mHePackNum |
| int | mHePAR |
| int | mHePageNum |
| int | mHeLinkNum |
| int | mHeFirmwareVersion |
| int | mHeHmpidError |
| int | mHeBCDI |
| int | mHeORBIT |
| int | mHeTType |
| uint32_t * | mActualStreamPtr |
| uint32_t * | mEndStreamPtr |
| uint32_t * | mStartStreamPtr |
| int | mRDHSize |
| int | mRDHAcceptedVersion |
| o2::InteractionRecord | mIntReco |
| std::vector< o2::hmpid::Digit > | mDigits |
Static Public Attributes | |
| static char | sErrorDescription [MAXERRORS][MAXDESCRIPTIONLENGHT] |
| Decoding Error Messages Definitions. | |
| static char | sHmpidErrorDescription [MAXHMPIDERRORS][MAXDESCRIPTIONLENGHT] |
| HMPID Firmware Error Messages Definitions. | |
Protected Member Functions | |
| int | checkType (uint32_t wp, int *p1, int *p2, int *p3, int *p4) |
| bool | isRowMarker (uint32_t wp, int *Err, int *rowSize, int *mark) |
| bool | isSegmentMarker (uint32_t wp, int *Err, int *segSize, int *Seg, int *mark) |
| bool | isEoEmarker (uint32_t wp, int *Err, int *Col, int *Dilogic, int *Eoesize) |
| void | setPad (HmpidEquipment *eq, int col, int dil, int ch, uint16_t charge) |
| bool | getBlockFromStream (uint32_t **streamPtr, uint32_t Size) |
| bool | getHeaderFromStream (uint32_t **streamPtr) |
| uint32_t | readWordFromStream () |
| uint32_t * | getActualStreamPtr () |
Definition at line 60 of file HmpidDecoder2.h.
| HmpidDecoder2::HmpidDecoder2 | ( | int * | EqIds, |
| int * | CruIds, | ||
| int * | LinkIds, | ||
| int | numOfEquipments | ||
| ) |
Constructor : accepts the number of equipments to define and their complete address map Allocates instances for all defined equipments
The Address map is build from three array
| [in] | numOfEquipments | : the number of equipments to define [1..14] |
| [in] | *EqIds | : the pointer to the Equipments ID array |
| [in] | *CruIds | : the pointer to the CRU ID array |
| [in] | *LinkIds | : the pointer to the Link ID array |
Definition at line 78 of file HmpidDecoder2.cxx.
| HmpidDecoder2::HmpidDecoder2 | ( | int | numOfEquipments | ) |
Constructor : accepts the number of equipments to define The mapping is the default at P2 Allocates instances for all defined equipments normally it is equal to 14
| [in] | numOfEquipments | : the number of equipments to define [1..14] |
Definition at line 61 of file HmpidDecoder2.cxx.
| HmpidDecoder2::~HmpidDecoder2 | ( | ) |
Destructor : remove the Equipments instances.
Definition at line 87 of file HmpidDecoder2.cxx.
|
protected |
Scans the BitMap of Raw Data File word and detect the type and the parameters
| [in] | wp | : the word to analyze |
| [out] | *p1 | : first parameter extract (if it exists) |
| [out] | *p2 | : second parameter extract (if it exists) |
| [out] | *p3 | : third parameter extract (if it exists) |
| [out] | *p4 | : fourth parameter extract (if it exists) |
Definition at line 194 of file HmpidDecoder2.cxx.
| bool HmpidDecoder2::decodeBuffer | ( | ) |
------------— Read Raw Data Buffer ------------— Read the stream, decode the contents and store resuls. ATTENTION : Assumes that the input stream was set
| TH_WRONGHEADER | Thrown if the Fails to decode the Header |
Definition at line 756 of file HmpidDecoder2.cxx.
| bool HmpidDecoder2::decodeBufferFast | ( | ) |
-------— Read Raw Data Buffer with Fast Decoding -------— Read the stream, decode the contents and store resuls. Fast alghoritm : no parsing of control words ! ATTENTION : Assumes that the input stream was set
| TH_WRONGHEADER | Thrown if the Fails to decode the Header |
Definition at line 886 of file HmpidDecoder2.cxx.
| int HmpidDecoder2::decodeHeader | ( | uint32_t * | streamPtrAdr, |
| int * | EquipIndex | ||
| ) |
This Decode the Raw Data Header, returns the EquipmentIndex that is obtained with the FLP hardware coords
ATTENTION : the 'EquipIndex' parameter and the mEquipment member are different data: the first is the pointer in the Equipments instances array, the second is the FEE_ID number
The EVENT_NUMBER : actually is calculated from the ORBIT number
| [in] | *streamPtrAdr | : the pointer to the Header buffer |
| [out] | *EquipIndex | : the Index to the Equipment Object Array [0..13] |
| TH_WRONGEQUIPINDEX | Thrown if the Equipment Index is out of boundary (Equipment not recognized) |
Definition at line 377 of file HmpidDecoder2.cxx.
| bool HmpidDecoder2::decodeHmpidError | ( | int | ErrorField, |
| char * | outbuf | ||
| ) |
Decode the HMPID error BitMap field (5 bits) and returns true if there are errors and in addition the concat string that contains the error messages ATTENTION : the char * outbuf MUST point to a 250 bytes buffer
| [in] | ErrorField | : the HMPID Error field |
| [out] | *outbuf | : the output buffer that contains the error description |
Definition at line 351 of file HmpidDecoder2.cxx.
| void HmpidDecoder2::decodePage | ( | uint32_t ** | streamBuf | ) |
------------— Decode One Page from Data Buffer ------------— Read the stream, decode the contents and store resuls. ATTENTION : Assumes that the input stream was set
| TH_WRONGHEADER | Thrown if the Fails to decode the Header |
| [in] | streamBuf | : the pointer to the Pointer of the Stream Buffer |
Definition at line 494 of file HmpidDecoder2.cxx.
| void HmpidDecoder2::decodePageFast | ( | uint32_t ** | streamBuf | ) |
------— Decode One Page from Data Buffer with Fast Decoding -----— Read the stream, decode the contents and store resuls. ATTENTION : Assumes that the input stream was set
| TH_WRONGHEADER | Thrown if the Fails to decode the Header |
| [in] | streamBuf | : the pointer to the Pointer of the Stream Buffer |
Definition at line 815 of file HmpidDecoder2.cxx.
| void HmpidDecoder2::dumpErrors | ( | int | EquipmId | ) |
Prints on the standard output the table of decoding errors for one equipment
| [in] | EquipmId | : the HMPID EquipmentId [0..13] |
Definition at line 1046 of file HmpidDecoder2.cxx.
| void HmpidDecoder2::dumpHmpidError | ( | HmpidEquipment * | eq, |
| int | ErrorField, | ||
| int | mHeBCDI, | ||
| int | mHeORBIT | ||
| ) |
Prints on the standard output the decoded HMPID error field
| [in] | ErrorField | : the HMPID readout error field |
Definition at line 1096 of file HmpidDecoder2.cxx.
Prints a block of memory
| [in] | MemoryStartPtr | : the pointer to the begin |
| [in] | Dimension | : the block dimension in bytes |
Definition at line 1114 of file HmpidDecoder2.cxx.
| void HmpidDecoder2::dumpPads | ( | int | EquipmId, |
| int | type = 0 |
||
| ) |
Prints on the standard output a Table of statistical decoding information for one equipment
| [in] | EquipmId | : the HMPID EquipmentId [0..13] @type[in] The type of info. 0 = Entries, 1 = Sum, 2 = Sum of squares |
Definition at line 1064 of file HmpidDecoder2.cxx.
| HmpidEquipment * HmpidDecoder2::evaluateHeaderContents | ( | int | EquipmentIndex | ) |
Evaluates the content of the header and detect the change of the event with the relevant updates...
| [in] | EquipmentIndex | : the pointer to the Array of Equipments Array |
Definition at line 458 of file HmpidDecoder2.cxx.
|
inlineprotected |
Definition at line 176 of file HmpidDecoder2.h.
| float HmpidDecoder2::getAverageBusyTime | ( | int | EquipmId | ) |
Gets the Average Busy Time value
| [in] | EquipmId | : the HMPID EquipmentId [0..13] |
Definition at line 1031 of file HmpidDecoder2.cxx.
| float HmpidDecoder2::getAverageEventSize | ( | int | EquipmId | ) |
Gets the Average Event Size value
| [in] | EquipmId | : the HMPID EquipmentId [0..13] |
Definition at line 1019 of file HmpidDecoder2.cxx.
|
protected |
Gets a sized chunk from the stream. The stream pointers members are updated
| [out] | **streamPtr | : the pointer to the memory buffer |
| [in] | Size | : the dimension of the chunk (words) |
| TH_BUFFERPOINTERTOEND | Thrown if the pointer to the buffer is past end |
| TH_WRONGBUFFERDIM | Thrown if the buffer len is less then the size requested |
Definition at line 1230 of file HmpidDecoder2.cxx.
| uint16_t HmpidDecoder2::getChannelSamples | ( | int | EquipmId, |
| int | Column, | ||
| int | Dilogic, | ||
| int | Channel | ||
| ) |
Getter method to extract Statistic Data in Hardware Coords
| [in] | EquipmId | : the HMPID EquipmentId [0..13] |
| [in] | Column | : the HMPID Module Column number [0..23] |
| [in] | Dilogic | : the HMPID Module Row number [0..9] |
| [in] | Channel | : the HMPID Module Row number [0..47] |
Definition at line 977 of file HmpidDecoder2.cxx.
| double HmpidDecoder2::getChannelSquare | ( | int | EquipmId, |
| int | Column, | ||
| int | Dilogic, | ||
| int | Channel | ||
| ) |
Getter method to extract Statistic Data in Hardware Coords
| [in] | EquipmId | : the HMPID EquipmentId [0..13] |
| [in] | Column | : the HMPID Module Column number [0..23] |
| [in] | Dilogic | : the HMPID Module Row number [0..9] |
| [in] | Channel | : the HMPID Module Row number [0..47] |
Definition at line 1007 of file HmpidDecoder2.cxx.
| double HmpidDecoder2::getChannelSum | ( | int | EquipmId, |
| int | Column, | ||
| int | Dilogic, | ||
| int | Channel | ||
| ) |
Getter method to extract Statistic Data in Hardware Coords
| [in] | EquipmId | : the HMPID EquipmentId [0..13] |
| [in] | Column | : the HMPID Module Column number [0..23] |
| [in] | Dilogic | : the HMPID Module Row number [0..9] |
| [in] | Channel | : the HMPID Module Row number [0..47] |
Definition at line 992 of file HmpidDecoder2.cxx.
| int HmpidDecoder2::getEquipmentID | ( | int | CruId, |
| int | LinkId | ||
| ) |
Returns the Equipment_ID converting the FLP hardware coords
| [in] | CruId | : the CRU ID [0..3] -> FLP 160 = [0,1] FLP 161 = [2,3] |
| [in] | LinkId | : the Link ID [0..3] |
Definition at line 176 of file HmpidDecoder2.cxx.
| int HmpidDecoder2::getEquipmentIndex | ( | int | CruId, |
| int | LinkId | ||
| ) |
Returns the Equipment Index (Pointer of the array) converting the FLP hardware coords (CRU_Id and Link_Id)
| [in] | CruId | : the CRU ID [0..3] -> FLP 160 = [0,1] FLP 161 = [2,3] |
| [in] | LinkId | : the Link ID [0..3] |
Definition at line 148 of file HmpidDecoder2.cxx.
| int HmpidDecoder2::getEquipmentIndex | ( | int | EquipmentId | ) |
Returns the Equipment Index (Pointer of the array) converting the Equipment_ID (Firmaware defined Id AKA FFEID)
| [in] | EquipmentId | : the Equipment ID [0..13] |
Definition at line 162 of file HmpidDecoder2.cxx.
|
protected |
Gets the Header Block from the stream.
| [out] | **streamPtr | : the pointer to the memory buffer |
Definition at line 1248 of file HmpidDecoder2.cxx.
|
inline |
Definition at line 129 of file HmpidDecoder2.h.
| uint16_t HmpidDecoder2::getPadSamples | ( | int | Module, |
| int | Row, | ||
| int | Column | ||
| ) |
Getter method to extract Statistic Data in Digit Coords
| [in] | Module | : the HMPID Module number [0..6] |
| [in] | Column | : the HMPID Module Column number [0..143] |
| [in] | Row | : the HMPID Module Row number [0..159] |
Definition at line 928 of file HmpidDecoder2.cxx.
| double HmpidDecoder2::getPadSquares | ( | int | Module, |
| int | Row, | ||
| int | Column | ||
| ) |
Getter method to extract Statistic Data in Digit Coords
| [in] | Module | : the HMPID Module number [0..6] |
| [in] | Column | : the HMPID Module Column number [0..143] |
| [in] | Row | : the HMPID Module Row number [0..159] |
Definition at line 960 of file HmpidDecoder2.cxx.
| double HmpidDecoder2::getPadSum | ( | int | Module, |
| int | Row, | ||
| int | Column | ||
| ) |
Getter method to extract Statistic Data in Digit Coords
| [in] | Module | : the HMPID Module number [0..6] |
| [in] | Column | : the HMPID Module Column number [0..143] |
| [in] | Row | : the HMPID Module Row number [0..159] |
Definition at line 944 of file HmpidDecoder2.cxx.
|
inline |
Definition at line 124 of file HmpidDecoder2.h.
| void HmpidDecoder2::init | ( | ) |
Init all the members variables.
Definition at line 95 of file HmpidDecoder2.cxx.
|
protected |
Checks if is a EoE Marker and extracts the Column, Dilogic and the size
| [in] | wp | : the word to check |
| [out] | *Err | : true if an error is detected |
| [out] | *Col | : the column number [1..24] |
| [out] | *Dilogic | : the dilogic number [1..10] |
| [out] | *Eoesize | : the number of words for dilogic |
Definition at line 324 of file HmpidDecoder2.cxx.
| bool HmpidDecoder2::isPadWord | ( | uint32_t | wp, |
| int * | Err, | ||
| int * | Col, | ||
| int * | Dilogic, | ||
| int * | Channel, | ||
| int * | Charge | ||
| ) |
Checks if is a PAD Word and extracts all the parameters PAD map : 0000.0ccc.ccdd.ddnn.nnnn.vvvv.vvvv.vvvv :: c=col,d=dilo,n=chan,v=value
| [in] | wp | : the word to check |
| [out] | *Err | : true if an error is detected |
| [out] | *Col | : the column number [1..24] |
| [out] | *Dilogic | : the dilogic number [1..10] |
| [out] | *Channel | : the channel number [0..47] |
| [out] | *Charge | : the value of Charge [0..4095] |
Definition at line 288 of file HmpidDecoder2.cxx.
|
protected |
Checks if is a Raw Marker and extract the Row Size
| [in] | wp | : the word to check |
| [out] | *Err | : true if an error is detected |
| [out] | *rowSize | : the number of words of the row |
| [out] | *mark | : the row marker |
Definition at line 239 of file HmpidDecoder2.cxx.
|
protected |
Checks if is a Segment Marker and extracts the Segment number and the size
| [in] | wp | : the word to check |
| [out] | *Err | : true if an error is detected |
| [out] | *segSize | : the number of words of the segment |
| [out] | *Seg | : the Segment number [1..3] |
| [out] | *mark | : the Segment Marker |
Definition at line 259 of file HmpidDecoder2.cxx.
|
protected |
Gets a Word from the stream.
| TH_BUFFERPOINTERTOEND | Thrown if the pointer to the buffer is past end |
Definition at line 1256 of file HmpidDecoder2.cxx.
|
protected |
--— Sets the Pad ! ---— this is an overloaded method. In this version the value of the charge is used to update the statistical matrix of the base class
| [in] | *eq | : the pointer to the Equipment object |
| [in] | col | : the column [0..23] |
| [in] | dil | : the dilogic [0..9] |
| [in] | ch | : the channel [0..47] |
| [in] | charge | : the value of the charge |
Definition at line 802 of file HmpidDecoder2.cxx.
Setup the Input Stream with a Memory Pointer the buffer length is in byte, some controls are done
| [in] | *Buffer | : the pointer to Memory buffer |
| [in] | BufferLen | : the length of the buffer (bytes) |
| TH_NULLBUFFERPOINTER | Thrown if the pointer to the buffer is NULL |
| TH_BUFFEREMPTY | Thrown if the buffer is empty |
| TH_WRONGBUFFERDIM | Thrown if the buffer len is less then one header |
Definition at line 1277 of file HmpidDecoder2.cxx.
|
inline |
Definition at line 120 of file HmpidDecoder2.h.
| void HmpidDecoder2::updateStatistics | ( | HmpidEquipment * | eq | ) |
Updates some information related to the Event this function is called at the end of the event
| [in] | *eq | : the pointer to the Equipment Object |
Definition at line 437 of file HmpidDecoder2.cxx.
Writes in a ASCCI File the complete report of the decoding procedure
| [in] | *summaryFileName | : the name of the output file |
| TH_CREATEFILE | Thrown if was not able to create the file |
Definition at line 1142 of file HmpidDecoder2.cxx.
| uint32_t* o2::hmpid::HmpidDecoder2::mActualStreamPtr |
Definition at line 103 of file HmpidDecoder2.h.
| std::vector<o2::hmpid::Digit> o2::hmpid::HmpidDecoder2::mDigits |
Definition at line 110 of file HmpidDecoder2.h.
| uint32_t* o2::hmpid::HmpidDecoder2::mEndStreamPtr |
Definition at line 104 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mEquipment |
Definition at line 84 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeBCDI |
Definition at line 99 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeBusy |
Definition at line 74 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeCruID |
Definition at line 91 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeDetectorID |
Definition at line 89 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeDW |
Definition at line 90 of file HmpidDecoder2.h.
| uint64_t o2::hmpid::HmpidDecoder2::mHeEvent |
Definition at line 73 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeFEEID |
Definition at line 78 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeFirmwareVersion |
Definition at line 97 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeHmpidError |
Definition at line 98 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeLinkNum |
Definition at line 96 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeMemorySize |
Definition at line 87 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeOffsetNewPack |
Definition at line 86 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeORBIT |
Definition at line 100 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHePackNum |
Definition at line 92 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHePageNum |
Definition at line 95 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHePages |
Definition at line 83 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHePAR |
Definition at line 93 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHePrior |
Definition at line 81 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeSize |
Definition at line 79 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeStop |
Definition at line 82 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeTType |
Definition at line 101 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mHeVer |
Definition at line 80 of file HmpidDecoder2.h.
| o2::InteractionRecord o2::hmpid::HmpidDecoder2::mIntReco |
Definition at line 109 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mNumberOfEquipments |
Definition at line 67 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mNumberWordToRead |
Definition at line 75 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mPayloadTail |
Definition at line 76 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mRDHAcceptedVersion |
Definition at line 107 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mRDHSize |
Definition at line 106 of file HmpidDecoder2.h.
| uint32_t* o2::hmpid::HmpidDecoder2::mStartStreamPtr |
Definition at line 105 of file HmpidDecoder2.h.
| HmpidEquipment* o2::hmpid::HmpidDecoder2::mTheEquipments[Geo::MAXEQUIPMENTS] |
Definition at line 66 of file HmpidDecoder2.h.
| int o2::hmpid::HmpidDecoder2::mVerbose |
Definition at line 65 of file HmpidDecoder2.h.
|
static |
Decoding Error Messages Definitions.
Definition at line 69 of file HmpidDecoder2.h.
|
static |
HMPID Firmware Error Messages Definitions.
Definition at line 70 of file HmpidDecoder2.h.