Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:59:31

0001 #ifndef PixelBarrelLinkMaker_H
0002 #define PixelBarrelLinkMaker_H
0003 
0004 /** \class PixelBarrelLinkMaker
0005  * Assign barrel pixel modules (defined by name and unit) to links
0006  */
0007 
0008 #include <vector>
0009 
0010 #include "CalibTracker/SiPixelConnectivity/interface/TRange.h"
0011 
0012 class PixelModuleName;
0013 class PixelBarrelName;
0014 #include "CondFormats/SiPixelObjects/interface/PixelFEDCabling.h"
0015 #include "CondFormats/SiPixelObjects/interface/PixelFEDLink.h"
0016 #include <cstdint>
0017 
0018 class PixelBarrelLinkMaker {
0019 public:
0020   typedef sipixelobjects::PixelFEDCabling PixelFEDCabling;
0021   typedef sipixelobjects::PixelFEDLink PixelFEDLink;
0022   typedef sipixelobjects::PixelROC PixelROC;
0023 
0024   typedef std::vector<PixelModuleName*> Names;
0025   typedef std::vector<uint32_t> DetUnits;
0026   typedef PixelFEDCabling::Links Links;
0027   typedef TRange<int> Range;
0028 
0029   /// ctor from owner
0030   PixelBarrelLinkMaker(const PixelFEDCabling* o) : theOwner(o) {}
0031 
0032   /// construct links
0033   /// Each barrel module triggers one or two link Items.
0034   /// They are sorted according to Order().
0035   /// The ROCs corresponding to items are created. The link is
0036   /// form from link items and ROCS.
0037   Links links(const Names& n, const DetUnits& u) const;
0038 
0039 private:
0040   const PixelFEDCabling* theOwner;
0041 
0042   /// link item.
0043   /// defined by DetUnit with name (representing Pixel Detector module)
0044   /// and Ids of associated ROCs. The Id is the ROC number in module according
0045   /// to PixelDatabase.
0046   struct Item {
0047     const PixelBarrelName* name;
0048     uint32_t unit;
0049     Range rocIds;
0050   };
0051 
0052   /// define order of items in a link.
0053   /// Highest priority to layer id.
0054   /// Second priority for ladder id (phi).
0055   /// Third priority by abs(module) (ie. along |z|)
0056   /// If all equal id of ROC matters
0057   struct Order {
0058     bool operator()(const Item&, const Item&) const;
0059   };
0060 
0061 private:
0062 };
0063 
0064 #endif