Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef PixelFEDLink_H
0002 #define PixelFEDLink_H
0003 
0004 /** \class PixelFEDLink
0005  * Represents Link connected to PixelFED. Owns ROCs
0006  */
0007 
0008 #include <utility>
0009 #include <vector>
0010 #include <iostream>
0011 
0012 #include "CondFormats/SiPixelObjects/interface/PixelROC.h"
0013 class PixelModuleName;
0014 
0015 namespace sipixelobjects {
0016 
0017   class PixelFEDLink {
0018   public:
0019     /// ROCs served be this link
0020     typedef std::vector<PixelROC> ROCs;
0021 
0022     /// ctor with id of link and parent FED
0023     PixelFEDLink(unsigned int id = 0) : theId(id) {}
0024 
0025     ///  add connection (defined by connection spec and ROCs)
0026     void add(const ROCs& rocs);
0027 
0028     /// link id
0029     unsigned int id() const { return theId; }
0030 
0031     /// number of ROCs in fed
0032     unsigned int numberOfROCs() const { return theROCs.size(); }
0033 
0034     /// return ROC identified by id. ROC ids are ranged [1,numberOfROCs]
0035     const PixelROC* roc(unsigned int id) const { return (id > 0 && id <= theROCs.size()) ? &theROCs[id - 1] : nullptr; }
0036 
0037     /// check ROC in link numbering consistency, ie. that ROC position in
0038     /// vector is the same as its id. To be called by owner
0039     bool checkRocNumbering() const;
0040 
0041     std::string print(int depth = 0) const;
0042 
0043     void addItem(const PixelROC& roc);
0044 
0045   private:
0046     unsigned int theId;
0047     ROCs theROCs;
0048     std::string printForMap() const;
0049   };
0050 
0051 }  // namespace sipixelobjects
0052 
0053 //std::ostream & operator<<( std::ostream& out, const PixelFEDLink & l);
0054 
0055 #endif