9 edm::LogInfo(
"SiStripFedCablingManipulator") <<
"SiStripFedCablingManipulator constructor "<< std::endl;
14 edm::LogInfo(
"SiStripFedCablingManipulator") <<
"SiStripFedCablingManipulator::~SiStripFedCablingManipulator()" << std::endl;
32 edm::LogError(
"SiStripFedCablingManipulator")<<
"null pointer obj. nothing will be written "<<std::endl;
37 if(openIovAt==
"beginOfTime")
39 else if (openIovAt==
"currentTime")
46 edm::LogInfo(
"SiStripFedCablingManipulator") <<
"first request for storing objects with Record "<<
"SiStripFedCablingRcd" <<
" at time " << Time_ << std::endl;
49 edm::LogInfo(
"SiStripFedCablingManipulator") <<
"appending a new object to existing tag " <<
"SiStripFedCablingRcd" <<
" in since mode " << std::endl;
53 edm::LogError(
"SiStripFedCablingManipulator")<<
"Service is unavailable"<<std::endl;
61 std::ifstream inputFile_;
62 inputFile_.open(fp.c_str());
64 std::map<uint32_t, std::pair<uint32_t, uint32_t> > dcuDetIdMap;
65 uint32_t dcuid, Olddetid, Newdetid;
69 edm::LogInfo(
"SiStripFedCablingManipulator") <<
"::manipulate : since no file is specified, the copy of the input cabling will be applied"<< std::endl;
72 }
else if (!inputFile_.is_open()){
73 edm::LogError(
"SiStripFedCablingManipulator") <<
"::manipulate - ERROR in opening file " << fp << std::endl;
74 throw cms::Exception(
"CorruptedData") <<
"::manipulate - ERROR in opening file " << fp << std::endl;
78 inputFile_ >> dcuid >> Olddetid >> Newdetid;
80 if (!(inputFile_.eof() || inputFile_.fail())){
82 if(dcuDetIdMap.find(dcuid)==dcuDetIdMap.end()){
84 edm::LogInfo(
"SiStripFedCablingManipulator") << dcuid <<
" " << Olddetid <<
" " << Newdetid << std::endl;
86 dcuDetIdMap[dcuid]=std::pair<uint32_t, uint32_t>(Olddetid,Newdetid);
88 edm::LogError(
"SiStripFedCablingManipulator") <<
"::manipulate - ERROR duplicated dcuid " << dcuid <<std::endl;
89 throw cms::Exception(
"CorruptedData") <<
"SiStripFedCablingManipulator::manipulate - ERROR duplicated dcuid " << dcuid ;
92 }
else if (inputFile_.eof()){
93 edm::LogInfo(
"SiStripFedCablingManipulator")<<
"::manipulate - END of file reached"<<std::endl;
95 }
else if (inputFile_.fail()) {
96 edm::LogError(
"SiStripFedCablingManipulator")<<
"::manipulate - ERROR while reading file"<<std::endl;
101 std::map<uint32_t, std::pair<uint32_t, uint32_t> >::const_iterator it=dcuDetIdMap.begin();
102 for (;it!=dcuDetIdMap.end();++it)
103 edm::LogInfo(
"SiStripFedCablingManipulator")<<
"::manipulate - Map "<< it->first <<
" " << it->second.first <<
" " << it->second.second;
106 std::vector<FedChannelConnection> conns;
109 for(
auto ifeds=feds.begin();ifeds!=feds.end();ifeds++){
111 for(
auto iconn=conns_per_fed.begin();iconn!=conns_per_fed.end();++iconn){
112 std::map<uint32_t, std::pair<uint32_t, uint32_t> >::const_iterator it=dcuDetIdMap.find(iconn->dcuId());
113 if(it!=dcuDetIdMap.end() && it->second.first==iconn->detId()){
114 edm::LogInfo(
"SiStripFedCablingManipulator")<<
"::manipulate - fedid "<< *ifeds <<
" dcuid " << iconn->dcuId() <<
" oldDet " << iconn->detId() <<
" newDetID " << it->second.second ;
128 iconn->fiberLength(),
149 iconn->fiberLength(),
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
~SiStripFedCablingManipulator()
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
unsigned long long Time_t
bool isNewTagRequest(const std::string &recordName)
Class containning control, module, detector and connection information, at the level of a FED channel...
FedsConstIterRange fedIds() const
cond::Time_t beginOfTime() const
SiStripFedCablingManipulator(const edm::ParameterSet &iConfig)
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
void manipulate(const SiStripFedCabling *, SiStripFedCabling *&)
T const * product() const
cond::Time_t endOfTime() 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_
cond::Time_t currentTime() const
void endRun(const edm::Run &run, const edm::EventSetup &es)