Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef PixelFEDCabling_H
0002 #define PixelFEDCabling_H
0003 
0004 /** \class PixelFEDCabling
0005  *  Represents Pixel FrontEndDriver. 
0006  *  Owns links (of type PixelFEDCablingLink) attached to FED
0007  */
0008 
0009 #include <vector>
0010 
0011 #include "CondFormats/SiPixelObjects/interface/PixelFEDLink.h"
0012 class PixelModuleName;
0013 
0014 namespace sipixelobjects {
0015 
0016   class PixelFEDCabling {
0017   public:
0018     typedef std::vector<PixelFEDLink> Links;
0019 
0020     PixelFEDCabling(unsigned int id = 0) : theFedId(id) {}
0021 
0022     void setLinks(Links& links);
0023 
0024     void addLink(const PixelFEDLink& link);
0025 
0026     /// return link identified by id. Link id's are ranged [1, numberOfLinks]
0027     const PixelFEDLink* link(unsigned int id) const {
0028       return (id > 0 && id <= theLinks.size()) ? &theLinks[id - 1] : nullptr;
0029     }
0030 
0031     /// number of links in FED
0032     unsigned int numberOfLinks() const { return theLinks.size(); }
0033 
0034     unsigned int id() const { return theFedId; }
0035 
0036     std::string print(int depth = 0) const;
0037 
0038     void addItem(unsigned int linkId, const PixelROC& roc);
0039 
0040     /// check link numbering consistency, ie. that link position in vector
0041     /// is the same as its id. Futhermore it checks numbering consistency for
0042     /// ROCs belonging to Link.
0043     bool checkLinkNumbering() const;
0044 
0045   private:
0046   private:
0047     unsigned int theFedId;
0048     Links theLinks;
0049   };
0050 }  // namespace sipixelobjects
0051 
0052 #endif