PixelFEDCabling

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
#ifndef PixelFEDCabling_H
#define PixelFEDCabling_H

/** \class PixelFEDCabling
 *  Represents Pixel FrontEndDriver. 
 *  Owns links (of type PixelFEDCablingLink) attached to FED
 */

#include <vector>

#include "CondFormats/SiPixelObjects/interface/PixelFEDLink.h"
class PixelModuleName;

namespace sipixelobjects {

  class PixelFEDCabling {
  public:
    typedef std::vector<PixelFEDLink> Links;

    PixelFEDCabling(unsigned int id = 0) : theFedId(id) {}

    void setLinks(Links& links);

    void addLink(const PixelFEDLink& link);

    /// return link identified by id. Link id's are ranged [1, numberOfLinks]
    const PixelFEDLink* link(unsigned int id) const {
      return (id > 0 && id <= theLinks.size()) ? &theLinks[id - 1] : nullptr;
    }

    /// number of links in FED
    unsigned int numberOfLinks() const { return theLinks.size(); }

    unsigned int id() const { return theFedId; }

    std::string print(int depth = 0) const;

    void addItem(unsigned int linkId, const PixelROC& roc);

    /// check link numbering consistency, ie. that link position in vector
    /// is the same as its id. Futhermore it checks numbering consistency for
    /// ROCs belonging to Link.
    bool checkLinkNumbering() const;

  private:
  private:
    unsigned int theFedId;
    Links theLinks;
  };
}  // namespace sipixelobjects

#endif