#include <CTPPSPixelDataFormatter.h>
Classes | |
struct | PPSPixelIndex |
Public Types | |
typedef edm::DetSetVector< CTPPSPixelDigi > | Collection |
typedef std::vector< CTPPSPixelDigi > | DetDigis |
typedef std::vector< CTPPSPixelDataError > | DetErrors |
typedef std::unordered_map< cms_uint32_t, DetDigis > | Digis |
typedef std::map< uint32_t, DetErrors > | Errors |
typedef std::unordered_map< int, FEDRawData > | RawData |
typedef uint32_t | Word32 |
typedef uint64_t | Word64 |
Public Member Functions | |
CTPPSPixelDataFormatter (std::map< CTPPSPixelFramePosition, CTPPSPixelROCInfo > const &mapping) | |
void | formatRawData (unsigned int lvl1_ID, RawData &fedRawData, const Digis &digis, std::vector< PPSPixelIndex > v_iDdet2fed) |
void | interpretRawData (bool &errorsInEvent, int fedId, const FEDRawData &data, Collection &digis, Errors &errors) |
int | nDigis () const |
int | nWords () const |
void | setErrorStatus (bool theErrorStatus) |
Static Public Member Functions | |
static bool | compare (const PPSPixelIndex &a, const PPSPixelIndex &b) |
Private Member Functions | |
int | checkError (const Word32 &data) const |
std::string | print (const Word64 &word) const |
Private Attributes | |
Word32 | m_ADC_mask |
int | m_ADC_shift |
int | m_allDetDigis |
Word32 | m_DCOL_mask |
int | m_DCOL_shift |
int | m_DigiCounter |
RPixErrorChecker | m_ErrorCheck |
int | m_hasDetDigis |
bool | m_IncludeErrors |
CTPPSPixelIndices | m_Indices |
Word32 | m_LINK_mask |
int | m_LINK_shift |
const std::map< CTPPSPixelFramePosition, CTPPSPixelROCInfo > & | m_Mapping |
Word32 | m_PXID_mask |
int | m_PXID_shift |
Word32 | m_ROC_mask |
int | m_ROC_shift |
int | m_WordCounter |
Transform CTPPSPixel raw data of a given FED to digi
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 CTPPSPixelDataFormatter interpret/format ONLY detector data words (not FED headers or trailer, which are treated elsewhere).
Definition at line 53 of file CTPPSPixelDataFormatter.h.
Definition at line 55 of file CTPPSPixelDataFormatter.h.
typedef std::vector<CTPPSPixelDigi> CTPPSPixelDataFormatter::DetDigis |
Definition at line 58 of file CTPPSPixelDataFormatter.h.
typedef std::vector<CTPPSPixelDataError> CTPPSPixelDataFormatter::DetErrors |
Definition at line 60 of file CTPPSPixelDataFormatter.h.
typedef std::unordered_map<cms_uint32_t, DetDigis> CTPPSPixelDataFormatter::Digis |
Definition at line 66 of file CTPPSPixelDataFormatter.h.
typedef std::map<uint32_t, DetErrors> CTPPSPixelDataFormatter::Errors |
Definition at line 61 of file CTPPSPixelDataFormatter.h.
typedef std::unordered_map<int, FEDRawData> CTPPSPixelDataFormatter::RawData |
Definition at line 57 of file CTPPSPixelDataFormatter.h.
typedef uint32_t CTPPSPixelDataFormatter::Word32 |
Definition at line 63 of file CTPPSPixelDataFormatter.h.
typedef uint64_t CTPPSPixelDataFormatter::Word64 |
Definition at line 64 of file CTPPSPixelDataFormatter.h.
CTPPSPixelDataFormatter::CTPPSPixelDataFormatter | ( | std::map< CTPPSPixelFramePosition, CTPPSPixelROCInfo > const & | mapping | ) |
Definition at line 33 of file CTPPSPixelDataFormatter.cc.
References m_ADC_mask, m_ADC_shift, m_DCOL_mask, m_DCOL_shift, m_LINK_mask, m_LINK_shift, m_PXID_mask, m_PXID_shift, m_ROC_mask, and m_ROC_shift.
|
private |
|
inlinestatic |
Definition at line 91 of file CTPPSPixelDataFormatter.h.
Referenced by formatRawData(), and CTPPSPixelDigiToRaw::produce().
void CTPPSPixelDataFormatter::formatRawData | ( | unsigned int | lvl1_ID, |
RawData & | fedRawData, | ||
const Digis & | digis, | ||
std::vector< PPSPixelIndex > | v_iDdet2fed | ||
) |
Definition at line 190 of file CTPPSPixelDataFormatter.cc.
References compare(), pps::pixel::ElectronicIndex::dcol, CTPPSPixelIndices::DColumn(), Exception, l1tstage2_dqm_sourceclient-live_cfg::fedId, l1t_dqm_sourceclient-live_cfg::fedRawData, mps_fire::i, pps::pixel::ElectronicIndex::link, LogDebug, LogTrace, m_ADC_shift, m_allDetDigis, m_DCOL_shift, m_hasDetDigis, m_Indices, m_LINK_shift, m_PXID_shift, m_ROC_shift, m_WordCounter, print(), pps::pixel::ElectronicIndex::pxid, FastTimerService_cff::range, l1tstage2_dqm_sourceclient-live_cfg::rawData, pps::pixel::ElectronicIndex::roc, alignCSCRings::s, FEDHeader::set(), FEDTrailer::set(), and CTPPSPixelIndices::transformToROC().
Referenced by CTPPSPixelDigiToRaw::produce().
void CTPPSPixelDataFormatter::interpretRawData | ( | bool & | errorsInEvent, |
int | fedId, | ||
const FEDRawData & | data, | ||
Collection & | digis, | ||
Errors & | errors | ||
) |
check CRC bit
check headers
check trailers
data words
Definition at line 63 of file CTPPSPixelDataFormatter.cc.
References ecalMGPA::adc(), RPixErrorChecker::checkCRC(), RPixErrorChecker::checkHeader(), RPixErrorChecker::checkROC(), RPixErrorChecker::checkTrailer(), RPixErrorChecker::conversionError(), edm::DetSet< T >::data, RPixErrorChecker::dummyDetId, funct::false, l1tstage2_dqm_sourceclient-live_cfg::fedId, edm::DetSetVector< T >::find_or_insert(), RecoTauValidation_cfi::header, CTPPSPixelROCInfo::iD, InvalidLinkId, InvalidPixelId, InvalidROCId, LIKELY, MainPageGenerator::link, LogTrace, m_ADC_mask, m_ADC_shift, m_DCOL_mask, m_DCOL_shift, m_ErrorCheck, m_LINK_mask, m_LINK_shift, m_Mapping, m_PXID_mask, m_PXID_shift, m_ROC_mask, m_ROC_shift, m_WordCounter, nWords(), print(), l1tstage2_dqm_sourceclient-live_cfg::rawData, CTPPSPixelROC::rawId(), CTPPSPixelROCInfo::roc, PixelMapPlotter::roc, CTPPSPixelROC::toGlobalfromDcol(), reco::Unknown, and UNLIKELY.
Referenced by CTPPSPixelRawToDigi::produce().
|
inline |
Definition at line 76 of file CTPPSPixelDataFormatter.h.
References m_DigiCounter.
Referenced by CTPPSPixelDigiToRaw::produce().
|
inline |
Definition at line 72 of file CTPPSPixelDataFormatter.h.
References m_WordCounter.
Referenced by interpretRawData(), and CTPPSPixelDigiToRaw::produce().
|
private |
Definition at line 282 of file CTPPSPixelDataFormatter.cc.
References str.
Referenced by formatRawData(), and interpretRawData().
void CTPPSPixelDataFormatter::setErrorStatus | ( | bool | theErrorStatus | ) |
Definition at line 58 of file CTPPSPixelDataFormatter.cc.
References m_ErrorCheck, m_IncludeErrors, and RPixErrorChecker::setErrorStatus().
Referenced by CTPPSPixelRawToDigi::produce().
|
private |
Definition at line 102 of file CTPPSPixelDataFormatter.h.
Referenced by CTPPSPixelDataFormatter(), and interpretRawData().
|
private |
Definition at line 101 of file CTPPSPixelDataFormatter.h.
Referenced by CTPPSPixelDataFormatter(), formatRawData(), and interpretRawData().
|
private |
Definition at line 111 of file CTPPSPixelDataFormatter.h.
Referenced by formatRawData().
|
private |
Definition at line 102 of file CTPPSPixelDataFormatter.h.
Referenced by CTPPSPixelDataFormatter(), and interpretRawData().
|
private |
Definition at line 101 of file CTPPSPixelDataFormatter.h.
Referenced by CTPPSPixelDataFormatter(), formatRawData(), and interpretRawData().
|
private |
Definition at line 110 of file CTPPSPixelDataFormatter.h.
Referenced by nDigis().
|
private |
Definition at line 99 of file CTPPSPixelDataFormatter.h.
Referenced by interpretRawData(), and setErrorStatus().
|
private |
Definition at line 112 of file CTPPSPixelDataFormatter.h.
Referenced by formatRawData().
|
private |
Definition at line 98 of file CTPPSPixelDataFormatter.h.
Referenced by setErrorStatus().
|
private |
Definition at line 113 of file CTPPSPixelDataFormatter.h.
Referenced by formatRawData().
|
private |
Definition at line 102 of file CTPPSPixelDataFormatter.h.
Referenced by CTPPSPixelDataFormatter(), and interpretRawData().
|
private |
Definition at line 101 of file CTPPSPixelDataFormatter.h.
Referenced by CTPPSPixelDataFormatter(), formatRawData(), and interpretRawData().
|
private |
Definition at line 108 of file CTPPSPixelDataFormatter.h.
Referenced by interpretRawData().
|
private |
Definition at line 102 of file CTPPSPixelDataFormatter.h.
Referenced by CTPPSPixelDataFormatter(), and interpretRawData().
|
private |
Definition at line 101 of file CTPPSPixelDataFormatter.h.
Referenced by CTPPSPixelDataFormatter(), formatRawData(), and interpretRawData().
|
private |
Definition at line 102 of file CTPPSPixelDataFormatter.h.
Referenced by CTPPSPixelDataFormatter(), and interpretRawData().
|
private |
Definition at line 101 of file CTPPSPixelDataFormatter.h.
Referenced by CTPPSPixelDataFormatter(), formatRawData(), and interpretRawData().
|
private |
Definition at line 96 of file CTPPSPixelDataFormatter.h.
Referenced by formatRawData(), interpretRawData(), and nWords().