26 std::ifstream inFile(fullname, std::ios::in);
29 while (std::getline(inFile, line)) {
30 std::stringstream linestream(line);
47 chanInfo.
valid =
true;
52 check_offline_channel(chanInfo.
offlchan);
55 if ( DetToChanInfo.find(hashval) != DetToChanInfo.end() ){
56 std::cout <<
"TPCChannelMapSP: duplicate electronics channel found. detid, crate, slot, stream, streamchan: " <<
57 chanInfo.
detid <<
" " <<
58 chanInfo.
crate <<
" " <<
59 chanInfo.
slot <<
" " <<
62 throw std::range_error(
"Duplicate Electronics ID");
64 DetToChanInfo[hashval] = chanInfo;
66 if ( OfflToChanInfo.find(chanInfo.
offlchan) != OfflToChanInfo.end() ) {
67 std::cout <<
"TPCChannelMapSP: duplicate offline channel found: " <<
69 throw std::range_error(
"Duplicate Offline TPC Channel ID");
71 OfflToChanInfo[chanInfo.
offlchan] = chanInfo;
81 unsigned int streamchan)
const
83 size_t h = make_hash(
detid,crate,slot,stream,streamchan);
84 auto ret = DetToChanInfo.find(h);
85 if (ret == DetToChanInfo.end())
87 h = make_hash(
detid,fSubstituteCrate,slot,stream,streamchan);
88 ret = DetToChanInfo.find(h);
89 if (ret == DetToChanInfo.end())
92 badInfo.
valid =
false;