File indexing completed on 2024-04-06 11:59:36
0001 #ifndef SiPixelTopoFinder_H
0002 #define SiPixelTopoFinder_H
0003
0004
0005
0006
0007 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0008 #include "DataFormats/DetId/interface/DetId.h"
0009 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0010 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
0011 #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
0012 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h"
0013 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
0014 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h"
0015
0016 class SiPixelTopoFinder {
0017 public:
0018 SiPixelTopoFinder();
0019 ~SiPixelTopoFinder();
0020
0021 void init(const TrackerGeometry* trackerGeometry,
0022 const TrackerTopology* trackerTopology,
0023 const SiPixelFedCablingMap* siPixelFedCablingMap);
0024
0025 std::vector<int> getDetIds() const { return fDetIds_; }
0026
0027 std::map<int, std::pair<int, int>> getSensors() const { return fSensors_; }
0028
0029 std::map<int, std::pair<int, int>> getSensorLayout() const { return fSensorLayout_; }
0030
0031 std::unordered_map<uint32_t, unsigned int> getFedIds() const { return fFedIds_; }
0032
0033 std::map<int, std::map<int, int>> getRocIds() const { return fRocIds_; }
0034
0035 private:
0036
0037 int phase_ = -1;
0038
0039 const TrackerTopology* tkTopo_ = nullptr;
0040 const TrackerGeometry* tkGeom_ = nullptr;
0041 const SiPixelFedCablingMap* cablingMap_ = nullptr;
0042
0043
0044 std::vector<int> fDetIds_;
0045
0046 std::map<int, std::pair<int, int>> fSensors_;
0047
0048 std::map<int, std::pair<int, int>> fSensorLayout_;
0049
0050 std::unordered_map<uint32_t, unsigned int> fFedIds_;
0051
0052 std::map<int, std::map<int, int>> fRocIds_;
0053
0054
0055 void onlineRocColRow(const DetId& detId,
0056 const SiPixelFedCablingMap* cablingMap,
0057 int fedId,
0058 int offlineRow,
0059 int offlineCol,
0060 int& roc,
0061 int& row,
0062 int& col);
0063
0064 int indexROC(int irow, int icol, int nROCcolumns);
0065
0066
0067 int quadrant(const DetId& detid);
0068 int side(const DetId& detid);
0069 int half(const DetId& detid);
0070 };
0071
0072 #endif