#include <SiPixelFrameReverter.h>
Public Member Functions | |
void | buildStructure (edm::EventSetup const &) |
int | findFedId (uint32_t detId) |
short | findLinkInFed (uint32_t detId, sipixelobjects::GlobalPixel global) |
sipixelobjects::LocalPixel | findPixelInRoc (uint32_t detId, sipixelobjects::GlobalPixel global) |
short | findRocInDet (uint32_t detId, sipixelobjects::GlobalPixel global) |
short | findRocInLink (uint32_t detId, sipixelobjects::GlobalPixel global) |
SiPixelFrameReverter (const edm::EventSetup &, const SiPixelFedCabling *map) | |
Private Attributes | |
std::map< uint32_t, std::vector < sipixelobjects::CablingPathToDetUnit > > | DetToFedMap |
const SiPixelFedCabling * | map_ |
Definition at line 18 of file SiPixelFrameReverter.h.
SiPixelFrameReverter::SiPixelFrameReverter | ( | const edm::EventSetup & | iSetup, |
const SiPixelFedCabling * | map | ||
) |
Definition at line 26 of file SiPixelFrameReverter.cc.
References buildStructure().
: map_(map) { // Build map buildStructure(iSetup); }
void SiPixelFrameReverter::buildStructure | ( | edm::EventSetup const & | iSetup | ) |
Definition at line 34 of file SiPixelFrameReverter.cc.
References DetToFedMap, edm::EventSetup::get(), map_, and SiPixelFedCabling::pathToDetUnit().
Referenced by SiPixelFrameReverter().
{ // Create map connecting each detId to appropriate SiPixelFrameConverter edm::ESHandle<TrackerGeometry> pDD; iSetup.get<TrackerDigiGeometryRecord>().get( pDD ); for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){ if(dynamic_cast<PixelGeomDetUnit*>((*it))!=0){ DetId detId = (*it)->geographicalId(); uint32_t id = detId(); std::vector<CablingPathToDetUnit> paths = map_->pathToDetUnit(id); DetToFedMap.insert(pair< uint32_t,std::vector<CablingPathToDetUnit> > (id,paths)); } } // for(TrackerGeometry::DetContainer::const_iterator } // end buildStructure
int SiPixelFrameReverter::findFedId | ( | uint32_t | detId | ) |
Definition at line 56 of file SiPixelFrameReverter.cc.
References DetToFedMap, and path().
{ std::vector<CablingPathToDetUnit> path = DetToFedMap[detId]; int fedId = (int) path[0].fed; return fedId; }
short SiPixelFrameReverter::findLinkInFed | ( | uint32_t | detId, |
sipixelobjects::GlobalPixel | global | ||
) |
Definition at line 64 of file SiPixelFrameReverter.cc.
References SiPixelFedCabling::findItem(), link(), map_, path(), SiPixelFedCabling::pathToDetUnit(), sipixelobjects::PixelROC::toLocal(), and sipixelobjects::LocalPixel::valid().
{ std::vector<CablingPathToDetUnit> path = map_->pathToDetUnit(detId); typedef std::vector<CablingPathToDetUnit>::const_iterator IT; for (IT it = path.begin(); it != path.end(); ++it) { const PixelROC * roc = map_->findItem(*it); if (!roc) continue; LocalPixel local = roc->toLocal(global); if(!local.valid()) continue; short link = (short) it->link; return link; } return -1; }
LocalPixel SiPixelFrameReverter::findPixelInRoc | ( | uint32_t | detId, |
sipixelobjects::GlobalPixel | global | ||
) |
Definition at line 118 of file SiPixelFrameReverter.cc.
References SiPixelFedCabling::findItem(), map_, path(), SiPixelFedCabling::pathToDetUnit(), sipixelobjects::PixelROC::toLocal(), and sipixelobjects::LocalPixel::valid().
{ std::vector<CablingPathToDetUnit> path = map_->pathToDetUnit(detId); typedef std::vector<CablingPathToDetUnit>::const_iterator IT; for (IT it = path.begin(); it != path.end(); ++it) { const PixelROC * roc = map_->findItem(*it); if (!roc) continue; LocalPixel local = roc->toLocal(global); if(!local.valid()) continue; return local; } LocalPixel::RocRowCol pixel = {-1,-1}; LocalPixel local(pixel); return local; }
short SiPixelFrameReverter::findRocInDet | ( | uint32_t | detId, |
sipixelobjects::GlobalPixel | global | ||
) |
Definition at line 100 of file SiPixelFrameReverter.cc.
References SiPixelFedCabling::findItem(), sipixelobjects::PixelROC::idInDetUnit(), map_, path(), SiPixelFedCabling::pathToDetUnit(), sipixelobjects::PixelROC::toLocal(), and sipixelobjects::LocalPixel::valid().
Referenced by SiPixelQuality::IsAreaBad().
{ std::vector<CablingPathToDetUnit> path = map_->pathToDetUnit(detId); typedef std::vector<CablingPathToDetUnit>::const_iterator IT; for (IT it = path.begin(); it != path.end(); ++it) { const PixelROC * roc = map_->findItem(*it); if (!roc) continue; LocalPixel local = roc->toLocal(global); if(!local.valid()) continue; short rocInDet = (short) roc->idInDetUnit(); return rocInDet; } return -1; }
short SiPixelFrameReverter::findRocInLink | ( | uint32_t | detId, |
sipixelobjects::GlobalPixel | global | ||
) |
Definition at line 82 of file SiPixelFrameReverter.cc.
References SiPixelFedCabling::findItem(), sipixelobjects::PixelROC::idInLink(), map_, path(), SiPixelFedCabling::pathToDetUnit(), sipixelobjects::PixelROC::toLocal(), and sipixelobjects::LocalPixel::valid().
{ std::vector<CablingPathToDetUnit> path = map_->pathToDetUnit(detId); typedef std::vector<CablingPathToDetUnit>::const_iterator IT; for (IT it = path.begin(); it != path.end(); ++it) { const PixelROC * roc = map_->findItem(*it); if (!roc) continue; LocalPixel local = roc->toLocal(global); if(!local.valid()) continue; short rocInLink = (short) roc->idInLink(); return rocInLink; } return -1; }
std::map< uint32_t,std::vector<sipixelobjects::CablingPathToDetUnit> > SiPixelFrameReverter::DetToFedMap [private] |
Definition at line 48 of file SiPixelFrameReverter.h.
Referenced by buildStructure(), and findFedId().
const SiPixelFedCabling* SiPixelFrameReverter::map_ [private] |
Definition at line 46 of file SiPixelFrameReverter.h.
Referenced by buildStructure(), findLinkInFed(), findPixelInRoc(), findRocInDet(), and findRocInLink().