Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:26

0001 #ifndef Geometry_TrackerGeometryBuilder_PixelTopologyMap_H
0002 #define Geometry_TrackerGeometryBuilder_PixelTopologyMap_H
0003 
0004 // system include files
0005 #include <map>
0006 #include <memory>
0007 #include <iostream>
0008 #include <iomanip>  // std::setw
0009 
0010 // user include files
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  * A specific Pixel Tracker class to determine the number of ladders / modules in PXB
0018    and number of blades/modules in PXF
0019  */
0020 class PixelTopologyMap {
0021 public:
0022   PixelTopologyMap(const TrackerGeometry* geom, const TrackerTopology* topo)
0023       : m_trackerTopo{topo}, m_trackerGeom{geom} {
0024     // build the maps
0025     buildTopologyMaps();
0026   }
0027 
0028   ~PixelTopologyMap() = default;
0029 
0030   // getter methods
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   // printout
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