File indexing completed on 2024-04-06 12:15:26
0001 #ifndef Geometry_TrackerGeometryBuilder_PixelTopologyMap_H
0002 #define Geometry_TrackerGeometryBuilder_PixelTopologyMap_H
0003
0004
0005 #include <map>
0006 #include <memory>
0007 #include <iostream>
0008 #include <iomanip> // std::setw
0009
0010
0011 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0012 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0013 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
0014 #include "TrackerGeometry.h"
0015
0016
0017
0018
0019
0020 class PixelTopologyMap {
0021 public:
0022 PixelTopologyMap(const TrackerGeometry* geom, const TrackerTopology* topo)
0023 : m_trackerTopo{topo}, m_trackerGeom{geom} {
0024
0025 buildTopologyMaps();
0026 }
0027
0028 ~PixelTopologyMap() = default;
0029
0030
0031
0032 inline const unsigned getPXBLadders(unsigned int lay) const { return m_pxbMap.at(lay).first; }
0033 inline const unsigned getPXBModules(unsigned int lay) const { return m_pxbMap.at(lay).second; }
0034 inline const unsigned getPXFBlades(int disk) const { return m_pxfMap.at(std::abs(disk)).first; }
0035 inline const unsigned getPXFModules(int disk) const { return m_pxfMap.at(std::abs(disk)).second; }
0036
0037
0038 void printAll(std::ostream& os) const;
0039
0040 private:
0041 void buildTopologyMaps();
0042
0043 const TrackerTopology* m_trackerTopo;
0044 const TrackerGeometry* m_trackerGeom;
0045
0046 std::map<unsigned, std::pair<unsigned, unsigned>> m_pxbMap;
0047 std::map<unsigned, std::pair<unsigned, unsigned>> m_pxfMap;
0048 };
0049
0050 inline std::ostream& operator<<(std::ostream& os, PixelTopologyMap map) {
0051 std::stringstream ss;
0052 map.printAll(ss);
0053 os << ss.str();
0054 return os;
0055 }
0056
0057 #endif