#include <SiPixelFrameConverter.h>
Public Member Functions | |
bool | hasDetUnit (uint32_t radId) const |
SiPixelFrameConverter (const SiPixelFedCabling *map, int fedId) | |
int | toCabling (sipixelobjects::ElectronicIndex &cabling, const sipixelobjects::DetectorIndex &detector) const |
int | toDetector (const sipixelobjects::ElectronicIndex &cabling, sipixelobjects::DetectorIndex &detector) const |
Private Attributes | |
int | theFedId |
const SiPixelFedCabling * | theMap |
Definition at line 12 of file SiPixelFrameConverter.h.
SiPixelFrameConverter::SiPixelFrameConverter | ( | const SiPixelFedCabling * | map, |
int | fedId | ||
) |
Definition at line 14 of file SiPixelFrameConverter.cc.
bool SiPixelFrameConverter::hasDetUnit | ( | uint32_t | radId | ) | const |
Definition at line 19 of file SiPixelFrameConverter.cc.
References EgammaValidation_cff::paths, SiPixelFedCabling::pathToDetUnit(), theFedId, and theMap.
{ std::vector<CablingPathToDetUnit> paths = theMap->pathToDetUnit(rawId); typedef std::vector<CablingPathToDetUnit>::const_iterator IT; for (IT it=paths.begin(); it!=paths.end();++it) { if(it->fed==static_cast<unsigned int>(theFedId)) return true; } return false; }
int SiPixelFrameConverter::toCabling | ( | sipixelobjects::ElectronicIndex & | cabling, |
const sipixelobjects::DetectorIndex & | detector | ||
) | const |
Definition at line 56 of file SiPixelFrameConverter.cc.
References sipixelobjects::DetectorIndex::col, sipixelobjects::LocalPixel::dcol(), SiPixelFedCabling::findItem(), sipixelobjects::ElectronicIndex::link, path(), SiPixelFedCabling::pathToDetUnit(), sipixelobjects::LocalPixel::pxid(), sipixelobjects::PixelROC::rawId(), sipixelobjects::DetectorIndex::rawId, sipixelobjects::DetectorIndex::row, theMap, sipixelobjects::PixelROC::toLocal(), and sipixelobjects::LocalPixel::valid().
Referenced by SiPixelSCurveCalibrationAnalysis::makeThresholdSummary().
{ std::vector<CablingPathToDetUnit> path = theMap->pathToDetUnit(detector.rawId); typedef std::vector<CablingPathToDetUnit>::const_iterator IT; for (IT it = path.begin(); it != path.end(); ++it) { const PixelROC * roc = theMap->findItem(*it); if (!roc) return 2; if (! roc->rawId() == detector.rawId) return 3; GlobalPixel global = {detector.row, detector.col}; //LogTrace("")<<"GLOBAL PIXEL: row=" << global.row <<" col="<< global.col; LocalPixel local = roc->toLocal(global); // LogTrace("")<<"LOCAL PIXEL: dcol =" //<< local.dcol()<<" pxid="<< local.pxid()<<" inside: " <<local.valid(); if(!local.valid()) continue; ElectronicIndex cabIdx = {it->link, it->roc, local.dcol(), local.pxid()}; cabling = cabIdx; return 0; } return 1; }
int SiPixelFrameConverter::toDetector | ( | const sipixelobjects::ElectronicIndex & | cabling, |
sipixelobjects::DetectorIndex & | detector | ||
) | const |
Definition at line 30 of file SiPixelFrameConverter.cc.
References sipixelobjects::GlobalPixel::col, sipixelobjects::DetectorIndex::col, sipixelobjects::ElectronicIndex::dcol, SiPixelFedCabling::findItem(), sipixelobjects::ElectronicIndex::link, path(), sipixelobjects::ElectronicIndex::pxid, sipixelobjects::PixelROC::rawId(), sipixelobjects::DetectorIndex::rawId, sipixelobjects::ElectronicIndex::roc, sipixelobjects::DetectorIndex::row, sipixelobjects::GlobalPixel::row, theFedId, theMap, sipixelobjects::PixelROC::toGlobal(), and sipixelobjects::LocalPixel::DcolPxid::valid().
Referenced by ErrorChecker::errorDetId(), and PixelDataFormatter::word2digi().
{ CablingPathToDetUnit path = {theFedId, cabling.link, cabling.roc }; const PixelROC * roc = theMap->findItem(path); if (!roc){ stringstream stm; stm << "Map shows no fed="<<theFedId <<", link="<<cabling.link <<", roc="<<cabling.roc; edm::LogWarning("SiPixelFrameConverter") << stm.str(); return 2; } LocalPixel::DcolPxid local = { cabling.dcol, cabling.pxid }; if (!local.valid()) return 3; GlobalPixel global = roc->toGlobal( LocalPixel(local) ); detector.rawId = roc->rawId(); detector.row = global.row; detector.col = global.col; return 0; }
int SiPixelFrameConverter::theFedId [private] |
Definition at line 27 of file SiPixelFrameConverter.h.
Referenced by hasDetUnit(), and toDetector().
const SiPixelFedCabling* SiPixelFrameConverter::theMap [private] |
Definition at line 28 of file SiPixelFrameConverter.h.
Referenced by hasDetUnit(), toCabling(), and toDetector().