#include <DTCalibDBUtils.h>
Public Member Functions | |
DTCalibDBUtils () | |
Constructor. | |
virtual | ~DTCalibDBUtils () |
Destructor. | |
Static Public Member Functions | |
template<typename T > | |
static void | writeToDB (std::string record, T *payload) |
Simple interface to PoolDBOutputService to write objects to DB.
Definition at line 16 of file DTCalibDBUtils.h.
DTCalibDBUtils::DTCalibDBUtils | ( | ) |
Constructor.
virtual DTCalibDBUtils::~DTCalibDBUtils | ( | ) | [virtual] |
Destructor.
static void DTCalibDBUtils::writeToDB | ( | std::string | record, |
T * | payload | ||
) | [inline, static] |
Write the payload to the DB using PoolDBOutputService. New payload are created in the DB, existing payload are appended.
Definition at line 29 of file DTCalibDBUtils.h.
References gather_cfg::cout, exception, edm::Service< T >::isAvailable(), record, and cms::Exception::what().
Referenced by DTT0CalibrationNew::endJob(), DTTTrigWriter::endJob(), DTTPDeadWriter::endJob(), DTTTrigCalibration::endJob(), DTT0Calibration::endJob(), DTLocalTriggerSynchTest::endJob(), and DTTTrigOffsetCalibration::endJob().
{ // Write the ttrig object to DB edm::Service<cond::service::PoolDBOutputService> dbOutputSvc; if(dbOutputSvc.isAvailable()){ try{ if(dbOutputSvc->isNewTagRequest(record)){ //create mode dbOutputSvc->writeOne<T>(payload, dbOutputSvc->beginOfTime(),record); }else{ //append mode. Note: correct PoolDBESSource must be loaded dbOutputSvc->writeOne<T>(payload, dbOutputSvc->currentTime(),record); } }catch(const cond::Exception& er){ std::cout << er.what() << std::endl; }catch(const std::exception& er){ std::cout << "[DTCalibDBUtils] caught std::exception " << er.what() << std::endl; }catch(...){ std::cout << "[DTCalibDBUtils] Funny error" << std::endl; } }else{ std::cout << "Service PoolDBOutputService is unavailable" << std::endl; } }