CMS 3D CMS Logo

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

#include <PixelEndcapLinkMaker.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
 
 PixelEndcapLinkMaker (const PixelFEDCabling *o)
 ctor from owner More...
 

Private Attributes

const PixelFEDCablingtheOwner
 

Detailed Description

Definition at line 14 of file PixelEndcapLinkMaker.h.

Member Typedef Documentation

◆ DetUnits

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

Definition at line 21 of file PixelEndcapLinkMaker.h.

◆ Links

Definition at line 22 of file PixelEndcapLinkMaker.h.

◆ Names

Definition at line 20 of file PixelEndcapLinkMaker.h.

◆ PixelFEDCabling

Definition at line 16 of file PixelEndcapLinkMaker.h.

◆ PixelFEDLink

Definition at line 17 of file PixelEndcapLinkMaker.h.

◆ PixelROC

Definition at line 18 of file PixelEndcapLinkMaker.h.

◆ Range

Definition at line 23 of file PixelEndcapLinkMaker.h.

Constructor & Destructor Documentation

◆ PixelEndcapLinkMaker()

PixelEndcapLinkMaker::PixelEndcapLinkMaker ( const PixelFEDCabling o)
inline

ctor from owner

Definition at line 26 of file PixelEndcapLinkMaker.h.

26 : theOwner(o) {}

Member Function Documentation

◆ links()

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

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.

Definition at line 40 of file PixelEndcapLinkMaker.cc.

40  {
41  Links result;
42  typedef Names::const_iterator CIN;
43 
44  //
45  // split names to 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  PixelEndcapName* e = dynamic_cast<PixelEndcapName*>(n[idx]);
53  uint32_t d = u[idx];
54  item.name = e;
55  item.unit = d;
56  Range rocIds(-1, -1);
57  PixelModuleName::ModuleType type = e->moduleType();
58  switch (type) {
59  case (PixelModuleName::v1x2): {
60  rocIds = Range(0, 1);
61  break;
62  }
63  case (PixelModuleName::v1x5): {
64  rocIds = Range(0, 4);
65  break;
66  }
67  case (PixelModuleName::v2x3): {
68  rocIds = Range(0, 5);
69  break;
70  }
71  case (PixelModuleName::v2x4): {
72  rocIds = Range(0, 7);
73  break;
74  }
75  case (PixelModuleName::v2x5): {
76  rocIds = Range(0, 9);
77  break;
78  }
79  default:
80  edm::LogError("PixelEndcapLinkMaker") << " *** UNEXPECTED roc: " << e->name();
81  };
82  item.rocIds = rocIds;
83  linkItems.push_back(item);
84  }
85  //
86  // sort names to get the order as in links
87  //
88 
89  sort(linkItems.begin(), linkItems.end(), Order());
90 
91  //
92  // DEBUG
93  //
94  ostringstream str;
95  for (CIU it = linkItems.begin(); it != linkItems.end(); it++) {
96  str << (*it).name->name() << " r=" << (*it).rocIds << endl;
97  }
98  LogDebug(" sorted ENDCAP links: ") << str.str();
99 
100  result.reserve(36);
101  int lastPannelId = -1;
102  int idLink = 0;
103  int idRoc = 0;
104  PixelFEDLink link(idLink); // dummy object, id=0
105 
106  for (CIU it = linkItems.begin(); it != linkItems.end(); it++) {
108  int pannelId = it->name->pannelName();
109 
110  if (pannelId != lastPannelId) {
111  lastPannelId = pannelId;
112  if (idLink > 0)
113  result.push_back(link);
114  idRoc = 0;
115  link = PixelFEDLink(++idLink); // real link, to be filled
116  }
117 
118  for (int id = (*it).rocIds.min(); id <= (*it).rocIds.max(); id++) {
119  ++idRoc;
120  rocs.push_back(PixelROC(it->unit, id, idRoc));
121  }
122 
123  link.add(rocs);
124  }
125 
126  if (idLink > 0)
127  result.push_back(link);
128  return result;
129 }

References ztail::d, MillePedeFileConverter_cfg::e, heavyIonCSV_trainingSettings::idx, B2GTnPMonitor_cfi::item, MainPageGenerator::link, LogDebug, dqmiodumpmetadata::n, mps_fire::result, PixelMapPlotter::rocs, str, PixelModuleName::v1x2, PixelModuleName::v1x5, PixelModuleName::v2x3, PixelModuleName::v2x4, and PixelModuleName::v2x5.

Member Data Documentation

◆ theOwner

const PixelFEDCabling* PixelEndcapLinkMaker::theOwner
private

Definition at line 36 of file PixelEndcapLinkMaker.h.

PixelMapPlotter.rocs
rocs
Definition: PixelMapPlotter.py:497
PixelModuleName::v2x3
Definition: PixelModuleName.h:14
PixelModuleName::v2x4
Definition: PixelModuleName.h:14
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
PixelEndcapLinkMaker::theOwner
const PixelFEDCabling * theOwner
Definition: PixelEndcapLinkMaker.h:36
PixelModuleName::v2x5
Definition: PixelModuleName.h:14
PixelModuleName::v1x5
Definition: PixelModuleName.h:14
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
PixelEndcapName
Definition: PixelEndcapName.h:16
PixelEndcapLinkMaker::PixelFEDLink
sipixelobjects::PixelFEDLink PixelFEDLink
Definition: PixelEndcapLinkMaker.h:17
PixelModuleName::ModuleType
ModuleType
Definition: PixelModuleName.h:14
PixelModuleName::v1x2
Definition: PixelModuleName.h:14
str
#define str(s)
Definition: TestProcessor.cc:51
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
PixelEndcapLinkMaker::PixelROC
sipixelobjects::PixelROC PixelROC
Definition: PixelEndcapLinkMaker.h:18
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PixelEndcapLinkMaker::Range
TRange< int > Range
Definition: PixelEndcapLinkMaker.h:23
ztail.d
d
Definition: ztail.py:151
mps_fire.result
result
Definition: mps_fire.py:311
PixelEndcapLinkMaker::Links
PixelFEDCabling::Links Links
Definition: PixelEndcapLinkMaker.h:22
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37