10#include <trg/ecl/dbobjects/TrgEclDatabaseImporter.h>
13#include <framework/database/DBObjPtr.h>
14#include <framework/database/IntervalOfValidity.h>
15#include <framework/database/DBImportArray.h>
18#include <framework/logging/Logger.h>
21#include "trg/ecl/dbobjects/TRGECLFAMPara.h"
22#include "trg/ecl/dbobjects/TRGECLTMMPara.h"
23#include "trg/ecl/dbobjects/TRGECLETMPara.h"
24#include "trg/ecl/dbobjects/TRGECLBadRun.h"
26#include "trg/ecl/TrgEclMapping.h"
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");
70 std::vector<int> FPGAversion;
71 std::vector<int> TCId;
72 std::vector<int> FAMId;
73 std::vector<int> ChannelId;
74 std::vector<int> TEreconstruction;
75 std::vector<int> Threshold;
76 std::vector<double> Conversionfactor;
77 std::vector<int> Toffset;
78 std::vector<int> Wavemean;
79 std::vector<int> Wavesigma;
84 TEreconstruction.clear();
86 Conversionfactor.clear();
91 FPGAversion.resize(624, 0);
94 ChannelId.resize(624, 0);
95 TEreconstruction.resize(624, 0);
96 Threshold.resize(624, 0);
97 Conversionfactor.resize(624, 0);
98 Toffset.resize(624, 0);
100 Wavemean.resize(624, 0);
101 Wavesigma.resize(624, 0);
104 std::vector<std::vector<double> >
SignalPDF;
106 std::vector<std::vector<double> > NoiseCovarianceMatrix;
107 NoiseCovarianceMatrix.clear();
108 SignalPDF.resize(624, std::vector<double>(8, 0));
109 NoiseCovarianceMatrix.resize(624, std::vector<double>(78, 0));
112 while (!stream.eof()) {
113 stream >> FAMId[Id] >> ChannelId[Id] >> FPGAversion [Id] >> TEreconstruction[Id] >> Threshold[Id] >> Conversionfactor[Id] >>
114 Toffset[Id] >> Wavemean[Id] >> Wavesigma[Id];
115 TCId[Id] = _map -> getTCIdFromFAMChannel(FAMId[Id], ChannelId[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.");
176 std::ifstream stream;
177 stream.open(InputFileName.c_str());
179 B2ERROR(
"openFile: " << InputFileName <<
" *** failed to open");
186 stream >> FPGAversion ;
194 B2RESULT(
"TMM parameters are imported to database.");
201 std::ifstream stream;
202 stream.open(InputFileName.c_str());
204 B2ERROR(
"openFile: " << InputFileName <<
" *** failed to open");
217 int Bhabha3DSelectionThreshold[2];
218 int Bhabha3DVetoThreshold[2];
219 int Bhabha3DSelectionAngle[4];
220 int Bhabha3DVetoAngle[4];
223 int LowMultiThreshold[4];
224 int Prescalefactor[3];
228 int ECLBurstThreshold;
230 stream >> FPGAversion
235 >> FWD2DBhabha[0] >> BWD2DBhabha[0]
236 >> FWD2DBhabha[1] >> BWD2DBhabha[1]
237 >> FWD2DBhabha[2] >> BWD2DBhabha[2]
238 >> FWD2DBhabha[3] >> BWD2DBhabha[3]
239 >> FWD2DBhabha[4] >> BWD2DBhabha[4]
240 >> FWD2DBhabha[5] >> BWD2DBhabha[5]
241 >> FWD2DBhabha[6] >> BWD2DBhabha[6]
242 >> FWD2DBhabha[7] >> BWD2DBhabha[7]
243 >> FWD2DBhabha[8] >> BWD2DBhabha[8]
244 >> FWD2DBhabha[9] >> BWD2DBhabha[9]
245 >> FWD2DBhabha[10] >> BWD2DBhabha[10]
246 >> FWD2DBhabha[11] >> BWD2DBhabha[11]
247 >> FWD2DBhabha[12] >> BWD2DBhabha[12]
248 >> FWD2DBhabha[13] >> BWD2DBhabha[13]
249 >> Bhabha3DSelectionThreshold[0]
250 >> Bhabha3DSelectionThreshold[1]
251 >> Bhabha3DVetoThreshold[0]
252 >> Bhabha3DVetoThreshold[1]
253 >> Bhabha3DSelectionAngle[0]
254 >> Bhabha3DSelectionAngle[1]
255 >> Bhabha3DSelectionAngle[2]
256 >> Bhabha3DSelectionAngle[3]
257 >> Bhabha3DVetoAngle[0]
258 >> Bhabha3DVetoAngle[1]
259 >> Bhabha3DVetoAngle[2]
260 >> Bhabha3DVetoAngle[3]
266 >> LowMultiThreshold[0]
267 >> LowMultiThreshold[1]
268 >> LowMultiThreshold[2]
269 >> LowMultiThreshold[3]
276 >> ECLBurstThreshold;
279 etmpara.
appendNew(FPGAversion, ADCto100MeV, ELow, EHigh, ELum, FWD2DBhabha, BWD2DBhabha, Bhabha3DSelectionThreshold,
280 Bhabha3DVetoThreshold, Bhabha3DSelectionAngle, Bhabha3DVetoAngle, mumuThreshold, mumuAngle, LowMultiThreshold,
281 Prescalefactor, TriggerLatency, ETMDelay, n300MeVCluster, ECLBurstThreshold);
289 B2RESULT(
"ETM Parameters are imported to database.");
295 std::ifstream stream;
296 stream.open(InputFileName.c_str());
298 B2ERROR(
"openFile: " << InputFileName <<
" *** failed to open");
305 while (!stream.eof()) {
307 stream >> BadRunNumber ;
316 B2RESULT(
"BadRunList are imported to database.");
Class for importing array of objects to the database.
T * appendNew()
Construct a new T object at the end of the array.
void clear() override
Clear the content, e.g.
bool import(const IntervalOfValidity &iov)
Import the object to database.
Class for accessing objects in the database.
A class that describes the interval of experiments/runs for which an object in the database is valid.
Parametrization of signal PDF in a single pixel.
int startExp
Start Experiment Number.
int endExp
End Experiment Number.
int endRun
End Run Number.
int startRun
Start Run Number.
void importETMParameter(std::string)
Import ETM Parameters.
void importTMMParameter(std::string)
Import TMM Parameters.
void importFAMParameter(std::string, std::string, std::string)
Import FAM Parameters.
void printTCThreshold()
Print TC energy Threshold.
TrgEclDatabaseImporter()
TrgEclDatabaseImporter Constructor.
void importBadRunNumber(std::string)
Import Bad Run Number.
Abstract base class for different kinds of events.