#ifndef _DCalibrationCCDB_ #define _DCalibrationCCDB_ #include #include #include #include #include #include #include #include #include using namespace std; using namespace jana; // Place everything in JANA namespace namespace jana { /** * Descendant of JCalibration class which allow to use CCDB as JANA calibration source */ class DCalibrationCCDB : public JCalibration { public: /** @brief Constructor * * @parameter [in] url - connection string. like mysql://... * @parameter [in] run - run number * @parameter [in] context - variation */ DCalibrationCCDB(ccdb::Calibration* calib, string url, int run, string context="default"): JCalibration(calib->GetConnectionString(), run, context) { mCalibration = calib; #ifdef CCDB_DEBUG_OUTPUT jout<<"CCDB::janaccdb created DCalibrationCCDB with connection string:" << calib->GetConnectionString()<< " run:"< &svals, int event_number=0) { // try { bool result = mCalibration->GetCalib(svals, namepath); //>oO CCDB debug output #ifdef CCDB_DEBUG_OUTPUT string result_str((result)?string("loaded"):string("failure")); cout<<"CCDB::janaccdb"< request = '"<0) { map::const_iterator iter = svals.begin(); first_value.assign(iter->second); } cout<<"CCDB::janaccdb selected name-values count = '"<end of CCDB debug output return !result; //JANA has false - if success and true if error } catch (std::exception ex) { //>oO CCDB debug output #ifdef CCDB_DEBUG_OUTPUT cout <<"CCDB::janaccdb Exception caught at GetCalib(string namepath, map &svals, int event_number=0)"<> request = '"<0 && vsvals[0].size()>0) { map::const_iterator iter = vsvals[0].begin(); first_value.assign(iter->second); } cout<<"CCDB::janaccdb selected rows = '"<oO CCDB debug output #ifdef CCDB_DEBUG_OUTPUT cout <<"CCDB::janaccdb Exception caught at GetCalib(string namepath, map &svals, int event_number=0)"< &namepaths). What = "<< ex.what()<