CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Attributes
PixelBarrelLinkMaker Class Reference

#include <PixelBarrelLinkMaker.h>

Classes

struct  Item
 
struct  Order
 

Public Types

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

Public Member Functions

Links links (const Names &n, const DetUnits &u) const
 
 PixelBarrelLinkMaker (const PixelFEDCabling *o)
 ctor from owner More...
 

Private Attributes

const PixelFEDCablingtheOwner
 

Detailed Description

Assign barrel pixel modules (defined by name and unit) to links

Definition at line 18 of file PixelBarrelLinkMaker.h.

Member Typedef Documentation

typedef std::vector<uint32_t> PixelBarrelLinkMaker::DetUnits

Definition at line 25 of file PixelBarrelLinkMaker.h.

Definition at line 26 of file PixelBarrelLinkMaker.h.

Definition at line 24 of file PixelBarrelLinkMaker.h.

Definition at line 20 of file PixelBarrelLinkMaker.h.

Definition at line 21 of file PixelBarrelLinkMaker.h.

Definition at line 22 of file PixelBarrelLinkMaker.h.

Definition at line 27 of file PixelBarrelLinkMaker.h.

Constructor & Destructor Documentation

PixelBarrelLinkMaker::PixelBarrelLinkMaker ( const PixelFEDCabling o)
inline

ctor from owner

Definition at line 30 of file PixelBarrelLinkMaker.h.

References links(), and gen::n.

30 : theOwner(o) {}
const PixelFEDCabling * theOwner

Member Function Documentation

PixelBarrelLinkMaker::Links PixelBarrelLinkMaker::links ( const Names n,
const DetUnits u 
) const

construct links Each barrel 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.

Definition at line 38 of file PixelBarrelLinkMaker.cc.

References sipixelobjects::PixelFEDLink::add(), b, edmIntegrityCheck::d, training_settings::idx, PixelBarrelName::isHalfModule(), PixelBarrelName::layerName(), LogDebug, PixelBarrelLinkMaker::Item::name, mps_fire::result, PixelBarrelLinkMaker::Item::rocIds, jetUpdater_cfi::sort, str, and PixelBarrelLinkMaker::Item::unit.

Referenced by PixelBarrelLinkMaker().

38  {
39  Links result;
40  typedef Names::const_iterator CIN;
41 
42  //
43  // construct link items from names.
44  // the item is equivalent to name for layer=3.
45  // for layer=1,2 each module has 2 links
46  //
47  vector<Item> linkItems;
48  typedef vector<Item>::const_iterator CIU;
49 
50  for (unsigned int idx = 0; idx < n.size(); idx++) {
51  Item item;
52  PixelBarrelName* b = dynamic_cast<PixelBarrelName*>(n[idx]);
53  uint32_t d = u[idx];
54  item.name = b;
55  item.unit = d;
56 
57  if (b->isHalfModule()) {
58  item.rocIds = Range(0, 7); // half modules
59  linkItems.push_back(item);
60  } else if (b->layerName() <= 2) {
61  item.rocIds = Range(0, 7); // first link for modules in Layer=1,2
62  linkItems.push_back(item);
63  item.rocIds = Range(8, 15); // second link for modules in Layer=1,2
64  linkItems.push_back(item);
65  } else {
66  item.rocIds = Range(0, 15); // one module per link
67  linkItems.push_back(item);
68  }
69  }
70 
71  //
72  // sort link items to get the order as in links
73  //
74 
75  Order myLess;
76  sort(linkItems.begin(), linkItems.end(), myLess);
77 
78  //
79  // DEBUG
80  //
81  ostringstream str;
82  for (CIU it = linkItems.begin(); it != linkItems.end(); it++) {
83  str << (*it).name->name() << " r=" << (*it).rocIds << endl;
84  }
85  LogDebug(" sorted BARREL links: ") << str.str();
86 
87  //
88  // create corresponding PixelROC and link
89  //
90  int idLink = 0;
91  result.reserve(linkItems.size());
92  for (CIU it = linkItems.begin(); it != linkItems.end(); it++) {
93  PixelFEDLink::ROCs rocs;
94  PixelFEDLink link(++idLink);
95  int idRoc = 0;
96  for (int id = (*it).rocIds.min(); id <= (*it).rocIds.max(); id++) {
97  idRoc++;
98  rocs.push_back(PixelROC(it->unit, id, idRoc));
99  }
100  link.add(rocs);
101  result.push_back(link);
102  }
103 
104  return result;
105 }
#define LogDebug(id)
PixelFEDCabling::Links Links
bool isHalfModule() const
full or half module
sipixelobjects::PixelROC PixelROC
int layerName() const
layer id
double b
Definition: hdecay.h:120
#define str(s)

Member Data Documentation

const PixelFEDCabling* PixelBarrelLinkMaker::theOwner
private

Definition at line 40 of file PixelBarrelLinkMaker.h.