CMS 3D CMS Logo

PixelTopologyMap.cc
Go to the documentation of this file.
2 
3 void PixelTopologyMap::printAll(std::ostream& os) const {
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 }
14 
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  // discard dets that are not a geomDetUnit
30  if (!pixelDet)
31  continue;
32 
33  const auto& layer = m_trackerTopo->pxbLayer(pixelDet->geographicalId());
34  const auto& ladder = m_trackerTopo->pxbLadder(pixelDet->geographicalId());
35  const auto& module = m_trackerTopo->pxbModule(pixelDet->geographicalId());
36 
37  if (ladder > maxLadder[layer]) {
38  maxLadder[layer] = ladder;
39  }
40 
41  if (module > maxModule[layer]) {
42  maxModule[layer] = module;
43  }
44  }
45 
46  for (unsigned int i = 1; i <= nlay; i++) {
47  m_pxbMap[i] = std::make_pair(maxLadder[i], maxModule[i]);
48  }
49 
50  // build endcaps
52  std::vector<unsigned> maxBlade, maxPXFModule;
53  maxBlade.resize(ndisk);
54  maxPXFModule.resize(ndisk);
55  for (unsigned int i = 1; i <= ndisk; i++) {
56  maxBlade.push_back(0);
57  maxPXFModule.push_back(0);
58  }
59 
60  for (auto det : m_trackerGeom->detsPXF()) {
61  const PixelGeomDetUnit* pixelDet = dynamic_cast<const PixelGeomDetUnit*>(det);
62 
63  // discard dets that are not a geomDetUnit
64  if (!pixelDet)
65  continue;
66 
67  const auto& disk = m_trackerTopo->pxfDisk(pixelDet->geographicalId());
68  const auto& blade = m_trackerTopo->pxfBlade(pixelDet->geographicalId());
69  const auto& pxf_module = m_trackerTopo->pxfModule(pixelDet->geographicalId());
70 
71  if (blade > maxBlade[disk]) {
72  maxBlade[disk] = blade;
73  }
74 
75  if (pxf_module > maxPXFModule[disk]) {
76  maxPXFModule[disk] = pxf_module;
77  }
78  }
79 
80  for (unsigned int i = 1; i <= ndisk; i++) {
81  m_pxfMap[i] = std::make_pair(maxBlade[i], maxPXFModule[i]);
82  }
83 }
const TrackerGeometry * m_trackerGeom
const unsigned getPXFBlades(int disk) const
unsigned int pxbLayer(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
const DetContainer & detsPXB() const
unsigned int numberOfLayers(int subdet) const
unsigned int pxfModule(const DetId &id) const
const unsigned getPXBModules(unsigned int lay) const
const DetContainer & detsPXF() const
void printAll(std::ostream &os) const
unsigned int pxbLadder(const DetId &id) const
const unsigned getPXFModules(int disk) const
unsigned int pxfDisk(const DetId &id) const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
std::map< unsigned, std::pair< unsigned, unsigned > > m_pxfMap
std::map< unsigned, std::pair< unsigned, unsigned > > m_pxbMap
unsigned int pxbModule(const DetId &id) const
const TrackerTopology * m_trackerTopo
const unsigned getPXBLadders(unsigned int lay) const