File indexing completed on 2024-04-06 12:02:34
0001 #ifndef SiPixelTools_SiPixelFrameReverter_H
0002 #define SiPixelTools_SiPixelFrameReverter_H
0003
0004 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCabling.h"
0005 #include "CondFormats/SiPixelObjects/interface/CablingPathToDetUnit.h"
0006 #include "CondFormats/SiPixelObjects/interface/GlobalPixel.h"
0007 #include "CondFormats/SiPixelObjects/interface/LocalPixel.h"
0008 #include "CondFormats/SiPixelObjects/interface/ElectronicIndex.h"
0009 #include "CondFormats/SiPixelObjects/interface/DetectorIndex.h"
0010
0011 #include <cstdint>
0012 #include <map>
0013 #include <vector>
0014
0015 class TrackerGeometry;
0016
0017 class SiPixelFrameReverter {
0018 public:
0019 SiPixelFrameReverter(const SiPixelFedCabling* map);
0020
0021 void buildStructure(const TrackerGeometry*);
0022
0023
0024 bool hasDetUnit(uint32_t detId) const { return (DetToFedMap.find(detId) != DetToFedMap.end()); }
0025
0026
0027 int toCabling(sipixelobjects::ElectronicIndex& cabling, const sipixelobjects::DetectorIndex& detector) const;
0028
0029
0030 int findFedId(uint32_t detId);
0031
0032
0033
0034 short findLinkInFed(uint32_t detId, sipixelobjects::GlobalPixel global);
0035
0036
0037
0038 short findRocInLink(uint32_t detId, sipixelobjects::GlobalPixel global);
0039
0040
0041
0042 short findRocInDet(uint32_t detId, sipixelobjects::GlobalPixel global);
0043
0044
0045 sipixelobjects::LocalPixel findPixelInRoc(uint32_t detId, sipixelobjects::GlobalPixel global);
0046
0047 private:
0048 const SiPixelFedCabling* map_;
0049
0050 std::map<uint32_t, std::vector<sipixelobjects::CablingPathToDetUnit> > DetToFedMap;
0051 };
0052 #endif