8#include "GaudiKernel/MsgStream.h"
12std::vector<LArBadChannelDecoder::BadChanEntry>
17 std::vector<BadChanEntry>
result;
21 if (!parser.fileStatusGood()) {
22 log << MSG::ERROR <<
"Failed to open file " << fname
27 typedef std::string ParseType;
28 typedef std::pair<std::vector<int>, std::vector<ParseType> > ParsedLine;
29 std::vector<ParsedLine> parsed = parser.parseFile<ParseType>();
30 log << MSG::INFO <<
"Parsed " << parsed.size() <<
" lines from file " << fname <<
endmsg;
32 for (std::vector<ParsedLine>::const_iterator i=parsed.begin();
33 i != parsed.end(); ++i) {
38 result.emplace_back( hwid, badCh.second);
45std::vector<LArBadChannelDecoder::BadFebEntry>
49 std::vector<BadFebEntry>
result;
53 if (!parser.fileStatusGood()) {
54 log << MSG::ERROR <<
"Failed to open missing FEBs file " << fname <<
endmsg;
58 typedef std::string ParseType;
59 typedef std::pair<std::vector<int>, std::vector<ParseType> > ParsedLine;
60 std::vector<ParsedLine> parsed = parser.parseFile<ParseType>();
61 for (std::vector<ParsedLine>::const_iterator i=parsed.begin();
62 i != parsed.end(); ++i) {
68 for (std::vector<HWIdentifier>::const_iterator i=hwid.begin(); i!=hwid.end(); ++i) {
69 result.emplace_back( *i, badFeb.second);
82 if (intVec.size() < 5) {
83 log << MSG::WARNING <<
"Failed to produce a channel HWIdentifier for ";
84 for (
unsigned int i=0; i<intVec.size(); i++) log << intVec[i] <<
" ";
85 log <<
"not enough identifiers" <<
endmsg;
98 log <<
" to 0x" << MSG::hex << hwid << MSG::dec <<
endmsg;
108 MsgStream& log)
const
110 const int maxFebPerFT = 15;
112 std::vector<HWIdentifier>
result;
113 if (intVec.size() != 4) {
114 log << MSG::WARNING <<
"Failed to produce a FEB HWIdentifier for ";
115 for (
unsigned int i=0; i<intVec.size(); i++) log << intVec[i] <<
" ";
116 log <<
"not enough identifiers" <<
endmsg;
121 if (intVec[
slot] == -1) {
122 std::vector<int>
vec( intVec);
139 MsgStream& log)
const
142 if (v.size() != 4)
return invalid;
146 log <<
" to 0x" << MSG::hex << hwid << MSG::dec <<
endmsg;
150 log << MSG::ERROR <<
"Failed to produce a FEB HWIdentifier for ";
insertExpandedID( v, log);
156std::pair<bool,LArBadChannel>
160 for(std::vector<std::string>::const_iterator it =
vec.begin(); it !=
vec.end(); ++it) {
167 log << MSG::WARNING <<
"LArBadChannelDecoder REJECTED line with "
168 <<
":\t unrecognized problem status: " << *it <<
endmsg;
169 return std::pair<bool,LArBadChannel>(
false,
result);
172 return std::pair<bool,LArBadChannel>(
true,
result);
175std::pair<bool,LArBadFeb>
177 MsgStream& log)
const
180 for(std::vector<std::string>::const_iterator it =
vec.begin(); it !=
vec.end(); ++it) {
183 log << MSG::WARNING <<
"LArBadChannelDecoder REJECTED line with "
184 <<
":\t unrecognized problem status: " << *it <<
endmsg;
185 return std::pair<bool,LArBadFeb>(
false,
result);
188 return std::pair<bool,LArBadFeb>(
true,
result);
197 <<
" slot " << intVec[
slot];
198 if (intVec.size() >= 5) log <<
" ch " << intVec[
channel];
std::vector< size_t > vec
bool is_valid() const
Check if id is in a valid state.
LArBadFebBitPacking m_febPacking
LArBadChanBitPacking m_packing
HWIdentifier constructSingleFebId(const std::vector< int > &v, MsgStream &log) const
std::vector< BadFebEntry > readFebASCII(const std::string &fname, MsgStream &log) const
std::pair< bool, LArBadFeb > constructFebStatus(const std::vector< std::string > &vec, MsgStream &log) const
std::vector< BadChanEntry > readASCII(const std::string &name, State::CoolChannelEnum coolChan, MsgStream &log) const
LArBadChanSCBitPacking m_SCpacking
HWIdentifier constructChannelId(const std::vector< int > &intVec, State::CoolChannelEnum coolChan, MsgStream &log) const
std::pair< bool, LArBadChannel > constructStatus(const std::vector< std::string > &vec, MsgStream &log) const
const LArOnlineID_Base * m_onlineID
static MsgStream & insertExpandedID(const std::vector< int > &intVec, MsgStream &log)
std::vector< HWIdentifier > constructFebId(const std::vector< int > &intVec, MsgStream &log) const
bool checkId(const HWIdentifier &, int be, int pn, State::CoolChannelEnum) const
static CaloPartEnum caloPart(CoolChannelEnum chan)
static std::string coolChannelName(CoolChannelEnum chan)
static int barrelEndcap(CoolChannelEnum chan)
static int posNeg(CoolChannelEnum chan)
Exception class for LAr online Identifiers.