CMS 3D CMS Logo

Public Member Functions | Private Attributes

SiPixelFrameReverter Class Reference

#include <SiPixelFrameReverter.h>

List of all members.

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 SiPixelFedCablingmap_

Detailed Description

Definition at line 18 of file SiPixelFrameReverter.h.


Constructor & Destructor Documentation

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);
}

Member Function Documentation

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;
}

Member Data Documentation

std::map< uint32_t,std::vector<sipixelobjects::CablingPathToDetUnit> > SiPixelFrameReverter::DetToFedMap [private]

Definition at line 48 of file SiPixelFrameReverter.h.

Referenced by buildStructure(), and findFedId().