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 | Private Member Functions | Private Attributes
PixelDataFormatter Class Reference

#include <PixelDataFormatter.h>

Public Types

typedef edm::DetSetVector
< PixelDigi
Collection
 
typedef std::vector< PixelDigiDetDigis
 
typedef std::vector
< SiPixelRawDataError
DetErrors
 
typedef std::map< cms_uint32_t,
DetDigis
Digis
 
typedef std::map< cms_uint32_t,
DetErrors
Errors
 
typedef std::pair
< DetDigis::const_iterator,
DetDigis::const_iterator > 
Range
 
typedef std::map< int, FEDRawDataRawData
 
typedef cms_uint32_t Word32
 
typedef cms_uint64_t Word64
 

Public Member Functions

void formatRawData (unsigned int lvl1_ID, RawData &fedRawData, const Digis &digis)
 
void interpretRawData (bool &errorsInEvent, int fedId, const FEDRawData &data, Collection &digis, Errors &errors)
 
int nDigis () const
 
int nWords () const
 
void passFrameReverter (const SiPixelFrameReverter *reverter)
 
 PixelDataFormatter (const SiPixelFedCabling *map, bool phase1=false)
 
void setErrorStatus (bool ErrorStatus)
 
void setModulesToUnpack (const std::set< unsigned int > *moduleIds)
 
void setQualityStatus (bool QualityStatus, const SiPixelQuality *QualityInfo)
 

Private Member Functions

int checkError (const Word32 &data) const
 
int digi2word (cms_uint32_t detId, const PixelDigi &digi, std::map< int, std::vector< Word32 > > &words) const
 
cms_uint32_t errorDetId (const SiPixelFrameConverter *converter, int fedId, int errorType, const Word32 &word) const
 
std::string print (const PixelDigi &digi) const
 
std::string print (const Word64 &word) const
 
int word2digi (const int fedId, const SiPixelFrameConverter *converter, const bool includeError, const bool useQuality, const Word32 &word, Digis &digis) const
 

Private Attributes

Word32 ADC_mask
 
int ADC_shift
 
int allDetDigis
 
const SiPixelQualitybadPixelInfo
 
Word32 DCOL_mask
 
int DCOL_shift
 
bool debug
 
ErrorChecker errorcheck
 
int hasDetDigis
 
bool includeErrors
 
Word32 LINK_mask
 
int LINK_shift
 
int maxROCIndex
 
const std::set< unsigned int > * modulesToUnpack
 
Word32 PXID_mask
 
int PXID_shift
 
Word32 ROC_mask
 
int ROC_shift
 
SiPixelFedCabling const * theCablingTree
 
int theDigiCounter
 
const SiPixelFrameRevertertheFrameReverter
 
int theWordCounter
 
bool useQualityInfo
 

Detailed Description

Transforms Pixel raw data of a given FED to orca digi and vice versa.

FED OUTPUT DATA FORMAT 6/02, d.k. (11/02 updated for 100*150 pixels)

The output is transmitted through a 64 bit S-link connection. The packet format is defined by the CMS RU group to be : 1st packet header, 64 bits, includes a 6 bit FED id. 2nd packet header, 64 bits. .......................... (detector data) packet trailer, 64 bits. of the 64 bit pixel data records consists of 2 32 bit words. Each 32 bit word includes data from 1 pixel, the bit fields are the following:

6 bit link ID (max 36) - this defines the input link within 1 FED. 5 bit ROC ID (max 24) - this defines the readout chip within one link. 5 bit DCOL ID (max 26) - this defines the double column index with 1 chip. 8 bit pixel ID (max 180) - this defines the pixel address within 1 DCOL. 8 bit ADC vales - this has the charge amplitude.

So, 1 pixel occupies 4 bytes. If the number of pixels is odd, one extra 32 bit word is added (value 0) to fill all 64 bits.

The PixelDataFormatter interpret/format ONLY detector data words (not FED headers or trailer, which are treated elsewhere).

Definition at line 55 of file PixelDataFormatter.h.

Member Typedef Documentation

Definition at line 59 of file PixelDataFormatter.h.

Definition at line 62 of file PixelDataFormatter.h.

Definition at line 65 of file PixelDataFormatter.h.

Definition at line 63 of file PixelDataFormatter.h.

Definition at line 66 of file PixelDataFormatter.h.

typedef std::pair<DetDigis::const_iterator, DetDigis::const_iterator> PixelDataFormatter::Range

Definition at line 64 of file PixelDataFormatter.h.

typedef std::map<int, FEDRawData> PixelDataFormatter::RawData

Definition at line 61 of file PixelDataFormatter.h.

Definition at line 68 of file PixelDataFormatter.h.

Definition at line 69 of file PixelDataFormatter.h.

Constructor & Destructor Documentation

PixelDataFormatter::PixelDataFormatter ( const SiPixelFedCabling map,
bool  phase1 = false 
)

Definition at line 50 of file PixelDataFormatter.cc.

Member Function Documentation

int PixelDataFormatter::checkError ( const Word32 data) const
private
int PixelDataFormatter::digi2word ( cms_uint32_t  detId,
const PixelDigi digi,
std::map< int, std::vector< Word32 > > &  words 
) const
private

Definition at line 305 of file PixelDataFormatter.cc.

cms_uint32_t PixelDataFormatter::errorDetId ( const SiPixelFrameConverter converter,
int  fedId,
int  errorType,
const Word32 word 
) const
private
void PixelDataFormatter::formatRawData ( unsigned int  lvl1_ID,
RawData fedRawData,
const Digis digis 
)

Definition at line 237 of file PixelDataFormatter.cc.

void PixelDataFormatter::interpretRawData ( bool &  errorsInEvent,
int  fedId,
const FEDRawData data,
Collection digis,
Errors errors 
)

Definition at line 115 of file PixelDataFormatter.cc.

int PixelDataFormatter::nDigis ( ) const
inline

Definition at line 78 of file PixelDataFormatter.h.

References theDigiCounter.

78 { return theDigiCounter; }
int PixelDataFormatter::nWords ( ) const
inline

Definition at line 79 of file PixelDataFormatter.h.

References theWordCounter.

79 { return theWordCounter; }
void PixelDataFormatter::passFrameReverter ( const SiPixelFrameReverter reverter)

Definition at line 110 of file PixelDataFormatter.cc.

Referenced by SiPixelDigiToRaw::produce().

std::string PixelDataFormatter::print ( const PixelDigi digi) const
private

Definition at line 381 of file PixelDataFormatter.cc.

std::string PixelDataFormatter::print ( const Word64 word) const
private

Definition at line 388 of file PixelDataFormatter.cc.

void PixelDataFormatter::setErrorStatus ( bool  ErrorStatus)

Definition at line 93 of file PixelDataFormatter.cc.

void PixelDataFormatter::setModulesToUnpack ( const std::set< unsigned int > *  moduleIds)

Definition at line 105 of file PixelDataFormatter.cc.

void PixelDataFormatter::setQualityStatus ( bool  QualityStatus,
const SiPixelQuality QualityInfo 
)

Definition at line 99 of file PixelDataFormatter.cc.

int PixelDataFormatter::word2digi ( const int  fedId,
const SiPixelFrameConverter converter,
const bool  includeError,
const bool  useQuality,
const Word32 word,
Digis digis 
) const
private

Definition at line 331 of file PixelDataFormatter.cc.

Member Data Documentation

Word32 PixelDataFormatter::ADC_mask
private

Definition at line 103 of file PixelDataFormatter.h.

int PixelDataFormatter::ADC_shift
private

Definition at line 102 of file PixelDataFormatter.h.

int PixelDataFormatter::allDetDigis
private

Definition at line 97 of file PixelDataFormatter.h.

const SiPixelQuality* PixelDataFormatter::badPixelInfo
private

Definition at line 91 of file PixelDataFormatter.h.

Word32 PixelDataFormatter::DCOL_mask
private

Definition at line 103 of file PixelDataFormatter.h.

int PixelDataFormatter::DCOL_shift
private

Definition at line 102 of file PixelDataFormatter.h.

bool PixelDataFormatter::debug
private

Definition at line 96 of file PixelDataFormatter.h.

ErrorChecker PixelDataFormatter::errorcheck
private

Definition at line 99 of file PixelDataFormatter.h.

int PixelDataFormatter::hasDetDigis
private

Definition at line 98 of file PixelDataFormatter.h.

bool PixelDataFormatter::includeErrors
private

Definition at line 94 of file PixelDataFormatter.h.

Word32 PixelDataFormatter::LINK_mask
private

Definition at line 103 of file PixelDataFormatter.h.

int PixelDataFormatter::LINK_shift
private

Definition at line 102 of file PixelDataFormatter.h.

int PixelDataFormatter::maxROCIndex
private

Definition at line 104 of file PixelDataFormatter.h.

const std::set<unsigned int>* PixelDataFormatter::modulesToUnpack
private

Definition at line 92 of file PixelDataFormatter.h.

Word32 PixelDataFormatter::PXID_mask
private

Definition at line 103 of file PixelDataFormatter.h.

int PixelDataFormatter::PXID_shift
private

Definition at line 102 of file PixelDataFormatter.h.

Word32 PixelDataFormatter::ROC_mask
private

Definition at line 103 of file PixelDataFormatter.h.

int PixelDataFormatter::ROC_shift
private

Definition at line 102 of file PixelDataFormatter.h.

SiPixelFedCabling const* PixelDataFormatter::theCablingTree
private

Definition at line 89 of file PixelDataFormatter.h.

int PixelDataFormatter::theDigiCounter
mutableprivate

Definition at line 86 of file PixelDataFormatter.h.

Referenced by nDigis().

const SiPixelFrameReverter* PixelDataFormatter::theFrameReverter
private

Definition at line 90 of file PixelDataFormatter.h.

int PixelDataFormatter::theWordCounter
mutableprivate

Definition at line 87 of file PixelDataFormatter.h.

Referenced by nWords().

bool PixelDataFormatter::useQualityInfo
private

Definition at line 95 of file PixelDataFormatter.h.