Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:44

0001 #include "CondTools/DQM/interface/DQMSummarySourceHandler.h"
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0004 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
0005 #include "CondTools/DQM/interface/DQMSummaryReader.h"
0006 #include <iostream>
0007 #include <string>
0008 #include <vector>
0009 
0010 namespace popcon {
0011   DQMSummarySourceHandler::DQMSummarySourceHandler(const edm::ParameterSet& pset)
0012       : m_name(pset.getUntrackedParameter<std::string>("name", "DQMSummarySourceHandler")),
0013         m_since(pset.getUntrackedParameter<unsigned long long>("firstSince", 1)),
0014         m_user(pset.getUntrackedParameter<std::string>("OnlineDBUser", "CMS_DQM_SUMMARY")),
0015         m_pass(pset.getUntrackedParameter<std::string>("OnlineDBPass", "****")) {
0016     m_connectionString = "oracle://cms_omds_lb/CMS_DQM_SUMMARY";
0017   }
0018 
0019   DQMSummarySourceHandler::~DQMSummarySourceHandler() {}
0020 
0021   void DQMSummarySourceHandler::getNewObjects() {
0022     //check what is already inside of the database
0023     edm::LogInfo("DQMSummarySourceHandler")
0024         << "------- " << m_name << " -> getNewObjects\n"
0025         << "got offlineInfo " << tagInfo().name << ", size " << tagInfo().size << ", last object valid since "
0026         << tagInfo().lastInterval.since << " token " << tagInfo().lastInterval.payloadId << std::endl;
0027     edm::LogInfo("DQMSummarySourceHandler")
0028         << " ------ last entry info regarding the payload (if existing): " << logDBEntry().usertext
0029         << "; last record with the correct tag (if existing) has been written in the db: " << logDBEntry().destinationDB
0030         << std::endl;
0031     if (tagInfo().size > 0) {
0032       Ref payload = lastPayload();
0033       edm::LogInfo("DQMSummarySourceHandler") << "size of last payload  " << payload->m_summary.size() << std::endl;
0034     }
0035     std::cout << "runnumber/first since = " << m_since << std::endl;
0036     DQMSummary* dqmSummary = new DQMSummary;
0037     DQMSummaryReader dqmSummaryReader(m_connectionString, m_user, m_pass);
0038     *dqmSummary = dqmSummaryReader.readData("SUMMARYCONTENT", m_since);
0039     m_to_transfer.push_back(std::make_pair((DQMSummary*)dqmSummary, m_since));
0040     edm::LogInfo("DQMSummarySourceHandler") << "------- " << m_name << " - > getNewObjects" << std::endl;
0041   }
0042 
0043   std::string DQMSummarySourceHandler::id() const { return m_name; }
0044 }  // namespace popcon