Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:34

0001 #ifndef EventFilter_SiPixelRawToDigi_SiPixelFedCablingMap_H
0002 #define EventFilter_SiPixelRawToDigi_SiPixelFedCablingMap_H
0003 
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005 
0006 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCabling.h"
0007 #include "CondFormats/SiPixelObjects/interface/PixelROC.h"
0008 
0009 #include <string>
0010 #include <map>
0011 #include <memory>
0012 
0013 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
0014 #define NO_DICT
0015 #endif
0016 
0017 class SiPixelFedCablingTree;
0018 
0019 class SiPixelFedCablingMap : public SiPixelFedCabling {
0020 public:
0021   SiPixelFedCablingMap(const SiPixelFedCablingTree* cab);
0022 
0023   SiPixelFedCablingMap(const std::string& version = "") : theVersion(version) {}
0024 
0025   void initializeRocs();
0026 
0027   ~SiPixelFedCablingMap() override {}
0028 
0029 #ifdef NO_DICT
0030   std::unique_ptr<SiPixelFedCablingTree> cablingTree() const;
0031 #endif
0032 
0033   std::string version() const override { return theVersion; }
0034 
0035   const sipixelobjects::PixelROC* findItem(const sipixelobjects::CablingPathToDetUnit& path) const final;
0036 
0037   std::vector<sipixelobjects::CablingPathToDetUnit> pathToDetUnit(uint32_t rawDetId) const final;
0038 
0039   bool pathToDetUnitHasDetUnit(uint32_t rawDetId, unsigned int fedId) const final;
0040 
0041   std::unordered_map<uint32_t, unsigned int> det2fedMap() const final;
0042   std::map<uint32_t, std::vector<sipixelobjects::CablingPathToDetUnit> > det2PathMap() const final;
0043 
0044   std::vector<unsigned int> fedIds() const;
0045 
0046   struct Key {
0047     unsigned int fed, link, roc;
0048     bool operator<(const Key& other) const;
0049     COND_SERIALIZABLE;
0050   };
0051 
0052 private:
0053   std::string theVersion;
0054   typedef std::map<Key, sipixelobjects::PixelROC> Map;
0055   Map theMap;
0056 
0057   COND_SERIALIZABLE;
0058 };
0059 
0060 #endif