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 15 of file SiPixelFrameConverter.h.

Member Typedef Documentation

◆ PixelFEDCabling

Definition at line 17 of file SiPixelFrameConverter.h.

Constructor & Destructor Documentation

◆ SiPixelFrameConverter()

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

Definition at line 14 of file SiPixelFrameConverter.cc.

15  : theFedId(fedId),
16  theMap(map),
17  theTree(dynamic_cast<SiPixelFedCablingTree const*>(map)),
18  theFed(theTree ? theTree->fed(fedId) : nullptr) {}

Member Function Documentation

◆ hasDetUnit()

bool SiPixelFrameConverter::hasDetUnit ( uint32_t  radId) const

Definition at line 20 of file SiPixelFrameConverter.cc.

20  {
21  return theMap->pathToDetUnitHasDetUnit(rawId, static_cast<unsigned int>(theFedId));
22 }

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

Referenced by SiPixelCoordinates::fedid().

◆ toCabling()

int SiPixelFrameConverter::toCabling ( sipixelobjects::ElectronicIndex cabling,
const sipixelobjects::DetectorIndex detector 
) const

Definition at line 36 of file SiPixelFrameConverter.cc.

36  {
37  std::vector<CablingPathToDetUnit> path = theMap->pathToDetUnit(detector.rawId);
38  typedef std::vector<CablingPathToDetUnit>::const_iterator IT;
39  for (IT it = path.begin(); it != path.end(); ++it) {
40  const PixelROC* roc = theMap->findItem(*it);
41  if (!roc)
42  return 2;
43  if (roc->rawId() != detector.rawId)
44  return 3;
45 
46  GlobalPixel global = {detector.row, detector.col};
47  //LogTrace("")<<"GLOBAL PIXEL: row=" << global.row <<" col="<< global.col;
48 
49  LocalPixel local = roc->toLocal(global);
50  // LogTrace("")<<"LOCAL PIXEL: dcol ="
51  //<< local.dcol()<<" pxid="<< local.pxid()<<" inside: " <<local.valid();
52 
53  if (!local.valid())
54  continue;
55  ElectronicIndex cabIdx = {static_cast<int>(it->link), static_cast<int>(it->roc), local.dcol(), local.pxid()};
56  cabling = cabIdx;
57  return 0;
58  }
59  return 1;
60 }

References hgcalTestNeighbor_cfi::detector, SiPixelFedCabling::findItem(), DTRecHitClients_cfi::local, castor_dqm_sourceclient_file_cfg::path, SiPixelFedCabling::pathToDetUnit(), PixelMapPlotter::roc, and theMap.

◆ toDetector()

int SiPixelFrameConverter::toDetector ( const sipixelobjects::ElectronicIndex cabling,
sipixelobjects::DetectorIndex detector 
) const
inline

Definition at line 27 of file SiPixelFrameConverter.h.

27  {
28  using namespace sipixelobjects;
29  auto roc = toRoc(cabling.link, cabling.roc);
30  if (!roc)
31  return 2;
32  LocalPixel::DcolPxid local = {cabling.dcol, cabling.pxid};
33  if (!local.valid())
34  return 3;
35 
36  GlobalPixel global = roc->toGlobal(LocalPixel(local));
37  detector.rawId = roc->rawId();
38  detector.row = global.row;
39  detector.col = global.col;
40 
41  return 0;
42  }

References sipixelobjects::GlobalPixel::col, sipixelobjects::ElectronicIndex::dcol, hgcalTestNeighbor_cfi::detector, sipixelobjects::ElectronicIndex::link, DTRecHitClients_cfi::local, sipixelobjects::ElectronicIndex::pxid, sipixelobjects::ElectronicIndex::roc, PixelMapPlotter::roc, sipixelobjects::GlobalPixel::row, and toRoc().

◆ toRoc()

PixelROC const * SiPixelFrameConverter::toRoc ( int  link,
int  roc 
) const

Definition at line 24 of file SiPixelFrameConverter.cc.

24  {
26  static_cast<unsigned int>(theFedId), static_cast<unsigned int>(link), static_cast<unsigned int>(roc)};
28  if UNLIKELY (!rocp) {
29  stringstream stm;
30  stm << "Map shows no fed=" << theFedId << ", link=" << link << ", roc=" << roc;
31  edm::LogWarning("SiPixelFrameConverter") << stm.str();
32  }
33  return rocp;
34 }

References SiPixelFedCabling::findItem(), SiPixelFedCablingTree::findItemInFed(), MainPageGenerator::link, castor_dqm_sourceclient_file_cfg::path, PixelMapPlotter::roc, theFed, theFedId, theMap, theTree, and UNLIKELY.

Referenced by toDetector().

Member Data Documentation

◆ theFed

const PixelFEDCabling* SiPixelFrameConverter::theFed
private

Definition at line 50 of file SiPixelFrameConverter.h.

Referenced by toRoc().

◆ theFedId

int SiPixelFrameConverter::theFedId
private

Definition at line 47 of file SiPixelFrameConverter.h.

Referenced by hasDetUnit(), and toRoc().

◆ theMap

const SiPixelFedCabling* SiPixelFrameConverter::theMap
private

Definition at line 48 of file SiPixelFrameConverter.h.

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

◆ theTree

SiPixelFedCablingTree const* SiPixelFrameConverter::theTree
private

Definition at line 49 of file SiPixelFrameConverter.h.

Referenced by toRoc().

MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
SiPixelFedCabling::findItem
virtual const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &) const =0
SiPixelFrameConverter::theFed
const PixelFEDCabling * theFed
Definition: SiPixelFrameConverter.h:50
SiPixelFedCabling::pathToDetUnit
virtual std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const =0
sipixelobjects::GlobalPixel::row
int row
Definition: GlobalPixel.h:7
sipixelobjects::ElectronicIndex::dcol
int dcol
Definition: ElectronicIndex.h:8
SiPixelFedCablingTree::fed
const PixelFEDCabling * fed(unsigned int idFed) const
get fed identified by its id
Definition: SiPixelFedCablingTree.cc:95
sipixelobjects::GlobalPixel::col
int col
Definition: GlobalPixel.h:8
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
sipixelobjects::LocalPixel
identify pixel inside single ROC
Definition: LocalPixel.h:7
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
sipixelobjects::GlobalPixel
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
sipixelobjects
Definition: CablingPathToDetUnit.h:4
sipixelobjects::CablingPathToDetUnit
Definition: CablingPathToDetUnit.h:5
sipixelobjects::ElectronicIndex::pxid
int pxid
Definition: ElectronicIndex.h:9
SiPixelFrameConverter::theMap
const SiPixelFedCabling * theMap
Definition: SiPixelFrameConverter.h:48
sipixelobjects::ElectronicIndex
Definition: ElectronicIndex.h:5
sipixelobjects::ElectronicIndex::link
int link
Definition: ElectronicIndex.h:6
sipixelobjects::LocalPixel::DcolPxid
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:19
SiPixelFedCablingTree::findItemInFed
const sipixelobjects::PixelROC * findItemInFed(const sipixelobjects::CablingPathToDetUnit &path, const PixelFEDCabling *aFed) const
Definition: SiPixelFedCablingTree.cc:141
SiPixelFrameConverter::theTree
SiPixelFedCablingTree const * theTree
Definition: SiPixelFrameConverter.h:49
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:89
IT
std::vector< LinkConnSpec >::const_iterator IT
Definition: TriggerBoardSpec.cc:5
sipixelobjects::PixelROC
Definition: PixelROC.h:23
SiPixelFrameConverter::toRoc
sipixelobjects::PixelROC const * toRoc(int link, int roc) const
Definition: SiPixelFrameConverter.cc:24
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
SiPixelFedCabling::pathToDetUnitHasDetUnit
virtual bool pathToDetUnitHasDetUnit(uint32_t rawDetId, unsigned int fedId) const =0
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
genParticles_cff.map
map
Definition: genParticles_cff.py:11
SiPixelFrameConverter::theFedId
int theFedId
Definition: SiPixelFrameConverter.h:47
sipixelobjects::ElectronicIndex::roc
int roc
Definition: ElectronicIndex.h:7