CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SiPixelFrameConverter Class Reference

#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 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.

15  : theFedId(fedId), theMap(map)
16 { }
const SiPixelFedCabling * theMap

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.

20 {
21  std::vector<CablingPathToDetUnit> paths = theMap->pathToDetUnit(rawId);
22  typedef std::vector<CablingPathToDetUnit>::const_iterator IT;
23  for (IT it=paths.begin(); it!=paths.end();++it) {
24  if(it->fed==static_cast<unsigned int>(theFedId)) return true;
25  }
26  return false;
27 }
virtual std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const =0
std::vector< LinkConnSpec >::const_iterator IT
const SiPixelFedCabling * theMap
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, scaleCards::path, SiPixelFedCabling::pathToDetUnit(), sipixelobjects::LocalPixel::pxid(), sipixelobjects::DetectorIndex::rawId, sipixelobjects::PixelROC::rawId(), sipixelobjects::DetectorIndex::row, theMap, sipixelobjects::PixelROC::toLocal(), and sipixelobjects::LocalPixel::valid().

Referenced by SiPixelSCurveCalibrationAnalysis::makeThresholdSummary().

58 {
59  std::vector<CablingPathToDetUnit> path = theMap->pathToDetUnit(detector.rawId);
60  typedef std::vector<CablingPathToDetUnit>::const_iterator IT;
61  for (IT it = path.begin(); it != path.end(); ++it) {
62  const PixelROC * roc = theMap->findItem(*it);
63  if (!roc) return 2;
64  if (! roc->rawId() == detector.rawId) return 3;
65 
66  GlobalPixel global = {detector.row, detector.col};
67  //LogTrace("")<<"GLOBAL PIXEL: row=" << global.row <<" col="<< global.col;
68 
69  LocalPixel local = roc->toLocal(global);
70  // LogTrace("")<<"LOCAL PIXEL: dcol ="
71  //<< local.dcol()<<" pxid="<< local.pxid()<<" inside: " <<local.valid();
72 
73  if(!local.valid()) continue;
74  ElectronicIndex cabIdx = {it->link, it->roc, local.dcol(), local.pxid()};
75  cabling = cabIdx;
76  return 0;
77  }
78  return 1;
79 }
virtual const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &) const =0
virtual std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const =0
identify pixel inside single ROC
Definition: LocalPixel.h:7
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
list path
Definition: scaleCards.py:51
LocalPixel toLocal(const GlobalPixel &gp) const
Definition: PixelROC.cc:54
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:40
std::vector< LinkConnSpec >::const_iterator IT
const SiPixelFedCabling * theMap
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, scaleCards::path, sipixelobjects::ElectronicIndex::pxid, sipixelobjects::DetectorIndex::rawId, sipixelobjects::PixelROC::rawId(), sipixelobjects::ElectronicIndex::roc, sipixelobjects::GlobalPixel::row, sipixelobjects::DetectorIndex::row, theFedId, theMap, sipixelobjects::PixelROC::toGlobal(), and sipixelobjects::LocalPixel::DcolPxid::valid().

Referenced by ErrorChecker::errorDetId(), and PixelDataFormatter::word2digi().

31 {
32  CablingPathToDetUnit path = {theFedId, cabling.link, cabling.roc };
33  const PixelROC * roc = theMap->findItem(path);
34  if (!roc){
35  stringstream stm;
36  stm << "Map shows no fed="<<theFedId
37  <<", link="<<cabling.link
38  <<", roc="<<cabling.roc;
39  edm::LogWarning("SiPixelFrameConverter") << stm.str();
40  return 2;
41  }
42  LocalPixel::DcolPxid local = { cabling.dcol, cabling.pxid };
43  if (!local.valid()) return 3;
44 
45  GlobalPixel global = roc->toGlobal( LocalPixel(local) );
46  detector.rawId = roc->rawId();
47  detector.row = global.row;
48  detector.col = global.col;
49 
50  return 0;
51 
52 
53 }
GlobalPixel toGlobal(const LocalPixel &loc) const
Definition: PixelROC.cc:44
virtual const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &) const =0
identify pixel inside single ROC
Definition: LocalPixel.h:7
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
list path
Definition: scaleCards.py:51
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:40
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:22
const SiPixelFedCabling * theMap

Member Data Documentation

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().