Item

Order

PixelEndcapLinkMaker

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 53 54 55 56 57 58 59 60 61 62 63 64
#ifndef PixelEndcapLinkMaker_H
#define PixelEndcapLinkMaker_H

#include <vector>

#include "CalibTracker/SiPixelConnectivity/interface/TRange.h"

class PixelModuleName;
class PixelEndcapName;
#include "CondFormats/SiPixelObjects/interface/PixelFEDCabling.h"
#include "CondFormats/SiPixelObjects/interface/PixelFEDLink.h"
#include <cstdint>

class PixelEndcapLinkMaker {
public:
  typedef sipixelobjects::PixelFEDCabling PixelFEDCabling;
  typedef sipixelobjects::PixelFEDLink PixelFEDLink;
  typedef sipixelobjects::PixelROC PixelROC;

  typedef std::vector<PixelModuleName*> Names;
  typedef std::vector<uint32_t> DetUnits;
  typedef PixelFEDCabling::Links Links;
  typedef TRange<int> Range;

  /// ctor from owner
  PixelEndcapLinkMaker(const PixelFEDCabling* o) : theOwner(o) {}

  /// construct links
  /// Each Endcap module triggers one or two link Items.
  /// They are sorted according to Order().
  /// The ROCs corresponding to items are created. The link is
  /// form from link items and ROCS.
  Links links(const Names& n, const DetUnits& u) const;

private:
  const PixelFEDCabling* theOwner;

  /// link item.
  /// defined by DetUnit with name (representing Pixel Detector module)
  /// and Ids of associated ROCs. The Id is the ROC number in module according
  /// to PixelDatabase.
  /// The Item represents one module (DetUnit+name) with the Plaquette type
  /// and associated ROCs Ids given explicitly (Id is the ROC number in module)
  struct Item {
    const PixelEndcapName* name;
    uint32_t unit;
    Range rocIds;
  };

  /// define order of link components.
  /// Highest priority to Endcap id (forward or backward endcpa)
  /// Second priority to disk id.
  /// Next blade
  /// Next panned
  /// To compare order of modules in one pannel plaquette id is used.
  /// The order of plaquettes define order of ROCs in link
  struct Order {
    bool operator()(const Item&, const Item&) const;
  };

private:
};

#endif