CMS 3D CMS Logo

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

DCCTBSRPBlock Class Reference

#include <DCCSRPBlock.h>

Inheritance diagram for DCCTBSRPBlock:
DCCTBBlockPrototype

List of all members.

Public Member Functions

 DCCTBSRPBlock (DCCTBEventBlock *dccBlock, DCCTBDataParser *parser, uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEnd, uint32_t wordEventOffset)

Protected Types

enum  srpFields { BXMASK = 0xFFF, L1MASK = 0xFFF, BPOSITION_BLOCKID = 29, BLOCKID = 4 }

Protected Member Functions

void dataCheck ()
void increment (uint32_t numb)

Protected Attributes

DCCTBEventBlockdccBlock_

Detailed Description

Definition at line 21 of file DCCSRPBlock.h.


Member Enumeration Documentation

enum DCCTBSRPBlock::srpFields [protected]
Enumerator:
BXMASK 
L1MASK 
BPOSITION_BLOCKID 
BLOCKID 

Definition at line 42 of file DCCSRPBlock.h.

                              { 
                        BXMASK = 0xFFF,
                        L1MASK = 0xFFF, 
                        BPOSITION_BLOCKID = 29,
                        BLOCKID = 4
                };

Constructor & Destructor Documentation

DCCTBSRPBlock::DCCTBSRPBlock ( DCCTBEventBlock dccBlock,
DCCTBDataParser parser,
uint32_t *  buffer,
uint32_t  numbBytes,
uint32_t  wordsToEnd,
uint32_t  wordEventOffset 
)

Definition at line 6 of file DCCSRPBlock.cc.

References dataCheck(), DCCTBDataParser::debug(), DCCTBBlockPrototype::errors_, DCCTBDataParser::mapper(), DCCTBBlockPrototype::mapperFields_, DCCTBDataParser::numbSRF(), DCCTBBlockPrototype::parseData(), DCCTBBlockPrototype::parser_, DCCTBDataMapper::srp16Fields(), DCCTBDataMapper::srp32Fields(), and DCCTBDataMapper::srp68Fields().

  : DCCTBBlockPrototype(parser,"SRP", buffer, numbBytes,wordsToEnd,wordEventOffset), dccBlock_(dccBlock){
        
        //Reset error counters ///////
        errors_["SRP::HEADER"]  = 0;
        errors_["SRP::BLOCKID"] = 0;
        
        // Get data fields from the mapper and retrieve data /////////////////////////////////////
             if( parser_->numbSRF() == 68){ mapperFields_ = parser_->mapper()->srp68Fields();}
        else if( parser_->numbSRF() == 32){ mapperFields_ = parser_->mapper()->srp32Fields();}  
        else if( parser_->numbSRF() == 16){ mapperFields_ = parser_->mapper()->srp16Fields();}
        parseData();
        
        // check internal data ////////////
        if(parser_->debug()){ dataCheck();}

}

Member Function Documentation

void DCCTBSRPBlock::dataCheck ( ) [protected]

Definition at line 35 of file DCCSRPBlock.cc.

References DCCTBBlockPrototype::blockError_, BXMASK, DCCTBBlockPrototype::checkDataField(), dccBlock_, DCCTBBlockPrototype::errors_, DCCTBBlockPrototype::errorString_, DCCTBBlockPrototype::getDataField(), L1MASK, DCCTBBlockPrototype::name_, DCCTBBlockPrototype::parser_, DCCTBDataParser::srpId(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DCCTBSRPBlock().

                             { 
        
        std::string checkErrors("");

        std::pair <bool,std::string> res;
        
        res = checkDataField("BX", BXMASK & (dccBlock_->getDataField("BX")));
        if(!res.first){ checkErrors += res.second; (errors_["SRP::HEADER"])++; }
        res = checkDataField("LV1", L1MASK & (dccBlock_->getDataField("LV1"))); 
        if(!res.first){ checkErrors += res.second; (errors_["SRP::HEADER"])++; }
        
         
        res = checkDataField("SRP ID",parser_->srpId()); 
        if(!res.first){ checkErrors += res.second; (errors_["SRP::HEADER"])++; } 
        
        
        if(checkErrors!=""){
                errorString_ +="\n ======================================================================\n";           
                errorString_ += std::string(" ") + name_ + std::string(" data fields checks errors : ") ;
                errorString_ += checkErrors ;
                errorString_ += "\n ======================================================================";
                blockError_ = true;     
        }
        
        
}
void DCCTBSRPBlock::increment ( uint32_t  numb) [protected]

Definition at line 63 of file DCCSRPBlock.cc.

References BLOCKID, BPOSITION_BLOCKID, DCCTBBlockPrototype::dataP_, DCCTBDataParser::debug(), DCCTBBlockPrototype::errors_, DCCTBBlockPrototype::parser_, and DCCTBBlockPrototype::wordCounter_.

                                           {
        if(!parser_->debug()){ DCCTBBlockPrototype::increment(numb); }
        else {
                for(uint32_t counter=0; counter<numb; counter++, dataP_++,wordCounter_++){
                        uint32_t blockID = (*dataP_)>>BPOSITION_BLOCKID;
                        if( blockID != BLOCKID ){
                                (errors_["SRP::BLOCKID"])++;
                                //errorString_ += std::string("\n") + parser_->index(nunb)+(" blockId has value ") + parser_->getDecString(blockID);
                                //errorString  += std::string(", while ")+parser_->getDecString(BLOCKID)+std::string(" is expected");
                        }
                }
        }
        
        
}

Member Data Documentation

Definition at line 49 of file DCCSRPBlock.h.

Referenced by dataCheck().