CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
SiPixelFrameConverter Class Reference

#include <SiPixelFrameConverter.h>

Public Types

typedef sipixelobjects::PixelFEDCabling PixelFEDCabling
 

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
 
sipixelobjects::PixelROC const * toRoc (int link, int roc) const
 

Private Attributes

const PixelFEDCablingtheFed
 
int theFedId
 
const SiPixelFedCablingtheMap
 
SiPixelFedCablingTree const * theTree
 

Detailed Description

Definition at line 17 of file SiPixelFrameConverter.h.

Member Typedef Documentation

Definition at line 20 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  theTree(dynamic_cast<SiPixelFedCablingTree const *>(map)),
17  theFed(theTree ? theTree->fed(fedId) : nullptr)
18 {}
SiPixelFedCablingTree const * theTree
const SiPixelFedCabling * theMap
const PixelFEDCabling * fed(unsigned int idFed) const
get fed identified by its id
const PixelFEDCabling * theFed

Member Function Documentation

bool SiPixelFrameConverter::hasDetUnit ( uint32_t  radId) const

Definition at line 20 of file SiPixelFrameConverter.cc.

References SiPixelFedCabling::pathToDetUnitHasDetUnit(), theFedId, and theMap.

Referenced by SiPixelCoordinates::fedid().

21 {
22  return theMap->pathToDetUnitHasDetUnit(rawId, static_cast<unsigned int>(theFedId));
23 }
virtual bool pathToDetUnitHasDetUnit(uint32_t rawDetId, unsigned int fedId) const =0
const SiPixelFedCabling * theMap
int SiPixelFrameConverter::toCabling ( sipixelobjects::ElectronicIndex cabling,
const sipixelobjects::DetectorIndex detector 
) const

Definition at line 43 of file SiPixelFrameConverter.cc.

References sipixelobjects::DetectorIndex::col, sipixelobjects::LocalPixel::dcol(), SiPixelFedCabling::findItem(), DTRecHitClients_cfi::local, callgraph::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 SiPixelCoordinates::channel(), SiPixelSCurveCalibrationAnalysis::makeThresholdSummary(), SiPixelStatusProducer::onlineRocColRow(), SiPixelCoordinates::roc(), and toDetector().

45 {
46  std::vector<CablingPathToDetUnit> path = theMap->pathToDetUnit(detector.rawId);
47  typedef std::vector<CablingPathToDetUnit>::const_iterator IT;
48  for (IT it = path.begin(); it != path.end(); ++it) {
49  const PixelROC * roc = theMap->findItem(*it);
50  if (!roc) return 2;
51  if (roc->rawId() != detector.rawId) return 3;
52 
53  GlobalPixel global = {detector.row, detector.col};
54  //LogTrace("")<<"GLOBAL PIXEL: row=" << global.row <<" col="<< global.col;
55 
56  LocalPixel local = roc->toLocal(global);
57  // LogTrace("")<<"LOCAL PIXEL: dcol ="
58  //<< local.dcol()<<" pxid="<< local.pxid()<<" inside: " <<local.valid();
59 
60  if(!local.valid()) continue;
61  ElectronicIndex cabIdx = {static_cast<int>(it->link),
62  static_cast<int>(it->roc), local.dcol(), local.pxid()};
63  cabling = cabIdx;
64  return 0;
65  }
66  return 1;
67 }
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
LocalPixel toLocal(const GlobalPixel &glo) const
Definition: PixelROC.h:48
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:37
std::vector< LinkConnSpec >::const_iterator IT
virtual const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &) const =0
const SiPixelFedCabling * theMap
int SiPixelFrameConverter::toDetector ( const sipixelobjects::ElectronicIndex cabling,
sipixelobjects::DetectorIndex detector 
) const
inline

Definition at line 31 of file SiPixelFrameConverter.h.

References sipixelobjects::GlobalPixel::col, sipixelobjects::DetectorIndex::col, sipixelobjects::ElectronicIndex::dcol, gamEcalExtractorBlocks_cff::detector, sipixelobjects::ElectronicIndex::link, DTRecHitClients_cfi::local, sipixelobjects::ElectronicIndex::pxid, sipixelobjects::DetectorIndex::rawId, sipixelobjects::ElectronicIndex::roc, sipixelobjects::GlobalPixel::row, sipixelobjects::DetectorIndex::row, toCabling(), toRoc(), and sipixelobjects::LocalPixel::DcolPxid::valid().

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

32  {
33  using namespace sipixelobjects;
34  auto roc = toRoc(cabling.link, cabling.roc);
35  if (!roc) return 2;
36  LocalPixel::DcolPxid local = { cabling.dcol, cabling.pxid };
37  if (!local.valid()) return 3;
38 
39  GlobalPixel global = roc->toGlobal( LocalPixel(local) );
40  detector.rawId = roc->rawId();
41  detector.row = global.row;
42  detector.col = global.col;
43 
44  return 0;
45 
46  }
identify pixel inside single ROC
Definition: LocalPixel.h:7
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:22
sipixelobjects::PixelROC const * toRoc(int link, int roc) const
PixelROC const * SiPixelFrameConverter::toRoc ( int  link,
int  roc 
) const

Definition at line 26 of file SiPixelFrameConverter.cc.

References SiPixelFedCabling::findItem(), SiPixelFedCablingTree::findItemInFed(), callgraph::path, theFed, theFedId, theMap, theTree, and UNLIKELY.

Referenced by SiPixelCoordinates::channel(), PixelDataFormatter::interpretRawData(), SiPixelStatusProducer::onlineRocColRow(), SiPixelCoordinates::roc(), and toDetector().

26  {
27  CablingPathToDetUnit path = {static_cast<unsigned int>(theFedId),
28  static_cast<unsigned int>(link),
29  static_cast<unsigned int>(roc)};
30  const PixelROC * rocp = (theFed) ? theTree->findItemInFed(path, theFed) : theMap->findItem(path);
31  if UNLIKELY(!rocp){
32  stringstream stm;
33  stm << "Map shows no fed="<<theFedId
34  <<", link="<< link
35  <<", roc="<< roc;
36  edm::LogWarning("SiPixelFrameConverter") << stm.str();
37  }
38  return rocp;
39 }
SiPixelFedCablingTree const * theTree
virtual const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &) const =0
const SiPixelFedCabling * theMap
const sipixelobjects::PixelROC * findItemInFed(const sipixelobjects::CablingPathToDetUnit &path, const PixelFEDCabling *aFed) const
#define UNLIKELY(x)
Definition: Likely.h:21
const PixelFEDCabling * theFed

Member Data Documentation

const PixelFEDCabling* SiPixelFrameConverter::theFed
private

Definition at line 56 of file SiPixelFrameConverter.h.

Referenced by toRoc().

int SiPixelFrameConverter::theFedId
private

Definition at line 53 of file SiPixelFrameConverter.h.

Referenced by hasDetUnit(), and toRoc().

const SiPixelFedCabling* SiPixelFrameConverter::theMap
private

Definition at line 54 of file SiPixelFrameConverter.h.

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

SiPixelFedCablingTree const* SiPixelFrameConverter::theTree
private

Definition at line 55 of file SiPixelFrameConverter.h.

Referenced by toRoc().