Go to the documentation of this file.00001 #include "CondTools/DQM/interface/DQMSummarySourceHandler.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00004 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
00005 #include "CondTools/DQM/interface/DQMSummaryReader.h"
00006 #include <iostream>
00007 #include <string>
00008 #include <vector>
00009
00010 namespace popcon {
00011 DQMSummarySourceHandler::DQMSummarySourceHandler(const edm::ParameterSet & pset):
00012 m_name(pset.getUntrackedParameter<std::string>("name","DQMSummarySourceHandler")),
00013 m_since(pset.getUntrackedParameter<unsigned long long>("firstSince",1)),
00014 m_user(pset.getUntrackedParameter<std::string>("OnlineDBUser","CMS_DQM_SUMMARY")),
00015 m_pass(pset.getUntrackedParameter<std::string>("OnlineDBPass","****")) {
00016 m_connectionString = "oracle://cms_omds_lb/CMS_DQM_SUMMARY";
00017 }
00018
00019 DQMSummarySourceHandler::~DQMSummarySourceHandler() {}
00020
00021 void DQMSummarySourceHandler::getNewObjects() {
00022
00023 edm::LogInfo("DQMSummarySourceHandler") << "------- " << m_name << " -> getNewObjects\n"
00024 << "got offlineInfo " << tagInfo().name
00025 << ", size " << tagInfo().size
00026 << ", last object valid since "
00027 << tagInfo().lastInterval.first << " token "
00028 << tagInfo().lastPayloadToken << std::endl;
00029 edm::LogInfo("DQMSummarySourceHandler") << " ------ last entry info regarding the payload (if existing): "
00030 << logDBEntry().usertext
00031 << "; last record with the correct tag (if existing) has been written in the db: "
00032 << logDBEntry().destinationDB << std::endl;
00033 if (tagInfo().size > 0) {
00034 Ref payload = lastPayload();
00035 edm::LogInfo("DQMSummarySourceHandler") << "size of last payload "
00036 << payload->m_summary.size() << std::endl;
00037 }
00038 std::cout << "runnumber/first since = " << m_since << std::endl;
00039 DQMSummary * dqmSummary = new DQMSummary;
00040 DQMSummaryReader dqmSummaryReader(m_connectionString, m_user, m_pass);
00041 *dqmSummary = dqmSummaryReader.readData("SUMMARYCONTENT", m_since);
00042 m_to_transfer.push_back(std::make_pair((DQMSummary*)dqmSummary,m_since));
00043 edm::LogInfo("DQMSummarySourceHandler") << "------- "
00044 << m_name << " - > getNewObjects"
00045 << std::endl;
00046 }
00047
00048 std::string DQMSummarySourceHandler::id() const {return m_name;}
00049 }