12 string hd_msg =
" > MYSQL Parameters: >> ";
15 map<string, double> GParameters;
22 QSqlDatabase db = QSqlDatabase::database(
"gemc");
31 string dname = it->first ;
32 string tname = dname +
"__parameters";
36 int run = it->second.get_run_number();
39 cout << hd_msg <<
" Importing Parameters for Detector: " << dname
40 <<
" with " <<
factoryType <<
" factory, variation " << variation << endl;
42 string dbexecute =
"select name, value, units, description from " + tname;
43 dbexecute +=
" where variation ='" + variation +
"'";
45 dbexecute +=
" order by id desc limit 1 " ;
49 if(!q.exec(dbexecute.c_str()))
51 cout << hd_msg <<
" Errror! Failed to execute MYSQL query " << dbexecute << endl;
57 cout <<
" ** WARNING: detector \"" << dname <<
"\" not found with variation \"" << variation <<
"\" for run number " << run << endl << endl;
78 QSqlDatabase::removeDatabase(
"QMYSQL");
int check_if_factory_is_needed(map< string, detectorCondition > dcon, string factory)
double get_par_value(gtable gt)
QSqlDatabase openGdb(goptions gemcOpt)
string get_variation(string var)
parse variation name from string
string qv_tostring(QVariant input)
void add_data(QVariant input)
map< string, detectorCondition > detectorConditionsMap
map< string, double > loadParameters(goptions, runConditions)
string stringify(double x)
map< string, aopt > optMap
Options map.
bool is_main_variation(string var)
returns 1 if the string "main:" is found on the input
string TrimSpaces(string in)
Removes leading and trailing spaces.
void log_value(gtable gt, string factory)