62 std::ifstream inputFile_;
63 inputFile_.open(fp.c_str());
65 std::map<uint32_t, std::pair<uint32_t, uint32_t> > dcuDetIdMap;
66 uint32_t dcuid, Olddetid, Newdetid;
71 <<
"::manipulate : since no file is specified, the copy of the input cabling will be applied" << std::endl;
74 }
else if (!inputFile_.is_open()) {
75 edm::LogError(
"SiStripFedCablingManipulator") <<
"::manipulate - ERROR in opening file " << fp << std::endl;
76 throw cms::Exception(
"CorruptedData") <<
"::manipulate - ERROR in opening file " << fp << std::endl;
79 inputFile_ >> dcuid >> Olddetid >> Newdetid;
81 if (!(inputFile_.eof() || inputFile_.fail())) {
82 if (dcuDetIdMap.find(dcuid) == dcuDetIdMap.end()) {
83 edm::LogInfo(
"SiStripFedCablingManipulator") << dcuid <<
" " << Olddetid <<
" " << Newdetid << std::endl;
85 dcuDetIdMap[dcuid] = std::pair<uint32_t, uint32_t>(Olddetid, Newdetid);
88 <<
"::manipulate - ERROR duplicated dcuid " << dcuid << std::endl;
90 <<
"SiStripFedCablingManipulator::manipulate - ERROR duplicated dcuid " << dcuid;
93 }
else if (inputFile_.eof()) {
94 edm::LogInfo(
"SiStripFedCablingManipulator") <<
"::manipulate - END of file reached" << std::endl;
96 }
else if (inputFile_.fail()) {
97 edm::LogError(
"SiStripFedCablingManipulator") <<
"::manipulate - ERROR while reading file" << std::endl;
102 std::map<uint32_t, std::pair<uint32_t, uint32_t> >::const_iterator it = dcuDetIdMap.begin();
103 for (; it != dcuDetIdMap.end(); ++it)
105 <<
"::manipulate - Map " << it->first <<
" " << it->second.first <<
" " << it->second.second;
107 std::vector<FedChannelConnection> conns;
110 for (
auto ifeds =
feds.begin(); ifeds !=
feds.end(); ifeds++) {
112 for (
auto iconn = conns_per_fed.begin(); iconn != conns_per_fed.end(); ++iconn) {
113 std::map<uint32_t, std::pair<uint32_t, uint32_t> >::const_iterator it = dcuDetIdMap.find(iconn->dcuId());
114 if (it != dcuDetIdMap.end() && it->second.first == iconn->detId()) {
116 <<
"::manipulate - fedid " << *ifeds <<
" dcuid " << iconn->dcuId() <<
" oldDet " << iconn->detId()
117 <<
" newDetID " << it->second.second;
130 iconn->fiberLength(),
148 iconn->fiberLength(),
T getParameter(std::string const &) const
Class containning control, module, detector and connection information, at the level of a FED channel...
FedsConstIterRange fedIds() const
ConnsConstIterRange fedConnections(uint16_t fed_id) const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
edm::ParameterSet iConfig_