13 std::string bareOwner, extraLabel;
16 if (extraLabel==
"") extraLabel=
"None";
21 std::stringstream squery;
24 squery<<
"select energy_range_min from data_sets_analyses where calib_algo = '"<<bareOwner
25 <<
"' and calib_version= '"<<GetCalibVersion()
26 <<
"' and calib_extralabel= '"<<extraLabel
27 <<
"' and channel= "<< GetChannel()
28 <<
" and data_set= "<<GetDataset();
34 catch(
const QError& cerr) {
44 squery<<
"select energy_range_max from data_sets_analyses where calib_algo = '"<<bareOwner
45 <<
"' and calib_version= '"<<GetCalibVersion()
46 <<
"' and calib_extralabel= '"<<extraLabel
47 <<
"' and channel= "<< GetChannel()
48 <<
" and data_set= "<<GetDataset();
54 catch(
const QError& cerr) {
73 std::string calib_algo, calib_version, calib_extralabel;
74 calib_version = GetCalibVersion();
77 if (calib_extralabel==
"") calib_extralabel=
"None";
79 std::stringstream squery;
82 squery<<
"SELECT energy_range_min from data_sets_analyses "
83 <<
" where channel = "<< GetChannel()
84 <<
" and data_set = "<< GetDataset()
85 <<
" and calib_algo = '"<< calib_algo
86 <<
"' and calib_version = '"<< calib_version
87 <<
"' and calib_extralabel= '"<< calib_extralabel<<
"'";
94 catch(
const QError& cerr) {
99 squery<<
"UPDATE data_sets_analyses set "
100 <<
" energy_range_min = "<<epar.
GetMin()
101 <<
", energy_range_max = "<<epar.
GetMax()
103 << GetDataset()<<
" and channel="
104 << GetChannel()<<
" and calib_algo='"
105 << calib_algo<<
"' and calib_version='"
106 << calib_version<<
"' and calib_extralabel ='"
107 << calib_extralabel<<
"'";
116 catch(
const QError& cerror) {
133 fields.push_back((std::string)
"data_set"); values.push_back(GetDataset());
134 fields.push_back((std::string)
"calib_algo"); values.push_back(
"'"+calib_algo+
"'");
135 fields.push_back((std::string)
"calib_version"); values.push_back(
"'"+calib_version+
"'");
136 fields.push_back((std::string)
"calib_extralabel"); values.push_back(
"'"+calib_extralabel+
"'");
137 fields.push_back((std::string)
"channel"); values.push_back(GetChannel());
138 fields.push_back((std::string)
"energy_range_min"); values.push_back(epar.
GetMin());
139 fields.push_back((std::string)
"energy_range_max"); values.push_back(epar.
GetMax());
143 db->
Insert(
"data_sets_analyses",fields,values);
146 catch(
const QError& cerror) {
dm Get("DAQ",&rHandle,"DB")
double DoQueryDouble(const std::string &query)
int DoExec(const std::string &Query)
Execute an INSERT, UPDATE, DELETE, FETCH, or MOVE statement.
int Insert(const std::string &tableName, const column &fields, const column &values)
error class with error type and description
Label for global QObject's.
void GetBareOwnerAndExtraLabel(std::string &bOwner, std::string &el) const
split extra label and bare module name
Interval of real numbers.
void SetMin(const double min)
Set minimum of the interval.
void SetMax(const double max)
Set maximum of the interval.
double GetMax() const
Get maximum of interval.
double GetMin() const
Get minimum of interval.
std::vector< QVdt > QVdt_vector
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...