Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:31

0001 #ifndef SiPixelFedCablingTree_H
0002 #define SiPixelFedCablingTree_H
0003 
0004 #include "CondFormats/SiPixelObjects/interface/CablingPathToDetUnit.h"
0005 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCabling.h"
0006 #include "CondFormats/SiPixelObjects/interface/PixelFEDCabling.h"
0007 
0008 #include <vector>
0009 #include <unordered_map>
0010 #include <string>
0011 #include <map>
0012 
0013 class SiPixelFedCablingTree final : public SiPixelFedCabling {
0014 public:
0015   typedef sipixelobjects::PixelFEDCabling PixelFEDCabling;
0016 
0017   SiPixelFedCablingTree(const std::string& version = "") : theVersion(version) {}
0018 
0019   ~SiPixelFedCablingTree() override {}
0020 
0021   /// add cabling for one fed
0022   void addFed(const PixelFEDCabling& f);
0023 
0024   /// get fed identified by its id
0025   const PixelFEDCabling* fed(unsigned int idFed) const;
0026 
0027   std::vector<const PixelFEDCabling*> fedList() const;
0028 
0029   ///map version
0030   std::string version() const override { return theVersion; }
0031 
0032   std::string print(int depth = 0) const;
0033 
0034   void addItem(unsigned int fedId, unsigned int linkId, const sipixelobjects::PixelROC& roc);
0035 
0036   std::vector<sipixelobjects::CablingPathToDetUnit> pathToDetUnit(uint32_t rawDetId) const final;
0037   bool pathToDetUnitHasDetUnit(uint32_t rawDetId, unsigned int fedId) const final;
0038 
0039   const sipixelobjects::PixelROC* findItem(const sipixelobjects::CablingPathToDetUnit& path) const final;
0040 
0041   const sipixelobjects::PixelROC* findItemInFed(const sipixelobjects::CablingPathToDetUnit& path,
0042                                                 const PixelFEDCabling* aFed) const;
0043 
0044   std::unordered_map<uint32_t, unsigned int> det2fedMap() const final;
0045   std::map<uint32_t, std::vector<sipixelobjects::CablingPathToDetUnit> > det2PathMap() const final;
0046 
0047   int checkNumbering() const;
0048 
0049 private:
0050   std::string theVersion;
0051   std::unordered_map<int, PixelFEDCabling> theFedCablings;
0052 };
0053 #endif