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 19 of file PixelBarrelLinkMaker.h.

Member Typedef Documentation

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

Definition at line 26 of file PixelBarrelLinkMaker.h.

Definition at line 27 of file PixelBarrelLinkMaker.h.

Definition at line 25 of file PixelBarrelLinkMaker.h.

Definition at line 21 of file PixelBarrelLinkMaker.h.

Definition at line 22 of file PixelBarrelLinkMaker.h.

Definition at line 23 of file PixelBarrelLinkMaker.h.

Definition at line 28 of file PixelBarrelLinkMaker.h.

Constructor & Destructor Documentation

PixelBarrelLinkMaker::PixelBarrelLinkMaker ( const PixelFEDCabling o)
inline

ctor from owner

Definition at line 31 of file PixelBarrelLinkMaker.h.

References links(), and gen::n.

31 : 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 32 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, str, and PixelBarrelLinkMaker::Item::unit.

Referenced by PixelBarrelLinkMaker().

34 {
35 
36  Links result;
37  typedef Names::const_iterator CIN;
38 
39  //
40  // construct link items from names.
41  // the item is equivalent to name for layer=3.
42  // for layer=1,2 each module has 2 links
43  //
44  vector<Item> linkItems;
45  typedef vector<Item>::const_iterator CIU;
46 
47  for(unsigned int idx = 0; idx < n.size(); idx++) {
48  Item item;
49  PixelBarrelName * b = dynamic_cast<PixelBarrelName * >(n[idx]);
50  uint32_t d = u[idx];
51  item.name = b;
52  item.unit = d;
53 
54  if ( b->isHalfModule()) {
55  item.rocIds = Range(0,7); // half modules
56  linkItems.push_back(item);
57  } else if(b->layerName() <= 2) {
58  item.rocIds = Range(0,7); // first link for modules in Layer=1,2
59  linkItems.push_back(item);
60  item.rocIds = Range(8,15); // second link for modules in Layer=1,2
61  linkItems.push_back(item);
62  } else {
63  item.rocIds = Range(0,15); // one module per link
64  linkItems.push_back(item);
65  }
66  }
67 
68 
69 
70  //
71  // sort link items to get the order as in links
72  //
73 
74  Order myLess;
75  sort( linkItems.begin(), linkItems.end(), myLess );
76 
77  //
78  // DEBUG
79  //
80  ostringstream str;
81  for (CIU it = linkItems.begin(); it != linkItems.end(); it++) {
82  str << (*it).name->name() <<" r="<< (*it).rocIds << endl;
83  }
84  LogDebug(" sorted BARREL links: ") << str.str();
85 
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 41 of file PixelBarrelLinkMaker.h.