CMS 3D CMS Logo

Public Member Functions | Private Attributes

SiPixelFrameConverter Class Reference

#include <SiPixelFrameConverter.h>

List of all members.

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 SiPixelFedCablingtheMap

Detailed Description

Definition at line 12 of file SiPixelFrameConverter.h.


Constructor & Destructor Documentation

SiPixelFrameConverter::SiPixelFrameConverter ( const SiPixelFedCabling map,
int  fedId 
)

Definition at line 14 of file SiPixelFrameConverter.cc.

  : theFedId(fedId), theMap(map)
{ }

Member Function Documentation

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, getHLTPrescaleColumns::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

Member Data Documentation

Definition at line 27 of file SiPixelFrameConverter.h.

Referenced by hasDetUnit(), and toDetector().

Definition at line 28 of file SiPixelFrameConverter.h.

Referenced by hasDetUnit(), toCabling(), and toDetector().