9 typedef std::unordered_map<int, SiPixelFedCablingTree::PixelFEDCabling>::const_iterator
IMAP;
12 std::vector<sipixelobjects::CablingPathToDetUnit>
result;
13 for (
auto im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
15 for (
unsigned int idxLink = 1; idxLink <= aFed.
numberOfLinks(); idxLink++) {
20 for (
unsigned int idxRoc = 1; idxRoc <= numberOfRocs; idxRoc++) {
22 if (rawDetId ==
roc->rawId()) {
33 for (
auto im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
36 for (
unsigned int idxLink = 1; idxLink <= aFed.
numberOfLinks(); idxLink++) {
41 for (
unsigned int idxRoc = 1; idxRoc <= numberOfRocs; idxRoc++) {
43 if (rawDetId ==
roc->rawId()) {
54 std::unordered_map<uint32_t, unsigned int>
result;
55 for (
auto im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
56 auto const& aFed = im->second;
57 for (
unsigned int idxLink = 1; idxLink <= aFed.numberOfLinks(); idxLink++) {
58 auto link = aFed.link(idxLink);
61 unsigned int numberOfRocs = link->numberOfROCs();
62 for (
unsigned int idxRoc = 1; idxRoc <= numberOfRocs; idxRoc++) {
63 auto roc = link->roc(idxRoc);
72 std::map<uint32_t, std::vector<sipixelobjects::CablingPathToDetUnit> >
result;
73 for (
auto im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
74 auto const& aFed = im->second;
75 for (
unsigned int idxLink = 1; idxLink <= aFed.numberOfLinks(); idxLink++) {
76 auto link = aFed.link(idxLink);
79 unsigned int numberOfRocs = link->numberOfROCs();
80 for (
unsigned int idxRoc = 1; idxRoc <= numberOfRocs; idxRoc++) {
81 auto roc = link->roc(idxRoc);
92 theFedCablings[
id] =
f;
96 auto it = theFedCablings.find(
id);
97 return (it == theFedCablings.end()) ?
nullptr : &(*it).second;
103 out << theVersion << endl;
104 for (
IMAP it = theFedCablings.begin(); it != theFedCablings.end(); it++) {
113 std::vector<const PixelFEDCabling*>
result;
114 for (
IMAP im = theFedCablings.begin(); im != theFedCablings.end(); im++) {
115 result.push_back(&(im->second));
118 return a->id() <
b->id();
152 for (
auto im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
153 if (im->first != static_cast<int>(im->second.id())) {
155 std::cout <<
"PROBLEM WITH FED ID!!" << im->first <<
" vs: " << im->second.id() << std::endl;
157 im->second.checkLinkNumbering();
const sipixelobjects::PixelROC * findItemInFed(const sipixelobjects::CablingPathToDetUnit &path, const PixelFEDCabling *aFed) const
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id's are ranged [1, numberOfLinks]
std::string print(int depth=0) const
unsigned int numberOfROCs() const
number of ROCs in fed
void addItem(unsigned int linkId, const PixelROC &roc)
const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &path) const final
int checkNumbering() const
std::unordered_map< uint32_t, unsigned int > det2fedMap() const final
unsigned int id() const
link id
const PixelFEDCabling * fed(unsigned int idFed) const
get fed identified by its id
std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const final
std::unordered_map< int, SiPixelFedCablingTree::PixelFEDCabling >::const_iterator IMAP
unsigned int numberOfLinks() const
number of links in FED
std::vector< const PixelFEDCabling * > fedList() const
const PixelROC * roc(unsigned int id) const
return ROC identified by id. ROC ids are ranged [1,numberOfROCs]
void addFed(const PixelFEDCabling &f)
add cabling for one fed
std::map< uint32_t, std::vector< sipixelobjects::CablingPathToDetUnit > > det2PathMap() const final
void addItem(unsigned int fedId, unsigned int linkId, const sipixelobjects::PixelROC &roc)
bool pathToDetUnitHasDetUnit(uint32_t rawDetId, unsigned int fedId) const final