File indexing completed on 2024-09-15 23:06:49
0001 #include "Geometry/TrackerGeometryBuilder/interface/PixelTopologyMap.h"
0002
0003 void PixelTopologyMap::printAll(std::ostream& os) const {
0004 for (unsigned int i = 1; i <= m_pxbMap.size(); i++) {
0005 os << "PXB layer " << std::setw(2) << i << " has: " << std::setw(2) << getPXBLadders(i) << " ladders and "
0006 << std::setw(2) << getPXBModules(i) << " modules" << std::endl;
0007 }
0008
0009 for (unsigned int j = 1; j <= m_pxfMap.size(); j++) {
0010 os << "PXF disk " << std::setw(2) << j << " has: " << std::setw(2) << getPXFBlades(j) << " blades and "
0011 << std::setw(2) << getPXFModules(j) << " modules" << std::endl;
0012 }
0013 }
0014
0015 void PixelTopologyMap::buildTopologyMaps() {
0016
0017 const auto& nlay = m_trackerGeom->numberOfLayers(PixelSubdetector::PixelBarrel);
0018 std::vector<unsigned> maxLadder, maxModule;
0019 maxLadder.resize(nlay);
0020 maxModule.resize(nlay);
0021 for (unsigned int i = 1; i <= nlay; i++) {
0022 maxLadder.push_back(0);
0023 maxModule.push_back(0);
0024 }
0025
0026 for (auto det : m_trackerGeom->detsPXB()) {
0027 const PixelGeomDetUnit* pixelDet = dynamic_cast<const PixelGeomDetUnit*>(det);
0028
0029 const auto& layer = m_trackerTopo->pxbLayer(pixelDet->geographicalId());
0030 const auto& ladder = m_trackerTopo->pxbLadder(pixelDet->geographicalId());
0031 const auto& module = m_trackerTopo->pxbModule(pixelDet->geographicalId());
0032
0033 if (ladder > maxLadder[layer]) {
0034 maxLadder[layer] = ladder;
0035 }
0036
0037 if (module > maxModule[layer]) {
0038 maxModule[layer] = module;
0039 }
0040 }
0041
0042 for (unsigned int i = 1; i <= nlay; i++) {
0043 m_pxbMap[i] = std::make_pair(maxLadder[i], maxModule[i]);
0044 }
0045
0046
0047 const auto& ndisk = m_trackerGeom->numberOfLayers(PixelSubdetector::PixelEndcap);
0048 std::vector<unsigned> maxBlade, maxPXFModule;
0049 maxBlade.resize(ndisk);
0050 maxPXFModule.resize(ndisk);
0051 for (unsigned int i = 1; i <= ndisk; i++) {
0052 maxBlade.push_back(0);
0053 maxPXFModule.push_back(0);
0054 }
0055
0056 for (auto det : m_trackerGeom->detsPXF()) {
0057 const PixelGeomDetUnit* pixelDet = dynamic_cast<const PixelGeomDetUnit*>(det);
0058
0059 const auto& disk = m_trackerTopo->pxfDisk(pixelDet->geographicalId());
0060 const auto& blade = m_trackerTopo->pxfBlade(pixelDet->geographicalId());
0061 const auto& pxf_module = m_trackerTopo->pxfModule(pixelDet->geographicalId());
0062
0063 if (blade > maxBlade[disk]) {
0064 maxBlade[disk] = blade;
0065 }
0066
0067 if (pxf_module > maxPXFModule[disk]) {
0068 maxPXFModule[disk] = pxf_module;
0069 }
0070 }
0071
0072 for (unsigned int i = 1; i <= ndisk; i++) {
0073 m_pxfMap[i] = std::make_pair(maxBlade[i], maxPXFModule[i]);
0074 }
0075 }