9 typedef std::unordered_map<int, SiPixelFedCablingTree::PixelFEDCabling>::const_iterator
IMAP;
12 uint32_t rawDetId)
const 14 std::vector<sipixelobjects::CablingPathToDetUnit>
result;
15 for (
auto im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
17 for (
unsigned int idxLink = 1; idxLink <= aFed.
numberOfLinks(); idxLink++) {
21 for(
unsigned int idxRoc = 1; idxRoc <= numberOfRocs; idxRoc++) {
23 if (rawDetId == roc->
rawId() ) {
25 result.push_back(path);
34 std::unordered_map<uint32_t, unsigned int>
result;
35 for (
auto im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
36 auto const & aFed = im->second;
37 for (
unsigned int idxLink = 1; idxLink <= aFed.numberOfLinks(); idxLink++) {
38 auto link = aFed.link(idxLink);
40 unsigned int numberOfRocs = link->numberOfROCs();
41 for(
unsigned int idxRoc = 1; idxRoc <= numberOfRocs; idxRoc++) {
42 auto roc = link->roc(idxRoc);
43 result[roc->rawId()]=aFed.id();
51 std::map< uint32_t,std::vector<sipixelobjects::CablingPathToDetUnit> >
result;
52 for (
auto im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
53 auto const & aFed = im->second;
54 for (
unsigned int idxLink = 1; idxLink <= aFed.numberOfLinks(); idxLink++) {
55 auto link = aFed.link(idxLink);
57 unsigned int numberOfRocs = link->numberOfROCs();
58 for(
unsigned int idxRoc = 1; idxRoc <= numberOfRocs; idxRoc++) {
59 auto roc = link->roc(idxRoc);
61 result[roc->rawId()].push_back(path);
71 theFedCablings[
id] =
f;
76 auto it = theFedCablings.find(
id);
77 return ( it == theFedCablings.end() ) ? 0 : & (*it).second;
84 out << theVersion << endl;
85 for(
IMAP it=theFedCablings.begin(); it != theFedCablings.end(); it++) {
86 out << (*it).second.print(depth);
95 std::vector<const PixelFEDCabling *>
result;
96 for (
IMAP im = theFedCablings.begin(); im != theFedCablings.end(); im++) {
97 result.push_back( &(im->second) );
118 if (aLink) roc = aLink->
roc(path.
roc);
130 if (aLink) roc = aLink->
roc(path.
roc);
138 for (
auto im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
139 if (im->first != static_cast<int>( im->second.id())) {
141 std::cout <<
"PROBLEM WITH FED ID!!" << im->first <<
" vs: "<< im->second.id() << std::endl;
143 im->second.checkLinkNumbering();
const PixelROC * roc(unsigned int id) const
return ROC identified by id. ROC ids are ranged [1,numberOfROCs]
unsigned int id() const
link id
unsigned int numberOfLinks() const
number of links in FED
std::map< uint32_t, std::vector< sipixelobjects::CablingPathToDetUnit > > det2PathMap() const override
unsigned int idInLink() const
id of this ROC in parent Link.
void addItem(unsigned int linkId, const PixelROC &roc)
std::unordered_map< uint32_t, unsigned int > det2fedMap() const override
unsigned int numberOfROCs() const
number of ROCs in fed
virtual std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const
int checkNumbering() const
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
virtual const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &path) const
std::unordered_map< int, SiPixelFedCablingTree::PixelFEDCabling >::const_iterator IMAP
const PixelFEDCabling * fed(unsigned int idFed) const
get fed identified by its id
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id's are ranged [1, numberOfLinks]
void addFed(const PixelFEDCabling &f)
add cabling for one fed
const sipixelobjects::PixelROC * findItemInFed(const sipixelobjects::CablingPathToDetUnit &path, const PixelFEDCabling *aFed) const
void addItem(unsigned int fedId, unsigned int linkId, const sipixelobjects::PixelROC &roc)
std::vector< const PixelFEDCabling * > fedList() const
std::string print(int depth=0) const