Reconfigure function called by fhicl constructor.
48 tmp.SetStamp(tmp.Stamp()-1, tmp.SubStamp());
51 bool UseDB =
p.get<
bool>(
"UseDB",
false);
52 bool UseFile =
p.get<
bool>(
"UseFile",
false);
62 std::cout <<
"Using default pedestal values\n";
63 float default_collmean =
p.get<
float>(
"DefaultCollMean", 400.0);
64 float default_collrms =
p.get<
float>(
"DefaultCollRms", 0.3);
65 float default_mean_err =
p.get<
float>(
"DefaultMeanErr", 0.0);
66 float default_rms_err =
p.get<
float>(
"DefaultRmsErr", 0.0);
67 float default_indmean =
p.get<
float>(
"DefaultIndMean", 2048.0);
68 float default_indrms =
p.get<
float>(
"DefaultIndRms", 0.3);
70 DetPedestal DefaultColl(0);
71 DetPedestal DefaultInd(0);
73 DefaultColl.SetPedMean(default_collmean);
74 DefaultColl.SetPedMeanErr(default_mean_err);
75 DefaultColl.SetPedRms(default_collrms);
76 DefaultColl.SetPedRmsErr(default_rms_err);
78 DefaultInd.SetPedMean(default_indmean);
79 DefaultInd.SetPedMeanErr(default_mean_err);
80 DefaultInd.SetPedRms(default_indrms);
81 DefaultInd.SetPedRmsErr(default_rms_err);
89 DefaultColl.SetChannel(ch);
90 fData.AddOrReplaceRow(DefaultColl);
93 DefaultInd.SetChannel(ch);
94 fData.AddOrReplaceRow(DefaultInd);
96 else throw IOVDataError(
"Wire type is not collection or induction!");
102 std::cout <<
"Using pedestals from local file: "<<abs_fp<<
"\n";
103 std::ifstream
file(abs_fp);
106 <<
"File "<<abs_fp<<
" is not found.";
111 while (std::getline(
file, line)) {
112 size_t current_comma = line.find(
',');
114 float ped = std::stof( line.substr(current_comma+1, line.find(
',',current_comma+1)-(current_comma+1)) );
116 current_comma = line.find(
',',current_comma+1);
117 float rms = std::stof( line.substr(current_comma+1, line.find(
',',current_comma+1)-(current_comma+1)) );
119 current_comma = line.find(
',',current_comma+1);
120 float ped_err = std::stof( line.substr(current_comma+1, line.find(
',',current_comma+1)-(current_comma+1)) );
122 current_comma = line.find(
',',current_comma+1);
123 float rms_err = std::stof( line.substr(current_comma+1) );
127 dp.SetPedMeanErr(ped_err);
129 dp.SetPedRmsErr(rms_err);
130 fData.AddOrReplaceRow(dp);
134 std::cout <<
"Using pedestals from conditions database\n";
virtual void Reconfigure(fhicl::ParameterSet const &p)
Configure using fhicl::ParameterSet.
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Base forward iterator browsing all wire IDs in the detector.
std::uint32_t DBChannelID_t
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
Signal from induction planes.
DataSource::ds fDataSource
Snapshot< DetPedestal > fData
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()
LArSoft geometry interface.
cet::coded_exception< error, detail::translate > exception
Signal from collection planes.