14 : m_nominal_gain(nominal_gain)
15 , m_nominal_shaping(nominal_shaping)
16 , m_deviants(deviants)
20 Gen::StaticChannelStatus::~StaticChannelStatus()
28 cfg[
"nominal_gain"] = m_nominal_gain;
29 cfg[
"nominal_shaping"] = m_nominal_shaping;
30 cfg[
"deviants"] = Json::arrayValue;
31 for (
auto it : m_deviants) {
33 jdev[
"chid"] = it.first;
34 jdev[
"gain"] = it.second.gain;
35 jdev[
"shaping"] = it.second.shaping;
36 cfg[
"deviants"].append(jdev);
45 m_nominal_gain =
get(
cfg,
"nominal_gain", m_nominal_gain);
46 m_nominal_shaping =
get(
cfg,
"nominal_shaping", m_nominal_shaping);
48 auto jdev = cfg[
"deviants"];
52 for (
auto jone : jdev) {
53 const int chid = jone[
"chid"].asInt();
54 const double gain =
get(jone,
"gain", m_nominal_gain);
55 const double shaping =
get(jone,
"shaping", m_nominal_shaping);
62 double Gen::StaticChannelStatus::preamp_gain(
int chid)
const 64 auto it = m_deviants.find(chid);
65 if (it == m_deviants.end()) {
66 return m_nominal_gain;
68 return it->second.gain;
70 double Gen::StaticChannelStatus::preamp_shaping(
int chid)
const 72 auto it = m_deviants.find(chid);
73 if (it == m_deviants.end()) {
74 return m_nominal_shaping;
76 return it->second.shaping;
WIRECELL_FACTORY(StaticChannelStatus, WireCell::Gen::StaticChannelStatus, WireCell::IChannelStatus, WireCell::IConfigurable) using namespace WireCell
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
std::unordered_map< int, ChannelStatus > channel_status_map_t
const double nominal_shaping
Json::Value Configuration
const double nominal_gain