#ifndef DCalibrationGeneratorCCDB_h__ #define DCalibrationGeneratorCCDB_h__ #include #include #include #include #include #include #include #include "DCalibrationCCDB.h" // Place everything in JANA namespace namespace jana { class DCalibrationGeneratorCCDB: public JCalibrationGenerator { public: /** @brief default ctor */ DCalibrationGeneratorCCDB(): mGenerator(new ccdb::CalibrationGenerator()) { } /** @brief destructor */ virtual ~DCalibrationGeneratorCCDB(){} /** @brief Get string indicating type of calibration this handles * * @return string with desctiption */ const char* Description(){return "JCalibration using CCDB for MySQL and SQLite databases";} /** @brief Test probability of opening the given calibration * * @parameter [in] url in form "mysql://username@pass:host:port database_name" * @parameter [in] run number * @parameter [in] name of the variation * @return 0.0 - not openable, 0.99 if openable */ double CheckOpenable(std::string url, int run, std::string context) { #ifdef CCDB_DEBUG_OUTPUT jout<<"CCDB::janaccdb CheckOpenable "<<"url: '"<MakeCalibration(url,run,varition,time); //Create jana calibration object from ccdb return new DCalibrationCCDB(calib, url, run, context); } private: std::auto_ptr mGenerator; ///CCDB calibration generator object }; } // Close JANA namespace #endif // DCalibrationGeneratorCCDB_h__