#include <RunInfoHandler.h>
Public Member Functions | |
void | getNewObjects () |
std::string | id () const |
RunInfoHandler (const edm::ParameterSet &pset) | |
~RunInfoHandler () | |
Private Attributes | |
std::string | m_authpath |
std::string | m_connectionString |
std::string | m_host |
std::string | m_name |
std::string | m_pass |
int | m_port |
std::string | m_sid |
unsigned long long | m_since |
std::string | m_user |
Definition at line 10 of file RunInfoHandler.h.
RunInfoHandler::~RunInfoHandler | ( | ) |
Definition at line 15 of file RunInfoHandler.cc.
{}
RunInfoHandler::RunInfoHandler | ( | const edm::ParameterSet & | pset | ) |
Definition at line 8 of file RunInfoHandler.cc.
References m_connectionString.
: m_name(pset.getUntrackedParameter<std::string>("name","RunInfoHandler")) ,m_user(pset.getUntrackedParameter<std::string>("OnlineDBUser","CMS_RUNINFO_R")) ,m_pass(pset.getUntrackedParameter<std::string>("OnlineDBPass","PASSWORD")) { m_connectionString= "oracle://cms_omds_lb/CMS_RUNINFO"; }
void RunInfoHandler::getNewObjects | ( | ) | [virtual] |
Implements popcon::PopConSourceHandler< RunInfo >.
Definition at line 17 of file RunInfoHandler.cc.
References ExpressReco_HICollisions_FallBack::cerr, gather_cfg::cout, RunInfo::Fake_RunInfo(), cond::TagInfo::lastInterval, cond::TagInfo::lastPayloadToken, m_connectionString, m_name, m_pass, popcon::PopConSourceHandler< RunInfo >::m_to_transfer, m_user, popcon::PopConSourceHandler< RunInfo >::m_userTextLog, cond::TagInfo::name, csvReporter::r, RunInfoRead::readData(), findQualityFiles::size, cond::TagInfo::size, and popcon::PopConSourceHandler< RunInfo >::tagInfo().
{ //check whats already inside of database edm::LogInfo ("RunInfoHandler") << "------- " << m_name << " - > getNewObjects\n" << "got offlineInfo " << tagInfo().name << ", size " << tagInfo().size << ", last object valid since " << tagInfo().lastInterval.first << " token " << tagInfo().lastPayloadToken << std::endl; unsigned int snc; std::cerr << "Source implementation test ::getNewObjects : enter runnumber as a first since !\n"; std::cin >> snc; std::cout <<"runnumber/first since = " << snc << std::endl; RunInfo* r = new RunInfo(); //fill with null runinfo if empty run are found beetween the two last valid ones size_t n_empty_run = 0; if(tagInfo().size > 0 && (tagInfo().lastInterval.first+1) < snc) { n_empty_run = snc - tagInfo().lastInterval.first - 1; edm::LogInfo ("RunInfoHandler") << "------- " << "entering fake run from " << tagInfo().lastInterval.first + 1 << "to " << snc - 1 << "- > getNewObjects" << std::endl; n_empty_run = snc - tagInfo().lastInterval.first - 1; } // transfer fake run for 1 to since for the first time if (tagInfo().size == 0 && snc != 1) { m_to_transfer.push_back(std::make_pair((RunInfo*) (r->Fake_RunInfo()),1)); } if (n_empty_run != 0) { m_to_transfer.push_back(std::make_pair((RunInfo*) (r->Fake_RunInfo()),tagInfo().lastInterval.first + 1)); } //reading from omds RunInfoRead rn(m_connectionString, m_user, m_pass); *r = rn.readData("RUNSESSION_PARAMETER", "STRING_VALUE",(int)snc); m_to_transfer.push_back(std::make_pair((RunInfo*)r,snc)); std::ostringstream ss; ss << "since =" << snc; m_userTextLog = ss.str() + ";"; edm::LogInfo ("RunInfoHandler") << "------- " << m_name << " - > getNewObjects" << std::endl; }
std::string RunInfoHandler::id | ( | void | ) | const [inline, virtual] |
Implements popcon::PopConSourceHandler< RunInfo >.
Definition at line 13 of file RunInfoHandler.h.
References m_name.
{ return m_name;}
std::string RunInfoHandler::m_authpath [private] |
Definition at line 25 of file RunInfoHandler.h.
std::string RunInfoHandler::m_connectionString [private] |
Definition at line 23 of file RunInfoHandler.h.
Referenced by getNewObjects(), and RunInfoHandler().
std::string RunInfoHandler::m_host [private] |
Definition at line 26 of file RunInfoHandler.h.
std::string RunInfoHandler::m_name [private] |
Definition at line 18 of file RunInfoHandler.h.
Referenced by getNewObjects(), and id().
std::string RunInfoHandler::m_pass [private] |
Definition at line 29 of file RunInfoHandler.h.
Referenced by getNewObjects().
int RunInfoHandler::m_port [private] |
Definition at line 30 of file RunInfoHandler.h.
std::string RunInfoHandler::m_sid [private] |
Definition at line 27 of file RunInfoHandler.h.
unsigned long long RunInfoHandler::m_since [private] |
Definition at line 19 of file RunInfoHandler.h.
std::string RunInfoHandler::m_user [private] |
Definition at line 28 of file RunInfoHandler.h.
Referenced by getNewObjects().