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);
53 std::string
fileName =
p.get<std::string>(
"FileName",
"");
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);
83 art::ServiceHandle<geo::Geometry const> geo;
85 for ( ; itW != geo->end_wire_id(); ++itW) {
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!");
100 cet::search_path sp(
"FW_SEARCH_PATH");
101 std::string abs_fp = sp.find_file(
fileName);
102 std::cout <<
"Using pedestals from local file: "<<abs_fp<<
"\n";
103 std::ifstream
file(abs_fp);
105 throw cet::exception(
"DetPedestalRetrievalAlg")
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.
Base forward iterator browsing all wire IDs in the detector.
std::uint32_t DBChannelID_t
Signal from induction planes.
DataSource::ds fDataSource
Snapshot< DetPedestal > fData
services TFileService fileName
static IOVTimeStamp MaxTimeStamp()
BEGIN_PROLOG could also be cout
Signal from collection planes.