LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "DatabaseUtil.h"
Public Member Functions | |
DatabaseUtil (fhicl::ParameterSet const &pset) | |
void | reconfigure (fhicl::ParameterSet const &pset) |
int | GetLifetimeFromDB (int run, double &lftime_real) |
int | GetTriggerOffsetFromDB (int run, double &T0_real) |
int | GetTemperatureFromDB (int run, double &temp_real) |
int | GetEfieldValuesFromDB (int run, std::vector< double > &efield) |
int | GetPOTFromDB (int run, long double &POT) |
UBChannelMap_t | GetUBChannelMap (int data_taking_timestamp=-1, int swizzling_timestamp=-1) |
UBChannelReverseMap_t | GetUBChannelReverseMap (int data_taking_timestamp=-1, int swizzling_timestamp=-1) |
int | SelectFieldByName (std::vector< std::string > &value, const char *field, const char *condition, const char *table) |
std::vector< std::string > & | split (const std::string &s, char delim, std::vector< std::string > &elems) |
bool | ToughErrorTreatment () const |
bool | ShouldConnect () const |
Private Member Functions | |
int | SelectSingleFieldByQuery (std::vector< std::string > &value, const char *query) |
int | Connect (int conn_wait=0) |
int | DisConnect () |
void | LoadUBChannelMap (int data_taking_timestamp=-1, int swizzling_timestamp=-1) |
Private Attributes | |
char | connection_str [200] |
PGconn * | conn |
std::string | fDBHostName |
std::string | fDBName |
std::string | fDBUser |
std::string | fTableName |
int | fPort |
std::string | fPassword |
bool | fToughErrorTreatment |
bool | fShouldConnect |
UBChannelMap_t | fChannelMap |
UBChannelReverseMap_t | fChannelReverseMap |
Definition at line 49 of file DatabaseUtil.h.
util::DatabaseUtil::DatabaseUtil | ( | fhicl::ParameterSet const & | pset | ) |
Definition at line 19 of file DatabaseUtil.cc.
References conn, fChannelMap, fChannelReverseMap, and reconfigure().
|
private |
Definition at line 28 of file DatabaseUtil.cc.
References conn, connection_str, fShouldConnect, fToughErrorTreatment, and MF_LOG_DEBUG.
Referenced by LoadUBChannelMap(), and SelectSingleFieldByQuery().
|
private |
Definition at line 54 of file DatabaseUtil.cc.
References conn, fShouldConnect, and MF_LOG_DEBUG.
Referenced by LoadUBChannelMap(), and SelectSingleFieldByQuery().
int util::DatabaseUtil::GetEfieldValuesFromDB | ( | int | run, |
std::vector< double > & | efield | ||
) |
Definition at line 180 of file DatabaseUtil.cc.
References fTableName, and SelectSingleFieldByQuery().
int util::DatabaseUtil::GetLifetimeFromDB | ( | int | run, |
double & | lftime_real | ||
) |
Definition at line 217 of file DatabaseUtil.cc.
References fTableName, and SelectFieldByName().
int util::DatabaseUtil::GetPOTFromDB | ( | int | run, |
long double & | POT | ||
) |
Definition at line 257 of file DatabaseUtil.cc.
References fTableName, and SelectFieldByName().
int util::DatabaseUtil::GetTemperatureFromDB | ( | int | run, |
double & | temp_real | ||
) |
Definition at line 164 of file DatabaseUtil.cc.
References fTableName, and SelectFieldByName().
int util::DatabaseUtil::GetTriggerOffsetFromDB | ( | int | run, |
double & | T0_real | ||
) |
Definition at line 237 of file DatabaseUtil.cc.
References fTableName, and SelectFieldByName().
UBChannelMap_t util::DatabaseUtil::GetUBChannelMap | ( | int | data_taking_timestamp = -1 , |
int | swizzling_timestamp = -1 |
||
) |
Definition at line 361 of file DatabaseUtil.cc.
References fChannelMap, and LoadUBChannelMap().
UBChannelReverseMap_t util::DatabaseUtil::GetUBChannelReverseMap | ( | int | data_taking_timestamp = -1 , |
int | swizzling_timestamp = -1 |
||
) |
Definition at line 367 of file DatabaseUtil.cc.
References fChannelReverseMap, and LoadUBChannelMap().
|
private |
Definition at line 279 of file DatabaseUtil.cc.
References util::UBDaqID::card, util::UBDaqID::channel, conn, Connect(), util::UBDaqID::crate, DisConnect(), fChannelMap, fChannelReverseMap, art::errors::FileReadError, and split().
Referenced by GetUBChannelMap(), and GetUBChannelReverseMap().
void util::DatabaseUtil::reconfigure | ( | fhicl::ParameterSet const & | pset | ) |
Definition at line 64 of file DatabaseUtil.cc.
References connection_str, fDBHostName, fDBName, fDBUser, fPassword, fPort, fShouldConnect, fTableName, fToughErrorTreatment, fhicl::ParameterSet::get(), in, and art::errors::NotFound.
Referenced by DatabaseUtil().
int util::DatabaseUtil::SelectFieldByName | ( | std::vector< std::string > & | value, |
const char * | field, | ||
const char * | condition, | ||
const char * | table | ||
) |
Definition at line 205 of file DatabaseUtil.cc.
References SelectSingleFieldByQuery().
Referenced by GetLifetimeFromDB(), GetPOTFromDB(), GetTemperatureFromDB(), and GetTriggerOffsetFromDB().
|
private |
Definition at line 107 of file DatabaseUtil.cc.
References conn, Connect(), DisConnect(), fShouldConnect, and MF_LOG_DEBUG.
Referenced by GetEfieldValuesFromDB(), and SelectFieldByName().
|
inline |
Definition at line 73 of file DatabaseUtil.h.
std::vector< std::string > & util::DatabaseUtil::split | ( | const std::string & | s, |
char | delim, | ||
std::vector< std::string > & | elems | ||
) |
Definition at line 376 of file DatabaseUtil.cc.
Referenced by LoadUBChannelMap().
|
inline |
Definition at line 72 of file DatabaseUtil.h.
|
private |
Definition at line 81 of file DatabaseUtil.h.
Referenced by Connect(), DatabaseUtil(), DisConnect(), LoadUBChannelMap(), and SelectSingleFieldByQuery().
|
private |
Definition at line 79 of file DatabaseUtil.h.
Referenced by Connect(), and reconfigure().
|
private |
Definition at line 91 of file DatabaseUtil.h.
Referenced by DatabaseUtil(), GetUBChannelMap(), and LoadUBChannelMap().
|
private |
Definition at line 92 of file DatabaseUtil.h.
Referenced by DatabaseUtil(), GetUBChannelReverseMap(), and LoadUBChannelMap().
|
private |
Definition at line 82 of file DatabaseUtil.h.
Referenced by reconfigure().
|
private |
Definition at line 83 of file DatabaseUtil.h.
Referenced by reconfigure().
|
private |
Definition at line 84 of file DatabaseUtil.h.
Referenced by reconfigure().
|
private |
Definition at line 87 of file DatabaseUtil.h.
Referenced by reconfigure().
|
private |
Definition at line 86 of file DatabaseUtil.h.
Referenced by reconfigure().
|
private |
Definition at line 89 of file DatabaseUtil.h.
Referenced by Connect(), DisConnect(), reconfigure(), and SelectSingleFieldByQuery().
|
private |
Definition at line 85 of file DatabaseUtil.h.
Referenced by GetEfieldValuesFromDB(), GetLifetimeFromDB(), GetPOTFromDB(), GetTemperatureFromDB(), GetTriggerOffsetFromDB(), and reconfigure().
|
private |
Definition at line 88 of file DatabaseUtil.h.
Referenced by Connect(), and reconfigure().