#include <PixelDataFormatter.h>
Public Types | |
using | BadChannels = std::map< cms_uint32_t, DetBadChannels > |
using | Collection = edm::DetSetVector< PixelDigi > |
using | DetBadChannels = std::vector< PixelFEDChannel > |
using | DetDigis = std::vector< PixelDigi > |
using | DetErrors = std::vector< SiPixelRawDataError > |
using | Digis = std::map< cms_uint32_t, DetDigis > |
using | Errors = std::map< cms_uint32_t, DetErrors > |
using | FEDWordsMap = std::map< int, std::vector< Word32 > > |
using | ModuleIDSet = std::set< unsigned int > |
using | RawData = std::map< int, FEDRawData > |
Public Member Functions | |
void | formatRawData (unsigned int lvl1_ID, RawData &fedRawData, const Digis &digis, const BadChannels &badChannels) |
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 SiPixelFedCablingTree *map, bool phase1_=false) | |
void | setErrorStatus (bool ErrorStatus) |
void | setModulesToUnpack (const ModuleIDSet *moduleIds) |
void | setQualityStatus (bool QualityStatus, const SiPixelQuality *QualityInfo) |
void | unpackFEDErrors (Errors const &errors, std::vector< int > const &tkerrorlist, std::vector< int > const &usererrorlist, edm::DetSetVector< SiPixelRawDataError > &errorcollection, DetIdCollection &tkerror_detidcollection, DetIdCollection &usererror_detidcollection, edmNew::DetSetVector< PixelFEDChannel > &disabled_channelcollection, DetErrors &nodeterrors) |
Private Member Functions | |
int | checkError (const Word32 &data) const |
int | digi2word (cms_uint32_t detId, const PixelDigi &digi, FEDWordsMap &words) const |
int | digi2wordPhase1Layer1 (cms_uint32_t detId, const PixelDigi &digi, FEDWordsMap &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 |
Private Attributes | |
int | allDetDigis_ |
const SiPixelQuality * | badPixelInfo_ |
std::unique_ptr< ErrorCheckerBase > | errorcheck_ |
int | hasDetDigis_ |
bool | includeErrors_ |
int | maxROCIndex_ |
const ModuleIDSet * | modulesToUnpack_ |
bool | phase1_ |
SiPixelFedCablingTree const * | theCablingTree_ |
int | theDigiCounter_ |
const SiPixelFrameReverter * | theFrameReverter_ |
int | theWordCounter_ |
bool | useQualityInfo_ |
Transforms Pixel raw data of a given FED to orca digi and vice versa.
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 61 of file PixelDataFormatter.h.
using PixelDataFormatter::BadChannels = std::map<cms_uint32_t, DetBadChannels> |
Definition at line 70 of file PixelDataFormatter.h.
Definition at line 65 of file PixelDataFormatter.h.
using PixelDataFormatter::DetBadChannels = std::vector<PixelFEDChannel> |
Definition at line 69 of file PixelDataFormatter.h.
using PixelDataFormatter::DetDigis = std::vector<PixelDigi> |
Definition at line 67 of file PixelDataFormatter.h.
using PixelDataFormatter::DetErrors = std::vector<SiPixelRawDataError> |
Definition at line 63 of file PixelDataFormatter.h.
using PixelDataFormatter::Digis = std::map<cms_uint32_t, DetDigis> |
Definition at line 68 of file PixelDataFormatter.h.
using PixelDataFormatter::Errors = std::map<cms_uint32_t, DetErrors> |
Definition at line 64 of file PixelDataFormatter.h.
using PixelDataFormatter::FEDWordsMap = std::map<int, std::vector<Word32> > |
Definition at line 71 of file PixelDataFormatter.h.
using PixelDataFormatter::ModuleIDSet = std::set<unsigned int> |
Definition at line 72 of file PixelDataFormatter.h.
using PixelDataFormatter::RawData = std::map<int, FEDRawData> |
Definition at line 66 of file PixelDataFormatter.h.
PixelDataFormatter::PixelDataFormatter | ( | const SiPixelFedCablingTree * | map, |
bool | phase1_ = false |
||
) |
Definition at line 28 of file PixelDataFormatter.cc.
References allDetDigis_, errorcheck_, hasDetDigis_, includeErrors_, maxROCIndex_, phase1_, and useQualityInfo_.
|
private |
|
private |
Definition at line 327 of file PixelDataFormatter.cc.
References PixelDigi::adc(), sipixelconstants::ADC_shift, PixelDigi::column(), sipixelobjects::ElectronicIndex::dcol, sipixelconstants::DCOL_shift, hgcalTestNeighbor_cfi::detector, l1tstage2_dqm_sourceclient-live_cfg::fedId, sipixelobjects::ElectronicIndex::link, sipixelconstants::LINK_shift, LogDebug, print(), sipixelobjects::ElectronicIndex::pxid, sipixelconstants::PXID_shift, sipixelobjects::ElectronicIndex::roc, sipixelconstants::ROC_shift, PixelDigi::row(), theFrameReverter_, theWordCounter_, and SiPixelFrameReverter::toCabling().
Referenced by formatRawData().
|
private |
Definition at line 345 of file PixelDataFormatter.cc.
References PixelDigi::adc(), sipixelconstants::ADC_shift, cuy::col, sipixelconstants::phase1layer1::COL_shift, PixelDigi::column(), sipixelobjects::ElectronicIndex::dcol, hgcalTestNeighbor_cfi::detector, l1tstage2_dqm_sourceclient-live_cfg::fedId, sipixelobjects::ElectronicIndex::link, sipixelconstants::LINK_shift, LogDebug, phase1PixelTopology::numRowsInRoc, print(), sipixelobjects::ElectronicIndex::pxid, sipixelobjects::ElectronicIndex::roc, sipixelconstants::ROC_shift, PixelDigi::row(), sipixelconstants::phase1layer1::ROW_shift, theFrameReverter_, theWordCounter_, and SiPixelFrameReverter::toCabling().
Referenced by formatRawData().
|
private |
Referenced by unpackFEDErrors().
void PixelDataFormatter::formatRawData | ( | unsigned int | lvl1_ID, |
RawData & | fedRawData, | ||
const Digis & | digis, | ||
const BadChannels & | badChannels | ||
) |
Definition at line 224 of file PixelDataFormatter.cc.
References allDetDigis_, Reference_intrackfit_cff::barrel, digi2word(), digi2wordPhase1Layer1(), Exception, l1tstage2_dqm_sourceclient-live_cfg::fedId, l1t_dqm_sourceclient-live_cfg::fedRawData, sipixelconstants::functions::getLink(), hasDetDigis_, mps_fire::i, PixelModuleName::isBarrel(), phase1PixelTopology::layer, sipixelconstants::LINK_shift, LogDebug, LogTrace, phase1_, print(), push_back(), l1tstage2_dqm_sourceclient-live_cfg::rawData, sipixelconstants::ROC_shift, alignCSCRings::s, FEDHeader::set(), FEDTrailer::set(), theDigiCounter_, and theWordCounter_.
void PixelDataFormatter::interpretRawData | ( | bool & | errorsInEvent, |
int | fedId, | ||
const FEDRawData & | data, | ||
Collection & | digis, | ||
Errors & | errors | ||
) |
Definition at line 71 of file PixelDataFormatter.cc.
References gpuClustering::adc, badPixelInfo_, Reference_intrackfit_cff::barrel, sipixelobjects::GlobalPixel::col, cuy::col, edm::DetSet< T >::data, errorcheck_, funct::false, l1tstage2_dqm_sourceclient-live_cfg::fedId, edm::DetSetVector< T >::find_or_insert(), sipixelconstants::functions::getADC(), sipixelconstants::functions::getCol(), sipixelconstants::functions::getDCol(), sipixelconstants::functions::getLink(), sipixelconstants::functions::getPxId(), sipixelconstants::functions::getROC(), sipixelconstants::functions::getRow(), RecoTauValidation_cfi::header, sipixelobjects::PixelROC::idInDetUnit(), PixelModuleName::isBarrel(), SiPixelQuality::IsRocBad(), phase1PixelTopology::layer, LIKELY, MainPageGenerator::link, DTRecHitClients_cfi::local, LogDebug, LogTrace, maxROCIndex_, modulesToUnpack_, nWords(), phase1_, print(), l1tstage2_dqm_sourceclient-live_cfg::rawData, sipixelobjects::PixelROC::rawId(), PixelMapPlotter::roc, sipixelobjects::GlobalPixel::row, theCablingTree_, theWordCounter_, sipixelobjects::PixelROC::toGlobal(), UNLIKELY, useQualityInfo_, sipixelobjects::LocalPixel::RocRowCol::valid(), and sipixelobjects::LocalPixel::DcolPxid::valid().
|
inline |
|
inline |
Definition at line 82 of file PixelDataFormatter.h.
References theWordCounter_.
Referenced by interpretRawData().
void PixelDataFormatter::passFrameReverter | ( | const SiPixelFrameReverter * | reverter | ) |
Definition at line 69 of file PixelDataFormatter.cc.
References theFrameReverter_.
|
private |
Definition at line 367 of file PixelDataFormatter.cc.
References PixelDigi::adc(), PixelDigi::column(), PixelDigi::row(), and str.
Referenced by digi2word(), digi2wordPhase1Layer1(), formatRawData(), and interpretRawData().
|
private |
void PixelDataFormatter::setErrorStatus | ( | bool | ErrorStatus | ) |
Definition at line 57 of file PixelDataFormatter.cc.
References errorcheck_, and includeErrors_.
void PixelDataFormatter::setModulesToUnpack | ( | const ModuleIDSet * | moduleIds | ) |
Definition at line 67 of file PixelDataFormatter.cc.
References modulesToUnpack_.
void PixelDataFormatter::setQualityStatus | ( | bool | QualityStatus, |
const SiPixelQuality * | QualityInfo | ||
) |
Definition at line 62 of file PixelDataFormatter.cc.
References badPixelInfo_, and useQualityInfo_.
void PixelDataFormatter::unpackFEDErrors | ( | PixelDataFormatter::Errors const & | errors, |
std::vector< int > const & | tkerrorlist, | ||
std::vector< int > const & | usererrorlist, | ||
edm::DetSetVector< SiPixelRawDataError > & | errorcollection, | ||
DetIdCollection & | tkerror_detidcollection, | ||
DetIdCollection & | usererror_detidcollection, | ||
edmNew::DetSetVector< PixelFEDChannel > & | disabled_channelcollection, | ||
DetErrors & | nodeterrors | ||
) |
Definition at line 379 of file PixelDataFormatter.cc.
References edm::DetSet< T >::data, sipixelconstants::dummyDetId, errorDetId(), SiPixelFedCablingTree::fed(), l1tstage2_dqm_sourceclient-live_cfg::fedId, spr::find(), edm::DetSetVector< T >::find_or_insert(), sipixelconstants::functions::getLink(), sipixelobjects::PixelFEDCabling::id(), edmNew::DetSetVector< T >::insert(), sipixelobjects::PixelFEDCabling::link(), MainPageGenerator::link, phase1_, edm::EDCollection< T >::push_back(), PixelMapPlotter::roc, PixelFEDChannel::roc_first, PixelFEDChannel::roc_last, and theCablingTree_.
|
private |
Definition at line 108 of file PixelDataFormatter.h.
Referenced by formatRawData(), and PixelDataFormatter().
|
private |
Definition at line 103 of file PixelDataFormatter.h.
Referenced by interpretRawData(), and setQualityStatus().
|
private |
Definition at line 110 of file PixelDataFormatter.h.
Referenced by interpretRawData(), PixelDataFormatter(), and setErrorStatus().
|
private |
Definition at line 109 of file PixelDataFormatter.h.
Referenced by formatRawData(), and PixelDataFormatter().
|
private |
Definition at line 106 of file PixelDataFormatter.h.
Referenced by PixelDataFormatter(), and setErrorStatus().
|
private |
Definition at line 112 of file PixelDataFormatter.h.
Referenced by interpretRawData(), and PixelDataFormatter().
|
private |
Definition at line 104 of file PixelDataFormatter.h.
Referenced by interpretRawData(), and setModulesToUnpack().
|
private |
Definition at line 113 of file PixelDataFormatter.h.
Referenced by formatRawData(), interpretRawData(), PixelDataFormatter(), and unpackFEDErrors().
|
private |
Definition at line 101 of file PixelDataFormatter.h.
Referenced by interpretRawData(), and unpackFEDErrors().
|
mutableprivate |
Definition at line 98 of file PixelDataFormatter.h.
Referenced by formatRawData(), and nDigis().
|
private |
Definition at line 102 of file PixelDataFormatter.h.
Referenced by digi2word(), digi2wordPhase1Layer1(), and passFrameReverter().
|
mutableprivate |
Definition at line 99 of file PixelDataFormatter.h.
Referenced by digi2word(), digi2wordPhase1Layer1(), formatRawData(), interpretRawData(), and nWords().
|
private |
Definition at line 107 of file PixelDataFormatter.h.
Referenced by interpretRawData(), PixelDataFormatter(), and setQualityStatus().