Reconfigure function called by fhicl constructor.
26 tmp.SetStamp(tmp.Stamp()-1, tmp.SubStamp());
29 bool UseDB =
p.get<
bool>(
"UseDB",
false);
30 bool UseFile =
p.get<
bool>(
"UseFile",
false);
40 float default_gain =
p.get<
float>(
"DefaultGain");
41 float default_gain_err =
p.get<
float>(
"DefaultGainErr");
42 float default_st =
p.get<
float>(
"DefaultShapingTime");
43 float default_st_err =
p.get<
float>(
"DefaultShapingTimeErr");
45 ElectronicsCalib defaultCalib(0);
47 defaultCalib.SetGain(default_gain);
48 defaultCalib.SetGainErr(default_gain_err);
49 defaultCalib.SetShapingTime(default_st);
50 defaultCalib.SetShapingTimeErr(default_st_err);
51 defaultCalib.SetExtraInfo(CalibrationExtraInfo(
"ElectronicsCalib"));
57 defaultCalib.SetChannel(ch);
58 fData.AddOrReplaceRow(defaultCalib);
65 std::cout <<
"Using electronics calibrations from local file: "<<abs_fp<<
"\n";
66 std::ifstream
file(abs_fp);
69 <<
"File "<<abs_fp<<
" is not found.";
73 ElectronicsCalib dp(0);
74 while (std::getline(
file, line)) {
75 size_t current_comma = line.find(
',');
77 float gain = std::stof( line.substr(current_comma+1, line.find(
',',current_comma+1)-(current_comma+1)) );
79 current_comma = line.find(
',',current_comma+1);
80 float gain_err = std::stof( line.substr(current_comma+1, line.find(
',',current_comma+1)-(current_comma+1)) );
82 current_comma = line.find(
',',current_comma+1);
83 float shaping_time = std::stof( line.substr(current_comma+1, line.find(
',',current_comma+1)-(current_comma+1)) );
85 current_comma = line.find(
',',current_comma+1);
86 float shaping_time_err = std::stof( line.substr(current_comma+1) );
88 CalibrationExtraInfo
info(
"ElectronicsCalib");
92 dp.SetGainErr(gain_err);
93 dp.SetShapingTime(shaping_time);
94 dp.SetShapingTimeErr(shaping_time_err);
95 dp.SetExtraInfo(
info);
97 fData.AddOrReplaceRow(dp);
101 std::cout <<
"Using electronics calibrations from conditions database"<<
std::endl;
virtual void Reconfigure(fhicl::ParameterSet const &p)
Configure using fhicl::ParameterSet.
Base forward iterator browsing all wire IDs in the detector.
std::uint32_t DBChannelID_t
DataSource::ds fDataSource
wire_id_iterator end_wire_id() const
Returns an iterator pointing after the last wire ID in the detector.
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
void line(double t, double *p, double &x, double &y, double &z)
wire_id_iterator begin_wire_id() const
Returns an iterator pointing to the first wire ID in the detector.
static IOVTimeStamp MaxTimeStamp()
Snapshot< ElectronicsCalib > fData
LArSoft geometry interface.
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)