CMS 3D CMS Logo

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

#include <PixelTopologyMap.h>

Public Member Functions

const unsigned getPXBLadders (unsigned int lay) const
 
const unsigned getPXBModules (unsigned int lay) const
 
const unsigned getPXFBlades (int disk) const
 
const unsigned getPXFModules (int disk) const
 
 PixelTopologyMap (const TrackerGeometry *geom, const TrackerTopology *topo)
 
void printAll (std::ostream &os) const
 
 ~PixelTopologyMap ()=default
 

Private Member Functions

void buildTopologyMaps ()
 

Private Attributes

std::map< unsigned, std::pair< unsigned, unsigned > > m_pxbMap
 
std::map< unsigned, std::pair< unsigned, unsigned > > m_pxfMap
 
const TrackerGeometrym_trackerGeom
 
const TrackerTopologym_trackerTopo
 

Detailed Description

A specific Pixel Tracker class to determine the number of ladders / modules in PXB and number of blades/modules in PXF

Definition at line 20 of file PixelTopologyMap.h.

Constructor & Destructor Documentation

◆ PixelTopologyMap()

PixelTopologyMap::PixelTopologyMap ( const TrackerGeometry geom,
const TrackerTopology topo 
)
inline

Definition at line 22 of file PixelTopologyMap.h.

23  : m_trackerTopo{topo}, m_trackerGeom{geom} {
24  // build the maps
26  }

◆ ~PixelTopologyMap()

PixelTopologyMap::~PixelTopologyMap ( )
default

Member Function Documentation

◆ buildTopologyMaps()

void PixelTopologyMap::buildTopologyMaps ( )
private

Definition at line 15 of file PixelTopologyMap.cc.

15  {
16  // build barrel
18  std::vector<unsigned> maxLadder, maxModule;
19  maxLadder.resize(nlay);
20  maxModule.resize(nlay);
21  for (unsigned int i = 1; i <= nlay; i++) {
22  maxLadder.push_back(0);
23  maxModule.push_back(0);
24  }
25 
26  for (auto det : m_trackerGeom->detsPXB()) {
27  const PixelGeomDetUnit* pixelDet = dynamic_cast<const PixelGeomDetUnit*>(det);
28 
29  const auto& layer = m_trackerTopo->pxbLayer(pixelDet->geographicalId());
30  const auto& ladder = m_trackerTopo->pxbLadder(pixelDet->geographicalId());
31  const auto& module = m_trackerTopo->pxbModule(pixelDet->geographicalId());
32 
33  if (ladder > maxLadder[layer]) {
34  maxLadder[layer] = ladder;
35  }
36 
37  if (module > maxModule[layer]) {
38  maxModule[layer] = module;
39  }
40  }
41 
42  for (unsigned int i = 1; i <= nlay; i++) {
43  m_pxbMap[i] = std::make_pair(maxLadder[i], maxModule[i]);
44  }
45 
46  // build endcaps
48  std::vector<unsigned> maxBlade, maxPXFModule;
49  maxBlade.resize(ndisk);
50  maxPXFModule.resize(ndisk);
51  for (unsigned int i = 1; i <= ndisk; i++) {
52  maxBlade.push_back(0);
53  maxPXFModule.push_back(0);
54  }
55 
56  for (auto det : m_trackerGeom->detsPXF()) {
57  const PixelGeomDetUnit* pixelDet = dynamic_cast<const PixelGeomDetUnit*>(det);
58 
59  const auto& disk = m_trackerTopo->pxfDisk(pixelDet->geographicalId());
60  const auto& blade = m_trackerTopo->pxfBlade(pixelDet->geographicalId());
61  const auto& pxf_module = m_trackerTopo->pxfModule(pixelDet->geographicalId());
62 
63  if (blade > maxBlade[disk]) {
64  maxBlade[disk] = blade;
65  }
66 
67  if (pxf_module > maxPXFModule[disk]) {
68  maxPXFModule[disk] = pxf_module;
69  }
70  }
71 
72  for (unsigned int i = 1; i <= ndisk; i++) {
73  m_pxfMap[i] = std::make_pair(maxBlade[i], maxPXFModule[i]);
74  }
75 }

References TrackerGeometry::detsPXB(), TrackerGeometry::detsPXF(), GeomDet::geographicalId(), mps_fire::i, PVValHelper::ladder, phase1PixelTopology::layer, m_pxbMap, m_pxfMap, m_trackerGeom, m_trackerTopo, callgraph::module, TrackerGeometry::numberOfLayers(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), TrackerTopology::pxbModule(), TrackerTopology::pxfBlade(), TrackerTopology::pxfDisk(), and TrackerTopology::pxfModule().

◆ getPXBLadders()

const unsigned PixelTopologyMap::getPXBLadders ( unsigned int  lay) const
inline

Definition at line 32 of file PixelTopologyMap.h.

32 { return m_pxbMap.at(lay).first; }

References m_pxbMap.

Referenced by printAll().

◆ getPXBModules()

const unsigned PixelTopologyMap::getPXBModules ( unsigned int  lay) const
inline

Definition at line 33 of file PixelTopologyMap.h.

33 { return m_pxbMap.at(lay).second; }

References m_pxbMap.

Referenced by printAll().

◆ getPXFBlades()

const unsigned PixelTopologyMap::getPXFBlades ( int  disk) const
inline

Definition at line 34 of file PixelTopologyMap.h.

34 { return m_pxfMap.at(std::abs(disk)).first; }

References funct::abs(), and m_pxfMap.

Referenced by printAll().

◆ getPXFModules()

const unsigned PixelTopologyMap::getPXFModules ( int  disk) const
inline

Definition at line 35 of file PixelTopologyMap.h.

35 { return m_pxfMap.at(std::abs(disk)).second; }

References funct::abs(), and m_pxfMap.

Referenced by printAll().

◆ printAll()

void PixelTopologyMap::printAll ( std::ostream &  os) const

Definition at line 3 of file PixelTopologyMap.cc.

3  {
4  for (unsigned int i = 1; i <= m_pxbMap.size(); i++) {
5  os << "PXB layer " << std::setw(2) << i << " has: " << std::setw(2) << getPXBLadders(i) << " ladders and "
6  << std::setw(2) << getPXBModules(i) << " modules" << std::endl;
7  }
8 
9  for (unsigned int j = 1; j <= m_pxfMap.size(); j++) {
10  os << "PXF disk " << std::setw(2) << j << " has: " << std::setw(2) << getPXFBlades(j) << " blades and "
11  << std::setw(2) << getPXFModules(j) << " modules" << std::endl;
12  }
13 }

References getPXBLadders(), getPXBModules(), getPXFBlades(), getPXFModules(), mps_fire::i, dqmiolumiharvest::j, m_pxbMap, and m_pxfMap.

Member Data Documentation

◆ m_pxbMap

std::map<unsigned, std::pair<unsigned, unsigned> > PixelTopologyMap::m_pxbMap
private

Definition at line 46 of file PixelTopologyMap.h.

Referenced by buildTopologyMaps(), getPXBLadders(), getPXBModules(), and printAll().

◆ m_pxfMap

std::map<unsigned, std::pair<unsigned, unsigned> > PixelTopologyMap::m_pxfMap
private

Definition at line 47 of file PixelTopologyMap.h.

Referenced by buildTopologyMaps(), getPXFBlades(), getPXFModules(), and printAll().

◆ m_trackerGeom

const TrackerGeometry* PixelTopologyMap::m_trackerGeom
private

Definition at line 44 of file PixelTopologyMap.h.

Referenced by buildTopologyMaps().

◆ m_trackerTopo

const TrackerTopology* PixelTopologyMap::m_trackerTopo
private

Definition at line 43 of file PixelTopologyMap.h.

Referenced by buildTopologyMaps().

mps_fire.i
i
Definition: mps_fire.py:428
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
TrackerTopology::pxbLadder
unsigned int pxbLadder(const DetId &id) const
Definition: TrackerTopology.h:155
PixelTopologyMap::buildTopologyMaps
void buildTopologyMaps()
Definition: PixelTopologyMap.cc:15
PixelTopologyMap::m_trackerTopo
const TrackerTopology * m_trackerTopo
Definition: PixelTopologyMap.h:43
TrackerGeometry::numberOfLayers
unsigned int numberOfLayers(int subdet) const
Definition: TrackerGeometry.cc:211
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
PixelTopologyMap::m_pxfMap
std::map< unsigned, std::pair< unsigned, unsigned > > m_pxfMap
Definition: PixelTopologyMap.h:47
TrackerGeometry::detsPXB
const DetContainer & detsPXB() const
Definition: TrackerGeometry.cc:171
PixelTopologyMap::m_pxbMap
std::map< unsigned, std::pair< unsigned, unsigned > > m_pxbMap
Definition: PixelTopologyMap.h:46
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
TrackerGeometry::detsPXF
const DetContainer & detsPXF() const
Definition: TrackerGeometry.cc:173
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
PixelTopologyMap::getPXBLadders
const unsigned getPXBLadders(unsigned int lay) const
Definition: PixelTopologyMap.h:32
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
PixelTopologyMap::getPXFBlades
const unsigned getPXFBlades(int disk) const
Definition: PixelTopologyMap.h:34
TrackerTopology::pxfModule
unsigned int pxfModule(const DetId &id) const
Definition: TrackerTopology.h:163
TrackerTopology::pxfDisk
unsigned int pxfDisk(const DetId &id) const
Definition: TrackerTopology.h:446
PixelTopologyMap::m_trackerGeom
const TrackerGeometry * m_trackerGeom
Definition: PixelTopologyMap.h:44
callgraph.module
module
Definition: callgraph.py:61
TrackerTopology::pxbModule
unsigned int pxbModule(const DetId &id) const
Definition: TrackerTopology.h:160
PixelTopologyMap::getPXFModules
const unsigned getPXFModules(int disk) const
Definition: PixelTopologyMap.h:35
PixelTopologyMap::getPXBModules
const unsigned getPXBModules(unsigned int lay) const
Definition: PixelTopologyMap.h:33
PVValHelper::ladder
Definition: PVValidationHelpers.h:73
TrackerTopology::pxfBlade
unsigned int pxfBlade(const DetId &id) const
Definition: TrackerTopology.h:447
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66