CMS 3D CMS Logo

Public Member Functions | Protected Types | Protected Attributes

DCCTBTrailerBlock Class Reference

#include <DCCTrailerBlock.h>

Inheritance diagram for DCCTBTrailerBlock:
DCCTBBlockPrototype

List of all members.

Public Member Functions

void dataCheck ()
 DCCTBTrailerBlock (DCCTBDataParser *parser, uint32_t *buffer, uint32_t numbBytes, uint32_t wToEnd, uint32_t wordEventOffset, uint32_t expectedLength, uint32_t expectedCRC)

Protected Types

enum  traillerFields { EOE = 0xA }

Protected Attributes

uint32_t expectedCRC_
uint32_t expectedLength_

Detailed Description

Definition at line 11 of file DCCTrailerBlock.h.


Member Enumeration Documentation

Enumerator:
EOE 

Definition at line 30 of file DCCTrailerBlock.h.

{ EOE = 0xA};

Constructor & Destructor Documentation

DCCTBTrailerBlock::DCCTBTrailerBlock ( DCCTBDataParser parser,
uint32_t *  buffer,
uint32_t  numbBytes,
uint32_t  wToEnd,
uint32_t  wordEventOffset,
uint32_t  expectedLength,
uint32_t  expectedCRC 
)

Definition at line 4 of file DCCTrailerBlock.cc.

References dataCheck(), DCCTBBlockPrototype::errors_, DCCTBDataParser::mapper(), DCCTBBlockPrototype::mapperFields_, DCCTBBlockPrototype::parseData(), DCCTBBlockPrototype::parser_, and DCCTBDataMapper::trailerFields().

  : DCCTBBlockPrototype(parser,"DCCTRAILER", buffer, numbBytes,wToEnd, wordEventOffset),
expectedLength_(expectedLength){
        
        errors_["TRAILER::EVENT LENGTH"] = 0 ;
        errors_["TRAILER::EOE"]    = 0 ; 
        errors_["TRAILER::CRC"]    = 0 ;
        errors_["TRAILER::T"]      = 0 ;
        
        // Get data fields from the mapper and retrieve data ///////////////////////////////////////////
        mapperFields_ = parser_->mapper()->trailerFields();
        parseData();

        // check internal data ////
        dataCheck();

}

Member Function Documentation

void DCCTBTrailerBlock::dataCheck ( )

Definition at line 32 of file DCCTrailerBlock.cc.

References DCCTBBlockPrototype::blockError_, DCCTBBlockPrototype::checkDataField(), EOE, DCCTBBlockPrototype::errors_, DCCTBBlockPrototype::errorString_, expectedLength_, and DCCTBBlockPrototype::name_.

Referenced by DCCTBTrailerBlock().

                                 {
        
        std::string checkErrors("");
        
        std::pair<bool,std::string> res;
        
        res = checkDataField("EVENT LENGTH",expectedLength_);
        if(!res.first){ checkErrors += res.second; (errors_["TRAILER::EVENT LENGTH"])++; }
        
        res = checkDataField("EOE",EOE);
        if(!res.first){ checkErrors += res.second; (errors_["TRAILER::EOE"])++; }
        
        res = checkDataField("T",0);
        if(!res.first){ checkErrors += res.second; (errors_["TRAILER::T"])++; }
        
        //checkErrors += checkDataField("CRC",expectedCRC_);
        
        if(checkErrors!=""){
                errorString_ +="\n ======================================================================\n";           
                errorString_ += std::string(" ") + name_ + std::string(" data fields checks errors : ") ;
                errorString_ += checkErrors ;
                errorString_ += "\n ======================================================================";
                blockError_ = true;     
        }
}

Member Data Documentation

uint32_t DCCTBTrailerBlock::expectedCRC_ [protected]

Definition at line 32 of file DCCTrailerBlock.h.

uint32_t DCCTBTrailerBlock::expectedLength_ [protected]

Definition at line 31 of file DCCTrailerBlock.h.

Referenced by dataCheck().