LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "DatabaseUtil.h"
Public Member Functions | |
DatabaseUtil (fhicl::ParameterSet const &pset, art::ActivityRegistry ®) | |
~DatabaseUtil () | |
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 52 of file DatabaseUtil.h.
util::DatabaseUtil::DatabaseUtil | ( | fhicl::ParameterSet const & | pset, |
art::ActivityRegistry & | reg | ||
) |
Definition at line 19 of file DatabaseUtil_service.cc.
References conn, fChannelMap, fChannelReverseMap, and reconfigure().
util::DatabaseUtil::~DatabaseUtil | ( | ) |
Definition at line 28 of file DatabaseUtil_service.cc.
|
private |
Definition at line 34 of file DatabaseUtil_service.cc.
References conn, connection_str, fShouldConnect, fToughErrorTreatment, and LOG_DEBUG.
Referenced by LoadUBChannelMap(), and SelectSingleFieldByQuery().
|
private |
Definition at line 63 of file DatabaseUtil_service.cc.
References conn, fShouldConnect, and LOG_DEBUG.
Referenced by LoadUBChannelMap(), and SelectSingleFieldByQuery().
int util::DatabaseUtil::GetEfieldValuesFromDB | ( | int | run, |
std::vector< double > & | efield | ||
) |
Definition at line 197 of file DatabaseUtil_service.cc.
References fTableName, and SelectSingleFieldByQuery().
Referenced by util::LArPropertiesServiceArgoNeuT::preBeginRun().
int util::DatabaseUtil::GetLifetimeFromDB | ( | int | run, |
double & | lftime_real | ||
) |
Definition at line 240 of file DatabaseUtil_service.cc.
References fTableName, and SelectFieldByName().
Referenced by util::LArPropertiesServiceArgoNeuT::preBeginRun().
int util::DatabaseUtil::GetPOTFromDB | ( | int | run, |
long double & | POT | ||
) |
Definition at line 283 of file DatabaseUtil_service.cc.
References fTableName, and SelectFieldByName().
int util::DatabaseUtil::GetTemperatureFromDB | ( | int | run, |
double & | temp_real | ||
) |
Definition at line 176 of file DatabaseUtil_service.cc.
References fTableName, and SelectFieldByName().
Referenced by util::LArPropertiesServiceArgoNeuT::preBeginRun().
int util::DatabaseUtil::GetTriggerOffsetFromDB | ( | int | run, |
double & | T0_real | ||
) |
Definition at line 261 of file DatabaseUtil_service.cc.
References fTableName, and SelectFieldByName().
UBChannelMap_t util::DatabaseUtil::GetUBChannelMap | ( | int | data_taking_timestamp = -1 , |
int | swizzling_timestamp = -1 |
||
) |
Definition at line 387 of file DatabaseUtil_service.cc.
References fChannelMap, and LoadUBChannelMap().
UBChannelReverseMap_t util::DatabaseUtil::GetUBChannelReverseMap | ( | int | data_taking_timestamp = -1 , |
int | swizzling_timestamp = -1 |
||
) |
Definition at line 392 of file DatabaseUtil_service.cc.
References fChannelReverseMap, and LoadUBChannelMap().
|
private |
Definition at line 306 of file DatabaseUtil_service.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 76 of file DatabaseUtil_service.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 221 of file DatabaseUtil_service.cc.
References SelectSingleFieldByQuery().
Referenced by GetLifetimeFromDB(), GetPOTFromDB(), GetTemperatureFromDB(), and GetTriggerOffsetFromDB().
|
private |
Definition at line 116 of file DatabaseUtil_service.cc.
References conn, Connect(), DisConnect(), fShouldConnect, and LOG_DEBUG.
Referenced by GetEfieldValuesFromDB(), and SelectFieldByName().
|
inline |
Definition at line 71 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 399 of file DatabaseUtil_service.cc.
References DEFINE_ART_SERVICE, and ss.
Referenced by LoadUBChannelMap().
|
inline |
Definition at line 70 of file DatabaseUtil.h.
|
private |
Definition at line 80 of file DatabaseUtil.h.
Referenced by Connect(), DatabaseUtil(), DisConnect(), LoadUBChannelMap(), and SelectSingleFieldByQuery().
|
private |
Definition at line 78 of file DatabaseUtil.h.
Referenced by Connect(), and reconfigure().
|
private |
Definition at line 90 of file DatabaseUtil.h.
Referenced by DatabaseUtil(), GetUBChannelMap(), and LoadUBChannelMap().
|
private |
Definition at line 91 of file DatabaseUtil.h.
Referenced by DatabaseUtil(), GetUBChannelReverseMap(), and LoadUBChannelMap().
|
private |
Definition at line 81 of file DatabaseUtil.h.
Referenced by reconfigure().
|
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 86 of file DatabaseUtil.h.
Referenced by reconfigure().
|
private |
Definition at line 85 of file DatabaseUtil.h.
Referenced by reconfigure().
|
private |
Definition at line 88 of file DatabaseUtil.h.
Referenced by Connect(), DisConnect(), reconfigure(), and SelectSingleFieldByQuery().
|
private |
Definition at line 84 of file DatabaseUtil.h.
Referenced by GetEfieldValuesFromDB(), GetLifetimeFromDB(), GetPOTFromDB(), GetTemperatureFromDB(), GetTriggerOffsetFromDB(), and reconfigure().
|
private |
Definition at line 87 of file DatabaseUtil.h.
Referenced by Connect(), and reconfigure().