41 std::string InputFileSignalPDF,
42 std::string InputFileNoise)
45 stream.open(InputFileName.c_str());
47 B2ERROR(
"openFile: " << InputFileName <<
" *** failed to open");
50 std::ifstream stream1;
51 stream1.open(InputFileSignalPDF.c_str());
53 B2ERROR(
"openFile: " << InputFileSignalPDF <<
" *** failed to open");
57 std::ifstream stream2;
58 stream2.open(InputFileNoise.c_str());
60 B2ERROR(
"openFile: " << InputFileNoise <<
" *** failed to open");
69 std::vector<int> FPGAversion;
70 std::vector<int> TCId;
71 std::vector<int> FAMId;
72 std::vector<int> ChannelId;
73 std::vector<int> TEreconstruction;
74 std::vector<int> Threshold;
75 std::vector<double> Conversionfactor;
76 std::vector<int> Toffset;
77 std::vector<int> Wavemean;
78 std::vector<int> Wavesigma;
83 TEreconstruction.clear();
85 Conversionfactor.clear();
90 FPGAversion.resize(624, 0);
93 ChannelId.resize(624, 0);
94 TEreconstruction.resize(624, 0);
95 Threshold.resize(624, 0);
96 Conversionfactor.resize(624, 0);
97 Toffset.resize(624, 0);
99 Wavemean.resize(624, 0);
100 Wavesigma.resize(624, 0);
103 std::vector<std::vector<double> >
SignalPDF;
105 std::vector<std::vector<double> > NoiseCovarianceMatrix;
106 NoiseCovarianceMatrix.clear();
107 SignalPDF.resize(624, std::vector<double>(8, 0));
108 NoiseCovarianceMatrix.resize(624, std::vector<double>(78, 0));
111 while (!stream.eof()) {
112 stream >> FAMId[Id] >> ChannelId[Id] >> FPGAversion [Id]
113 >> TEreconstruction[Id] >> Threshold[Id] >> Conversionfactor[Id]
114 >> Toffset[Id] >> Wavemean[Id] >> Wavesigma[Id];
122 while (!stream1.eof()) {
135 while (!stream2.eof()) {
136 stream2 >> NoiseCovarianceMatrix[Id][line];
148 for (
int iTCId = 0; iTCId < 624; iTCId++) {
153 TEreconstruction[iTCId],
154 Conversionfactor[iTCId],
160 NoiseCovarianceMatrix[iTCId]
169 B2RESULT(
"FAM parameters are imported to database.");
204 std::ifstream stream;
205 stream.open(InputFileName.c_str());
207 B2ERROR(
"openFile: " << InputFileName <<
" *** failed to open");
212 std::vector<string> v_par_name;
213 std::vector<double> v_par_value;
216 while (getline(stream, str_line)) {
217 if (str_line.find(
"#")) {
218 std::stringstream sss;
223 if (sscanf(sss.str().data(),
225 &tmp_id, tmp_name, &tmp_value) == 3) {
226 string str_tmp_name = string(tmp_name);
227 v_par_name.push_back(str_tmp_name);
228 v_par_value.push_back(tmp_value);
235 B2INFO(
"[TrgEclDatabaseImporter] The number of parameters in "
243 etmpara->setnpar(cnt_par);
245 for (
int iii = 0; iii < cnt_par; iii++) {
246 etmpara->setparMap(v_par_name[iii], v_par_value[iii]);
254 B2RESULT(
"ETM Parameters are imported to database.");