CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
DCCTBDataParser Class Reference

#include <DCCDataParser.h>

Public Types

enum  DCCDataParserGlobalFields { EMPTYEVENTSIZE = 32 }
 

Public Member Functions

std::pair< uint32_t, uint32_t > checkEventLength (uint32_t *pointerToEvent, uint32_t bytesToEnd, bool singleEvent=false)
 
std::vector< DCCTBEventBlock * > & dccEvents ()
 
uint32_t dccId ()
 
 DCCTBDataParser (const std::vector< uint32_t > &parserParameters, bool parseInternalData=true, bool debug=true)
 
bool debug ()
 
std::map< std::string, uint32_t > & errorCounters ()
 
std::vector< std::pair
< uint32_t, std::pair
< uint32_t *, uint32_t > > > 
events ()
 
uint32_t * getBuffer ()
 
std::string getDecString (uint32_t data)
 
std::string getHexString (uint32_t data)
 
std::string getIndexedData (uint32_t indexed, uint32_t *pointer)
 
std::string index (uint32_t position)
 
DCCTBDataMappermapper ()
 
uint32_t numbSRF ()
 
uint32_t numbTriggerSamples ()
 
uint32_t numbTTs ()
 
uint32_t numbXtalSamples ()
 
void parseBuffer (uint32_t *buffer, uint32_t bufferSize, bool singleEvent=false)
 
void parseFile (std::string fileName, bool singleEvent=false)
 
std::vector< uint32_t > parserParameters ()
 
void resetErrorCounters ()
 
void setParameters (const std::vector< uint32_t > &newParameters)
 
uint32_t srpBlockSize ()
 
uint32_t srpId ()
 
uint32_t tcc1Id ()
 
uint32_t tcc2Id ()
 
uint32_t tcc3Id ()
 
uint32_t tcc4Id ()
 
uint32_t tccBlockSize ()
 
 ~DCCTBDataParser ()
 

Protected Types

enum  DCCTBDataParserFields {
  EVENTLENGTHMASK = 0xFFFFFF, BOEBEGIN = 28, BOEMASK = 0xF, BOE =0x5,
  EOEBEGIN = 28, EOEMASK = 0xF, EOE =0xA
}
 

Protected Member Functions

void computeBlockSizes ()
 

Protected Attributes

uint32_t * buffer_
 
uint32_t bufferSize_
 
std::vector< DCCTBEventBlock * > dccEvents_
 
bool debug_
 
std::map< std::string, uint32_t > errors_
 
std::string eventErrors_
 
std::vector< std::pair
< uint32_t, std::pair
< uint32_t *, uint32_t > > > 
events_
 
DCCTBDataMappermapper_
 
std::vector< uint32_t > parameters
 
bool parseInternalData_
 
uint32_t processedEvent_
 
uint32_t srpBlockSize_
 
uint32_t tccBlockSize_
 

Detailed Description

Definition at line 27 of file DCCDataParser.h.

Member Enumeration Documentation

Enumerator
EMPTYEVENTSIZE 

Definition at line 138 of file DCCDataParser.h.

Enumerator
EVENTLENGTHMASK 
BOEBEGIN 
BOEMASK 
BOE 
EOEBEGIN 
EOEMASK 
EOE 

Definition at line 165 of file DCCDataParser.h.

Constructor & Destructor Documentation

DCCTBDataParser::DCCTBDataParser ( const std::vector< uint32_t > &  parserParameters,
bool  parseInternalData = true,
bool  debug = true 
)

Class constructor: takes a vector of 10 parameters and flags for parseInternalData and debug Parameters are: 0 - crystal samples (default is 10) 1 - number of trigger time samples (default is 1) 2 - number of TT (default is 68) 3 - number of SR Flags (default is 68) 4 - DCC id 5 - SR id [6-9] - TCC[6-9] id

Definition at line 9 of file DCCDataParser.cc.

DCCTBDataParser::~DCCTBDataParser ( )

Class destructor

Definition at line 347 of file DCCDataParser.cc.

Member Function Documentation

std::pair< uint32_t, uint32_t > DCCTBDataParser::checkEventLength ( uint32_t *  pointerToEvent,
uint32_t  bytesToEnd,
bool  singleEvent = false 
)

Check if EVENT LENGTH is coeherent and if BOE/EOE are correctly written returns 3 bits code with the error found + event length

Definition at line 218 of file DCCDataParser.cc.

void DCCTBDataParser::computeBlockSizes ( )
protected

Definition at line 35 of file DCCDataParser.cc.

std::vector< DCCTBEventBlock * > & DCCTBDataParser::dccEvents ( )
inline

Get method for DCCEventBlocks vector

Definition at line 199 of file DCCDataParser.h.

uint32_t DCCTBDataParser::dccId ( )
inline

Definition at line 186 of file DCCDataParser.h.

bool DCCTBDataParser::debug ( )
inline
std::map< std::string, uint32_t > & DCCTBDataParser::errorCounters ( )
inline

Get method for error counters map

Definition at line 200 of file DCCDataParser.h.

std::vector< std::pair< uint32_t, std::pair< uint32_t *, uint32_t > > > DCCTBDataParser::events ( )
inline

Get method for events

Definition at line 201 of file DCCDataParser.h.

Referenced by eventsfwlite.Events::__getattr__(), and eventsfwlite.Events::__init__().

uint32_t* DCCTBDataParser::getBuffer ( )
inline

Retrieves a pointer to the data buffer

Definition at line 131 of file DCCDataParser.h.

std::string DCCTBDataParser::getDecString ( uint32_t  data)

Methods to get data strings formatted as decimal/hexadecimal, indexes and indexed data

Definition at line 301 of file DCCDataParser.cc.

Referenced by DCCTBTCCBlock::dataCheck(), DCCTBTCCBlock::triggerFlags(), DCCTBTCCBlock::triggerSamples(), and DCCTBXtalBlock::xtalDataSamples().

std::string DCCTBDataParser::getHexString ( uint32_t  data)

Definition at line 315 of file DCCDataParser.cc.

std::string DCCTBDataParser::getIndexedData ( uint32_t  indexed,
uint32_t *  pointer 
)

Definition at line 328 of file DCCDataParser.cc.

std::string DCCTBDataParser::index ( uint32_t  position)

Definition at line 287 of file DCCDataParser.cc.

DCCTBDataMapper * DCCTBDataParser::mapper ( )
inline
uint32_t DCCTBDataParser::numbSRF ( )
inline

Definition at line 185 of file DCCDataParser.h.

Referenced by DCCTBSRPBlock::DCCTBSRPBlock().

uint32_t DCCTBDataParser::numbTriggerSamples ( )
inline

Definition at line 183 of file DCCDataParser.h.

uint32_t DCCTBDataParser::numbTTs ( )
inline
uint32_t DCCTBDataParser::numbXtalSamples ( )
inline

Definition at line 182 of file DCCDataParser.h.

Referenced by DCCTBXtalBlock::xtalDataSamples().

void DCCTBDataParser::parseBuffer ( uint32_t *  buffer,
uint32_t  bufferSize,
bool  singleEvent = false 
)

Parse data from a buffer

Definition at line 114 of file DCCDataParser.cc.

void DCCTBDataParser::parseFile ( std::string  fileName,
bool  singleEvent = false 
)

Parse data from file

Definition at line 61 of file DCCDataParser.cc.

std::vector< uint32_t > DCCTBDataParser::parserParameters ( )
inline

Get methods for parser parameters;

Definition at line 181 of file DCCDataParser.h.

void DCCTBDataParser::resetErrorCounters ( )

Reset Error Counters

Definition at line 23 of file DCCDataParser.cc.

void DCCTBDataParser::setParameters ( const std::vector< uint32_t > &  newParameters)
inline

Set method for parser parameters

Definition at line 193 of file DCCDataParser.h.

uint32_t DCCTBDataParser::srpBlockSize ( )
inline

Get methods for block sizes

Definition at line 195 of file DCCDataParser.h.

uint32_t DCCTBDataParser::srpId ( )
inline

Definition at line 187 of file DCCDataParser.h.

Referenced by DCCTBSRPBlock::dataCheck().

uint32_t DCCTBDataParser::tcc1Id ( )
inline

Definition at line 188 of file DCCDataParser.h.

uint32_t DCCTBDataParser::tcc2Id ( )
inline

Definition at line 189 of file DCCDataParser.h.

uint32_t DCCTBDataParser::tcc3Id ( )
inline

Definition at line 190 of file DCCDataParser.h.

uint32_t DCCTBDataParser::tcc4Id ( )
inline

Definition at line 191 of file DCCDataParser.h.

uint32_t DCCTBDataParser::tccBlockSize ( )
inline

Definition at line 196 of file DCCDataParser.h.

Member Data Documentation

uint32_t* DCCTBDataParser::buffer_
protected

Definition at line 145 of file DCCDataParser.h.

uint32_t DCCTBDataParser::bufferSize_
protected

Definition at line 146 of file DCCDataParser.h.

std::vector<DCCTBEventBlock *> DCCTBDataParser::dccEvents_
protected

Definition at line 155 of file DCCDataParser.h.

bool DCCTBDataParser::debug_
protected

Definition at line 161 of file DCCDataParser.h.

std::map<std::string,uint32_t> DCCTBDataParser::errors_
protected

Definition at line 162 of file DCCDataParser.h.

std::string DCCTBDataParser::eventErrors_
protected

Definition at line 152 of file DCCDataParser.h.

std::vector< std::pair< uint32_t, std::pair<uint32_t *, uint32_t> > > DCCTBDataParser::events_
protected

Definition at line 158 of file DCCDataParser.h.

DCCTBDataMapper* DCCTBDataParser::mapper_
protected

Definition at line 153 of file DCCDataParser.h.

std::vector<uint32_t> DCCTBDataParser::parameters
protected

Definition at line 163 of file DCCDataParser.h.

bool DCCTBDataParser::parseInternalData_
protected

Definition at line 160 of file DCCDataParser.h.

uint32_t DCCTBDataParser::processedEvent_
protected

Definition at line 151 of file DCCDataParser.h.

uint32_t DCCTBDataParser::srpBlockSize_
protected

Definition at line 148 of file DCCDataParser.h.

uint32_t DCCTBDataParser::tccBlockSize_
protected

Definition at line 149 of file DCCDataParser.h.