QualityControl  1.5.1
O2 Data Quality Control Framework
o2::quality_control_modules::hmpid::HmpidDecoder Class Referenceabstract
Inheritance diagram for o2::quality_control_modules::hmpid::HmpidDecoder:
Collaboration diagram for o2::quality_control_modules::hmpid::HmpidDecoder:

Public Member Functions

 HmpidDecoder (int *EqIds, int *CruIds, int *LinkIds, int numOfEquipments)
 
 HmpidDecoder (int numOfEquipments)
 
 ~HmpidDecoder ()
 Destructor : remove the Equipments instances.
 
void init ()
 Resets to 0 all the class members.
 
virtual bool setUpStream (void *Buffer, long BufferLen)=0
 
void setVerbosity (int Level)
 
int getVerbosity ()
 
int getNumberOfEquipments ()
 
int getEquipmentIndex (int EquipmentId)
 
int getEquipmentIndex (int CruID, int LinkId)
 
int getEquipmentID (int CruId, int LinkId)
 
bool decodeBuffer ()
 
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 Column, int Row)
 
double getPadSum (int Module, int Column, int Row)
 
double getPadSquares (int Module, int Column, int Row)
 
void dumpErrors (int Equipment)
 
void dumpPads (int Equipment, int type=0)
 
void writeSummaryFile (char *summaryFileName)
 
float getAverageEventSize (int Equipment)
 
float getAverageBusyTime (int Equipment)
 

Public Attributes

int mVerbose
 
HmpidEquipmentmTheEquipments [MAXEQUIPMENTS]
 
int mNumberOfEquipments
 
int 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
 
int32_t * mActualStreamPtr
 
int32_t * mEndStreamPtr
 
int32_t * mStartStreamPtr
 

Static Public Attributes

static char sErrorDescription [MAXERRORS][MAXDESCRIPTIONLENGHT]
 Decoding Error Messages Definitions. More...
 
static char sHmpidErrorDescription [MAXHMPIDERRORS][MAXDESCRIPTIONLENGHT]
 HMPID Firmware Error Messages Definitions. More...
 

Protected Member Functions

int checkType (int32_t wp, int *p1, int *p2, int *p3, int *p4)
 
bool isRowMarker (int32_t wp, int *Err, int *rowSize, int *mark)
 
bool isSegmentMarker (int32_t wp, int *Err, int *segSize, int *Seg, int *mark)
 
bool isPadWord (int32_t wp, int *Err, int *Col, int *Dilogic, int *Channel, int *Charge)
 
bool isEoEmarker (int32_t wp, int *Err, int *Col, int *Dilogic, int *Eoesize)
 
int decodeHeader (int32_t *streamPtrAdr, int *EquipIndex)
 
bool decodeHmpidError (int ErrorField, char *outbuf)
 
void dumpHmpidError (int ErrorField)
 
HmpidEquipmentevaluateHeaderContents (int EquipmentIndex)
 
void updateStatistics (HmpidEquipment *eq)
 
virtual void setPad (HmpidEquipment *eq, int col, int dil, int ch, int charge)=0
 
virtual bool getBlockFromStream (int32_t **streamPtr, uint32_t Size)=0
 
virtual bool getHeaderFromStream (int32_t **streamPtr)=0
 
virtual bool getWordFromStream (int32_t *word)=0
 
int32_t * getActualStreamPtr ()
 

Constructor & Destructor Documentation

HmpidDecoder::HmpidDecoder ( 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

Parameters
[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
HmpidDecoder::HmpidDecoder ( 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

Parameters
[in]numOfEquipments: the number of equipments to define [1..14]

Member Function Documentation

int HmpidDecoder::checkType ( int32_t  wp,
int *  p1,
int *  p2,
int *  p3,
int *  p4 
)
protected

Scans the BitMap of Raw Data File word and detect the type and the parameters

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)
Returns
Type of Word : the type of word [0..4] (0 := undetect)
bool HmpidDecoder::decodeBuffer ( )

------------— Read Raw Data Buffer ------------— Read the stream, decode the contents and store resuls. ATTENTION : Assumes that the input stream was set

Exceptions
TH_WRONGHEADERThrown if the Fails to decode the Header
int HmpidDecoder::decodeHeader ( int32_t *  streamPtrAdr,
int *  EquipIndex 
)
protected

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

Parameters
[in]*streamPtrAdr: the pointer to the Header buffer
[out]*EquipIndex: the Index to the Equipment Object Array [0..13]
Returns
True every time
Exceptions
TH_WRONGEQUIPINDEXThrown if the Equipment Index is out of boundary (Equipment not recognized)
bool HmpidDecoder::decodeHmpidError ( int  ErrorField,
char *  outbuf 
)
protected

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

Parameters
[in]ErrorField: the HMPID Error field
[out]*outbuf: the output buffer that contains the error description
Returns
True if EoE marker is detected
void HmpidDecoder::dumpErrors ( int  EquipmId)

Prints on the standard output the table of decoding errors for one equipment

Parameters
[in]EquipmId: the HMPID EquipmentId [0..13]
void HmpidDecoder::dumpHmpidError ( int  ErrorField)
protected

Prints on the standard output the decoded HMPID error field

Parameters
[in]ErrorField: the HMPID readout error field
void HmpidDecoder::dumpPads ( int  EquipmId,
int  type = 0 
)

Prints on the standard output a Table of statistical decoding information for one equipment

Parameters
[in]EquipmId: the HMPID EquipmentId [0..13] [in] The type of info. 0 = Entries, 1 = Sum, 2 = Sum of squares
HmpidEquipment * HmpidDecoder::evaluateHeaderContents ( int  EquipmentIndex)
protected

Evaluates the content of the header and detect the change of the event with the relevant updates...

Parameters
[in]EquipmentIndex: the pointer to the Array of Equipments Array
Returns
the Pointer to the modified Equipment object
float HmpidDecoder::getAverageBusyTime ( int  EquipmId)

Gets the Average Busy Time value

Parameters
[in]EquipmId: the HMPID EquipmentId [0..13]
Returns
The Average Busy Time value ( 0 for wrong Equipment Id)
float HmpidDecoder::getAverageEventSize ( int  EquipmId)

Gets the Average Event Size value

Parameters
[in]EquipmId: the HMPID EquipmentId [0..13]
Returns
The Average Event Size value ( 0 for wrong Equipment Id)
uint16_t HmpidDecoder::getChannelSamples ( int  EquipmId,
int  Column,
int  Dilogic,
int  Channel 
)

Getter method to extract Statistic Data in Hardware Coords

Parameters
[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]
Returns
The Number of Entries for specified pad
double HmpidDecoder::getChannelSquare ( int  EquipmId,
int  Column,
int  Dilogic,
int  Channel 
)

Getter method to extract Statistic Data in Hardware Coords

Parameters
[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]
Returns
The Sum of Square Charges for specified pad
double HmpidDecoder::getChannelSum ( int  EquipmId,
int  Column,
int  Dilogic,
int  Channel 
)

Getter method to extract Statistic Data in Hardware Coords

Parameters
[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]
Returns
The Sum of Charges for specified pad
int HmpidDecoder::getEquipmentID ( int  CruId,
int  LinkId 
)

Returns the Equipment_ID converting the FLP hardware coords

Parameters
[in]CruId: the CRU ID [0..3] -> FLP 160 = [0,1] FLP 161 = [2,3]
[in]LinkId: the Link ID [0..3]
Returns
EquipmentID : the ID of the Equipment [0..13] (-1 := error)
int HmpidDecoder::getEquipmentIndex ( int  EquipmentId)

Returns the Equipment Index (Pointer of the array) converting the Equipment_ID (Firmaware defined Id AKA FFEID)

Parameters
[in]EquipmentId: the Equipment ID [0..13]
Returns
EquipmentIndex : the index in the Equipment array [0..13] (-1 := error)
int HmpidDecoder::getEquipmentIndex ( int  CruId,
int  LinkId 
)

Returns the Equipment Index (Pointer of the array) converting the FLP hardware coords (CRU_Id and Link_Id)

Parameters
[in]CruId: the CRU ID [0..3] -> FLP 160 = [0,1] FLP 161 = [2,3]
[in]LinkId: the Link ID [0..3]
Returns
EquipmentIndex : the index in the Equipment array [0..13] (-1 := error)
uint16_t HmpidDecoder::getPadSamples ( int  Module,
int  Column,
int  Row 
)

Getter method to extract Statistic Data in Digit Coords

Parameters
[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]
Returns
The Number of entries for specified pad
double HmpidDecoder::getPadSquares ( int  Module,
int  Column,
int  Row 
)

Getter method to extract Statistic Data in Digit Coords

Parameters
[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]
Returns
The Sum of Square Charges for specified pad
double HmpidDecoder::getPadSum ( int  Module,
int  Column,
int  Row 
)

Getter method to extract Statistic Data in Digit Coords

Parameters
[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]
Returns
The Sum of Charges for specified pad
bool HmpidDecoder::isEoEmarker ( int32_t  wp,
int *  Err,
int *  Col,
int *  Dilogic,
int *  Eoesize 
)
protected

Checks if is a EoE Marker and extracts the Column, Dilogic and the size

Parameters
[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
Returns
True if EoE marker is detected
bool HmpidDecoder::isPadWord ( int32_t  wp,
int *  Err,
int *  Col,
int *  Dilogic,
int *  Channel,
int *  Charge 
)
protected

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

Parameters
[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]
Returns
True if PAD Word is detected
bool HmpidDecoder::isRowMarker ( int32_t  wp,
int *  Err,
int *  rowSize,
int *  mark 
)
protected

Checks if is a Raw Marker and extract the Row Size

Parameters
[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
Returns
True if Row Marker is detected
bool HmpidDecoder::isSegmentMarker ( int32_t  wp,
int *  Err,
int *  segSize,
int *  Seg,
int *  mark 
)
protected

Checks if is a Segment Marker and extracts the Segment number and the size

Parameters
[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
Returns
True if Segment Marker is detected
void HmpidDecoder::updateStatistics ( HmpidEquipment eq)
protected

Updates some information related to the Event this function is called at the end of the event

Parameters
[in]*eq: the pointer to the Equipment Object
void HmpidDecoder::writeSummaryFile ( char *  summaryFileName)

Writes in a ASCCI File the complete report of the decoding procedure

Parameters
[in]*summaryFileName: the name of the output file
Exceptions
TH_CREATEFILEThrown if was not able to create the file

Member Data Documentation

char HmpidDecoder::sErrorDescription
static
Initial value:
= { "Word that I don't known !",
"Row Marker Word with 0 words", "Duplicated Pad Word !", "Row Marker Wrong/Lost -> to EoE",
"Row Marker Wrong/Lost -> to EoE", "Row Marker reports an ERROR !", "Lost EoE Marker !", "Double EoE marker",
"Wrong size definition in EoE Marker", "Double Mark Word", "Wrong Size in Segment Marker", "Lost EoS Marker !",
"HMPID Header Errors" }

Decoding Error Messages Definitions.

char HmpidDecoder::sHmpidErrorDescription
static
Initial value:
= {
"L0 Missing,"
"L1 is received without L0",
"L1A signal arrived before the L1 Latency", "L1A signal arrived after the L1 Latency",
"L1A is missing or L1 timeout", "L1A Message is missing or L1 Message"
}

HMPID Firmware Error Messages Definitions.


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