CMS 3D CMS Logo

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

#include <SiPixelTopoFinder.h>

Public Member Functions

std::vector< int > getDetIds () const
 
std::unordered_map< uint32_t, unsigned int > getFedIds () const
 
std::map< int, std::map< int, int > > getRocIds () const
 
std::map< int, std::pair< int, int > > getSensorLayout () const
 
std::map< int, std::pair< int, int > > getSensors () const
 
void init (const TrackerGeometry *trackerGeometry, const TrackerTopology *trackerTopology, const SiPixelFedCablingMap *siPixelFedCablingMap)
 
 SiPixelTopoFinder ()
 
 ~SiPixelTopoFinder ()
 

Private Member Functions

int half (const DetId &detid)
 
int indexROC (int irow, int icol, int nROCcolumns)
 
void onlineRocColRow (const DetId &detId, const SiPixelFedCablingMap *cablingMap, int fedId, int offlineRow, int offlineCol, int &roc, int &row, int &col)
 
int quadrant (const DetId &detid)
 
int side (const DetId &detid)
 

Private Attributes

const SiPixelFedCablingMapcablingMap_ = nullptr
 
std::vector< int > fDetIds_
 
std::unordered_map< uint32_t, unsigned int > fFedIds_
 
std::map< int, std::map< int, int > > fRocIds_
 
std::map< int, std::pair< int, int > > fSensorLayout_
 
std::map< int, std::pair< int, int > > fSensors_
 
int phase_ = -1
 
const TrackerGeometrytkGeom_ = nullptr
 
const TrackerTopologytkTopo_ = nullptr
 

Detailed Description

Definition at line 16 of file SiPixelTopoFinder.h.

Constructor & Destructor Documentation

◆ SiPixelTopoFinder()

SiPixelTopoFinder::SiPixelTopoFinder ( )

Definition at line 11 of file SiPixelTopoFinder.cc.

11 {}

◆ ~SiPixelTopoFinder()

SiPixelTopoFinder::~SiPixelTopoFinder ( )

Definition at line 13 of file SiPixelTopoFinder.cc.

13 {}

Member Function Documentation

◆ getDetIds()

std::vector<int> SiPixelTopoFinder::getDetIds ( ) const
inline

Definition at line 25 of file SiPixelTopoFinder.h.

25 { return fDetIds_; }

References fDetIds_.

◆ getFedIds()

std::unordered_map<uint32_t, unsigned int> SiPixelTopoFinder::getFedIds ( ) const
inline

Definition at line 31 of file SiPixelTopoFinder.h.

31 { return fFedIds_; }

References fFedIds_.

◆ getRocIds()

std::map<int, std::map<int, int> > SiPixelTopoFinder::getRocIds ( ) const
inline

Definition at line 33 of file SiPixelTopoFinder.h.

33 { return fRocIds_; }

References fRocIds_.

◆ getSensorLayout()

std::map<int, std::pair<int, int> > SiPixelTopoFinder::getSensorLayout ( ) const
inline

Definition at line 29 of file SiPixelTopoFinder.h.

29 { return fSensorLayout_; }

References fSensorLayout_.

◆ getSensors()

std::map<int, std::pair<int, int> > SiPixelTopoFinder::getSensors ( ) const
inline

Definition at line 27 of file SiPixelTopoFinder.h.

27 { return fSensors_; }

References fSensors_.

◆ half()

int SiPixelTopoFinder::half ( const DetId detid)
private

Definition at line 144 of file SiPixelTopoFinder.cc.

144  {
146  return PixelBarrelName(detid, tkTopo_, phase_).isHalfModule();
147  else
148  return -9999;
149 }

References PixelBarrelName::isHalfModule(), phase_, PixelSubdetector::PixelBarrel, DetId::subdetId(), and tkTopo_.

Referenced by onlineRocColRow().

◆ indexROC()

int SiPixelTopoFinder::indexROC ( int  irow,
int  icol,
int  nROCcolumns 
)
private

Definition at line 117 of file SiPixelTopoFinder.cc.

117  {
118  return int(icol + irow * nROCcolumns);
119 
120  /*generate the folling roc index that is going to map with ROC id as
121  8 9 10 11 12 13 14 15
122  0 1 2 3 4 5 6 7 */
123 }

References createfilelist::int.

Referenced by init().

◆ init()

void SiPixelTopoFinder::init ( const TrackerGeometry trackerGeometry,
const TrackerTopology trackerTopology,
const SiPixelFedCablingMap siPixelFedCablingMap 
)

Definition at line 15 of file SiPixelTopoFinder.cc.

17  {
18  phase_ = -1;
19 
20  tkGeom_ = trackerGeometry;
21  tkTopo_ = trackerTopology;
22  cablingMap_ = siPixelFedCablingMap;
23  // from cabling map to FedIds
25 
26  // clear data
27  fDetIds_.clear();
28  fSensors_.clear();
29  fSensorLayout_.clear();
30  fRocIds_.clear();
31 
32  // loop over tracker geometry
33  for (TrackerGeometry::DetContainer::const_iterator it = tkGeom_->dets().begin(); it != tkGeom_->dets().end();
34  it++) { // tracker geo
35 
36  const PixelGeomDetUnit* pgdu = dynamic_cast<const PixelGeomDetUnit*>((*it));
37  if (pgdu == nullptr)
38  continue;
39  // get detId for a module
40  DetId detId = (*it)->geographicalId();
41  int detid = detId.rawId();
42  fDetIds_.push_back(detid);
43 
44  // don't want to use magic number row 80 column 52 for Phase-1
45  const PixelTopology* topo = static_cast<const PixelTopology*>(&pgdu->specificTopology());
46  int rowsperroc = topo->rowsperroc();
47  int colsperroc = topo->colsperroc();
48 
49  int nROCrows = pgdu->specificTopology().nrows() / rowsperroc;
50  int nROCcolumns = pgdu->specificTopology().ncolumns() / colsperroc;
51 
52  fSensors_[detid] = std::make_pair(rowsperroc, colsperroc);
53  fSensorLayout_[detid] = std::make_pair(nROCrows, nROCcolumns);
54 
55  std::map<int, int> rocIdMap;
56  for (int irow = 0; irow < nROCrows; irow++) { // row
57  for (int icol = 0; icol < nROCcolumns; icol++) { // column
58  int dummyOfflineRow = (rowsperroc / 2 - 1) + irow * rowsperroc;
59  int dummeOfflineColumn = (colsperroc / 2 - 1) + icol * colsperroc;
60  int fedId = fFedIds_[detId.rawId()];
61 
62  int roc(-1), rocR(-1), rocC(-1);
64  detId, cablingMap_, fedId, dummyOfflineRow, dummeOfflineColumn, roc, rocR, rocC);
65 
66  // encode irow, icol
67  int key = SiPixelTopoFinder::indexROC(irow, icol, nROCcolumns);
68  int value = roc;
69  rocIdMap[key] = value;
70  } // column
71  } // row
72 
73  fRocIds_[detid] = rocIdMap;
74 
75  } // tracker geo
76 }

References cablingMap_, PixelTopology::colsperroc(), SiPixelFedCablingMap::det2fedMap(), TrackerGeometry::dets(), fDetIds_, l1tstage2_dqm_sourceclient-live_cfg::fedId, fFedIds_, fRocIds_, fSensorLayout_, fSensors_, indexROC(), crabWrapper::key, PixelTopology::ncolumns(), PixelTopology::nrows(), onlineRocColRow(), phase_, DetId::rawId(), PixelMapPlotter::roc, PixelTopology::rowsperroc(), PixelGeomDetUnit::specificTopology(), tkGeom_, tkTopo_, and relativeConstraints::value.

◆ onlineRocColRow()

void SiPixelTopoFinder::onlineRocColRow ( const DetId detId,
const SiPixelFedCablingMap cablingMap,
int  fedId,
int  offlineRow,
int  offlineCol,
int &  roc,
int &  row,
int &  col 
)
private

Definition at line 78 of file SiPixelTopoFinder.cc.

85  {
86  // from detector to cabling
88  sipixelobjects::DetectorIndex detector; //{detId.rawId(), offlineRow, offlineCol};
89  detector.rawId = detId.rawId();
90  detector.row = offlineRow;
91  detector.col = offlineCol;
92 
94  converter.toCabling(cabling, detector);
95 
96  // then one can construct local pixel
98  loc.dcol = cabling.dcol;
99  loc.pxid = cabling.pxid;
100  // and get local(online) row/column
101  sipixelobjects::LocalPixel locpixel(loc);
102  col = locpixel.rocCol();
103  row = locpixel.rocRow();
104  //sipixelobjects::CablingPathToDetUnit path = {(unsigned int) fedId, (unsigned int)cabling.link, (unsigned int)cabling.roc};
105  //const sipixelobjects::PixelROC *theRoc = fCablingMap_->findItem(path);
106  const sipixelobjects::PixelROC* theRoc = converter.toRoc(cabling.link, cabling.roc);
107  roc = theRoc->idInDetUnit();
108 
109  // has to be BPIX; has to be minus side; has to be half module
110  // for phase-I, there is no half module
111  if (detId.subdetId() == PixelSubdetector::PixelBarrel && SiPixelTopoFinder::side(detId) == 1 &&
112  SiPixelTopoFinder::half(detId)) {
113  roc += 8;
114  }
115 }

References cuy::col, sipixelobjects::ElectronicIndex::dcol, sipixelobjects::LocalPixel::DcolPxid::dcol, hgcalTestNeighbor_cfi::detector, l1tstage2_dqm_sourceclient-live_cfg::fedId, half(), sipixelobjects::PixelROC::idInDetUnit(), sipixelobjects::ElectronicIndex::link, PixelSubdetector::PixelBarrel, sipixelobjects::ElectronicIndex::pxid, sipixelobjects::LocalPixel::DcolPxid::pxid, DetId::rawId(), sipixelobjects::ElectronicIndex::roc, PixelMapPlotter::roc, sipixelobjects::LocalPixel::rocCol(), sipixelobjects::LocalPixel::rocRow(), side(), and DetId::subdetId().

Referenced by init().

◆ quadrant()

int SiPixelTopoFinder::quadrant ( const DetId detid)
private

Definition at line 126 of file SiPixelTopoFinder.cc.

126  {
128  return PixelBarrelName(detid, tkTopo_, phase_).shell();
129  else if (detid.subdetId() == PixelSubdetector::PixelEndcap)
130  return PixelEndcapName(detid, tkTopo_, phase_).halfCylinder();
131  else
132  return -9999;
133 }

References PixelEndcapName::halfCylinder(), phase_, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelBarrelName::shell(), DetId::subdetId(), and tkTopo_.

Referenced by side().

◆ side()

int SiPixelTopoFinder::side ( const DetId detid)
private

Definition at line 135 of file SiPixelTopoFinder.cc.

135  {
137  return 1 + (SiPixelTopoFinder::quadrant(detid) > 2);
138  else if (detid.subdetId() == PixelSubdetector::PixelEndcap)
139  return tkTopo_->pxfSide(detid);
140  else
141  return -9999;
142 }

References PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TrackerTopology::pxfSide(), quadrant(), DetId::subdetId(), and tkTopo_.

Referenced by onlineRocColRow().

Member Data Documentation

◆ cablingMap_

const SiPixelFedCablingMap* SiPixelTopoFinder::cablingMap_ = nullptr
private

Definition at line 41 of file SiPixelTopoFinder.h.

Referenced by init().

◆ fDetIds_

std::vector<int> SiPixelTopoFinder::fDetIds_
private

Definition at line 44 of file SiPixelTopoFinder.h.

Referenced by getDetIds(), and init().

◆ fFedIds_

std::unordered_map<uint32_t, unsigned int> SiPixelTopoFinder::fFedIds_
private

Definition at line 50 of file SiPixelTopoFinder.h.

Referenced by getFedIds(), and init().

◆ fRocIds_

std::map<int, std::map<int, int> > SiPixelTopoFinder::fRocIds_
private

Definition at line 52 of file SiPixelTopoFinder.h.

Referenced by getRocIds(), and init().

◆ fSensorLayout_

std::map<int, std::pair<int, int> > SiPixelTopoFinder::fSensorLayout_
private

Definition at line 48 of file SiPixelTopoFinder.h.

Referenced by getSensorLayout(), and init().

◆ fSensors_

std::map<int, std::pair<int, int> > SiPixelTopoFinder::fSensors_
private

Definition at line 46 of file SiPixelTopoFinder.h.

Referenced by getSensors(), and init().

◆ phase_

int SiPixelTopoFinder::phase_ = -1
private

Definition at line 37 of file SiPixelTopoFinder.h.

Referenced by half(), init(), and quadrant().

◆ tkGeom_

const TrackerGeometry* SiPixelTopoFinder::tkGeom_ = nullptr
private

Definition at line 40 of file SiPixelTopoFinder.h.

Referenced by init().

◆ tkTopo_

const TrackerTopology* SiPixelTopoFinder::tkTopo_ = nullptr
private

Definition at line 39 of file SiPixelTopoFinder.h.

Referenced by half(), init(), quadrant(), and side().

PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
TrackerTopology::pxfSide
unsigned int pxfSide(const DetId &id) const
Definition: TrackerTopology.h:192
SiPixelTopoFinder::quadrant
int quadrant(const DetId &detid)
Definition: SiPixelTopoFinder.cc:126
converter
Definition: CandidateProducer.h:25
PixelTopology::colsperroc
virtual int colsperroc() const =0
cuy.col
col
Definition: cuy.py:1009
SiPixelTopoFinder::tkGeom_
const TrackerGeometry * tkGeom_
Definition: SiPixelTopoFinder.h:40
PixelBarrelName
Definition: PixelBarrelName.h:16
SiPixelTopoFinder::half
int half(const DetId &detid)
Definition: SiPixelTopoFinder.cc:144
PixelEndcapName::halfCylinder
HalfCylinder halfCylinder() const
Definition: PixelEndcapName.h:42
sipixelobjects::ElectronicIndex::dcol
int dcol
Definition: ElectronicIndex.h:8
SiPixelTopoFinder::cablingMap_
const SiPixelFedCablingMap * cablingMap_
Definition: SiPixelTopoFinder.h:41
SiPixelTopoFinder::side
int side(const DetId &detid)
Definition: SiPixelTopoFinder.cc:135
SiPixelTopoFinder::fSensors_
std::map< int, std::pair< int, int > > fSensors_
Definition: SiPixelTopoFinder.h:46
SiPixelTopoFinder::phase_
int phase_
Definition: SiPixelTopoFinder.h:37
sipixelobjects::LocalPixel
identify pixel inside single ROC
Definition: LocalPixel.h:7
DetId
Definition: DetId.h:17
SiPixelTopoFinder::onlineRocColRow
void onlineRocColRow(const DetId &detId, const SiPixelFedCablingMap *cablingMap, int fedId, int offlineRow, int offlineCol, int &roc, int &row, int &col)
Definition: SiPixelTopoFinder.cc:78
PixelEndcapName
Definition: PixelEndcapName.h:16
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
SiPixelTopoFinder::fSensorLayout_
std::map< int, std::pair< int, int > > fSensorLayout_
Definition: SiPixelTopoFinder.h:48
PixelTopology::ncolumns
virtual int ncolumns() const =0
sipixelobjects::ElectronicIndex::pxid
int pxid
Definition: ElectronicIndex.h:9
PixelTopology
Definition: PixelTopology.h:10
sipixelobjects::ElectronicIndex
Definition: ElectronicIndex.h:5
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
sipixelobjects::ElectronicIndex::link
int link
Definition: ElectronicIndex.h:6
SiPixelTopoFinder::fRocIds_
std::map< int, std::map< int, int > > fRocIds_
Definition: SiPixelTopoFinder.h:52
SiPixelTopoFinder::tkTopo_
const TrackerTopology * tkTopo_
Definition: SiPixelTopoFinder.h:39
SiPixelFedCablingMap::det2fedMap
std::unordered_map< uint32_t, unsigned int > det2fedMap() const final
Definition: SiPixelFedCablingMap.cc:133
sipixelobjects::LocalPixel::DcolPxid::pxid
int pxid
Definition: LocalPixel.h:20
PixelBarrelName::shell
Shell shell() const
Definition: PixelBarrelName.h:40
sipixelobjects::LocalPixel::DcolPxid
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:19
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
SiPixelTopoFinder::indexROC
int indexROC(int irow, int icol, int nROCcolumns)
Definition: SiPixelTopoFinder.cc:117
createfilelist.int
int
Definition: createfilelist.py:10
value
Definition: value.py:1
SiPixelTopoFinder::fDetIds_
std::vector< int > fDetIds_
Definition: SiPixelTopoFinder.h:44
SiPixelFrameConverter
Definition: SiPixelFrameConverter.h:15
TrackerGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: TrackerGeometry.h:62
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:89
PixelTopology::rowsperroc
virtual int rowsperroc() const =0
sipixelobjects::PixelROC
Definition: PixelROC.h:23
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
relativeConstraints.value
value
Definition: relativeConstraints.py:53
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
SiPixelTopoFinder::fFedIds_
std::unordered_map< uint32_t, unsigned int > fFedIds_
Definition: SiPixelTopoFinder.h:50
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
PixelTopology::nrows
virtual int nrows() const =0
crabWrapper.key
key
Definition: crabWrapper.py:19
PixelBarrelName::isHalfModule
bool isHalfModule() const
full or half module
Definition: PixelBarrelName.cc:702
sipixelobjects::PixelROC::idInDetUnit
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37
sipixelobjects::LocalPixel::DcolPxid::dcol
int dcol
Definition: LocalPixel.h:20
sipixelobjects::DetectorIndex
Definition: DetectorIndex.h:6
sipixelobjects::ElectronicIndex::roc
int roc
Definition: ElectronicIndex.h:7