19 unsigned int fedId = (theMap.begin())->
first.fed;
23 if (theVersion.find(
"CMSSW_9_0_X")!=std::string::npos) {
24 for (
auto &
v : theMap)
v.second.initFrameConversionPhase1_CMSSW_9_0_X();
25 std::cout<<
"*** Found CMSSW_9_0_X specific cabling map\n";
30 for (
auto &
v : theMap)
v.second.initFrameConversionPhase1();
32 for (
auto &
v : theMap)
v.second.initFrameConversion();
58 if (fed < other.
fed)
return true;
59 if (fed > other.
fed)
return false;
61 if (link < other.
link)
return true;
62 if (link > other.
link)
return false;
64 if (roc < other.
roc)
return true;
65 if (roc > other.
roc)
return false;
75 std::vector<const PixelFEDCabling *> fedList = cab->
fedList();
76 for (std::vector<const PixelFEDCabling *>::const_iterator ifed=fedList.begin();
77 ifed != fedList.end(); ifed++) {
78 unsigned int fed = (**ifed).id();
79 unsigned int numLink = (**ifed).numberOfLinks();
80 for (
unsigned int link=1; link <= numLink; link++) {
82 if (pLink==0)
continue;
88 for (
unsigned int roc=1; roc <= numberROC; roc++) {
90 if (pROC==0)
continue;
93 Key key = {fed, link, roc};
104 for (Map::const_iterator im =
theMap.begin(); im !=
theMap.end(); im++) {
106 unsigned int fedId = im->first.fed;
107 unsigned int linkId = im->first.link;
108 tree->addItem(fedId, linkId, roc);
114 std::vector<unsigned int>
result;
115 for (Map::const_iterator im =
theMap.begin(); im !=
theMap.end(); im++) {
116 unsigned int fedId = im->first.fed;
117 if (
find(result.begin(),result.end(),
fedId) == result.end()) result.push_back(fedId);
126 Map::const_iterator inMap =
theMap.find(key);
127 if (inMap!=
theMap.end()) roc = &(inMap->second);
133 std::unordered_map<uint32_t, unsigned int>
result;
134 for (
auto im =
theMap.begin(); im !=
theMap.end(); ++im) {
135 result[im->second.rawId()] = im->first.fed;
141 std::map< uint32_t,std::vector<sipixelobjects::CablingPathToDetUnit> >
result;
142 for (
auto im =
theMap.begin(); im !=
theMap.end(); ++im) {
144 result[im->second.rawId()].push_back(path);
151 uint32_t rawDetId)
const {
153 std::vector<sipixelobjects::CablingPathToDetUnit>
result;
154 for (
auto im =
theMap.begin(); im !=
theMap.end(); ++im) {
155 if(im->second.rawId()==rawDetId ) {
157 result.push_back(path);
const PixelROC * roc(unsigned int id) const
return ROC identified by id. ROC ids are ranged [1,numberOfROCs]
SiPixelFedCablingMap(const SiPixelFedCablingTree *cab)
bool operator<(const Key &other) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
unsigned int numberOfROCs() const
number of ROCs in fed
std::map< uint32_t, std::vector< sipixelobjects::CablingPathToDetUnit > > det2PathMap() const override
std::unordered_map< uint32_t, unsigned int > det2fedMap() const override
std::unique_ptr< SiPixelFedCablingTree > cablingTree() const
std::vector< unsigned int > fedIds() const
virtual std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const override
virtual const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &path) const override
std::vector< const PixelFEDCabling * > fedList() const