30 , fCurrentTimeStamp(0)
34 bool UseDB = pset.
get<
bool>(
"UseDB",
false);
35 bool UseFile = pset.
get<
bool>(
"UseFile",
false);
45 std::cout <<
"Using default channel status value: "<<
kGOOD<<
"\n";
51 std::cout <<
"Using channel statuses from local file: "<<abs_fp<<
"\n";
52 std::ifstream
file(abs_fp);
55 <<
"File "<<abs_fp<<
" is not found.";
60 while (std::getline(file, line)) {
62 int status = std::stoi(line.substr(line.find(
',')+1));
66 fData.AddOrReplaceRow(cs);
70 std::cout <<
"Using channel statuses from conditions database\n";
77 mf::LogInfo(
"SIOVChannelStatusProvider") <<
"SIOVChannelStatusProvider::UpdateTimeStamp called.";
105 mf::LogInfo(
"SIOVChannelStatusProvider") <<
"SIOVChannelStatusProvider::DBUpdate called with new timestamp.";
117 std::vector<DBChannelID_t>
channels;
118 fFolder->GetChannelList(channels);
119 for (
auto it = channels.begin(); it != channels.end(); ++it) {
122 fFolder->GetNamedChannelData(*it,
"status", status);
127 fData.AddOrReplaceRow(cs);
159 std::vector<DBChannelID_t> chs;
163 retSet.insert(chs.begin(), chs.end());
167 std::vector<DBChannelID_t> chs;
172 retSet.insert(chs.begin(), chs.end());
190 dead.insert(ln.begin(),ln.end());
std::unique_ptr< DBFolder > fFolder
bool IsPresent(raw::ChannelID_t channel) const override
Returns whether the specified channel is physical and connected to wire.
std::set< raw::ChannelID_t > ChannelSet_t
Type of set of channel IDs.
DataSource::ds fDataSource
static DBChannelID_t rawToDBChannel(raw::ChannelID_t channel)
Converts LArSoft channel ID in the one proper for the DB.
DBTimeStamp_t fEventTimeStamp
ChannelSet_t GoodChannels() const override
Returns a copy of set of good channel IDs for the current run.
ChannelSet_t BadChannels() const override
Returns a copy of set of bad channel IDs for the current run.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::uint32_t DBChannelID_t
std::uint64_t DBTimeStamp_t
void UpdateTimeStamp(DBTimeStamp_t ts)
Update event time stamp.
art framework interface to geometry description
Class providing information about the quality of channels.
static chStatus GetStatusFromInt(int status)
Snapshot< ChannelStatus > fData
bool UpdateFolder(DBTimeStamp_t ts)
Return true if fFolder is successfully updated.
bool IsBad(raw::ChannelID_t channel) const override
Returns whether the specified channel is bad in the current run.
DBTimeStamp_t fCurrentTimeStamp
T get(std::string const &key) const
void SetChannel(unsigned int ch)
const IOVTimeStamp & End() const
Filters for channels, events, etc.
ChannelSet_t GetChannelsWithStatus(chStatus status) const
void line(double t, double *p, double &x, double &y, double &z)
const ChannelStatus & GetChannelStatus(raw::ChannelID_t channel) const
Returns Channel Status.
std::string find_file(std::string const &filename) const
Snapshot< ChannelStatus > fNewNoisy
Channel quality provider with information from configuration file.
const IOVTimeStamp & Begin() const
Get Timestamp information.
static TemplateFilterFactory::AutoRegister< FilterDefault > fDefault("default")
bool Update(DBTimeStamp_t)
bool DBUpdate() const
Do actual database updates.
SIOVChannelStatusProvider(fhicl::ParameterSet const &pset)
Constructor.
void AddNoisyChannel(raw::ChannelID_t ch)
Allows a service to add to the list of noisy channels.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
auto const & get(AssnsNode< L, R, D > const &r)
ChannelSet_t NoisyChannels() const override
Returns a copy of set of noisy channel IDs for the current run.
cet::coded_exception< error, detail::translate > exception
void SetStatus(chStatus status)