CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
RunInfoHandler Class Reference

#include <RunInfoHandler.h>

Inheritance diagram for RunInfoHandler:
popcon::PopConSourceHandler< RunInfo >

Public Member Functions

void getNewObjects ()
 
std::string id () const
 
 RunInfoHandler (const edm::ParameterSet &pset)
 
 ~RunInfoHandler ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< RunInfo >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (cond::DbSession dbSession, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (cond::DbSession session, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

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
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< RunInfo >
typedef std::vector< TripletContainer
 
typedef std::vector< std::pair
< RunInfo *, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< RunInfo
self
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef RunInfo value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< RunInfo >
int add (value_type *payload, Summary *summary, Time_t time)
 
- Protected Attributes inherited from popcon::PopConSourceHandler< RunInfo >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 10 of file RunInfoHandler.h.

Constructor & Destructor Documentation

RunInfoHandler::~RunInfoHandler ( )

Definition at line 15 of file RunInfoHandler.cc.

15 {}
RunInfoHandler::RunInfoHandler ( const edm::ParameterSet pset)

Definition at line 8 of file RunInfoHandler.cc.

References m_connectionString.

8  :
9  m_name(pset.getUntrackedParameter<std::string>("name","RunInfoHandler"))
10  ,m_user(pset.getUntrackedParameter<std::string>("OnlineDBUser","CMS_RUNINFO_R"))
11  ,m_pass(pset.getUntrackedParameter<std::string>("OnlineDBPass","PASSWORD")) {
12  m_connectionString= "oracle://cms_omds_lb/CMS_RUNINFO";
13 }
std::string m_user
T getUntrackedParameter(std::string const &, T const &) const
std::string m_connectionString
std::string m_name
std::string m_pass

Member Function Documentation

void RunInfoHandler::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< RunInfo >.

Definition at line 17 of file RunInfoHandler.cc.

References dtNoiseDBValidation_cfg::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, alignCSCRings::r, RunInfoRead::readData(), cond::TagInfo::size, findQualityFiles::size, and popcon::PopConSourceHandler< RunInfo >::tagInfo().

17  {
18  //check whats already inside of database
19  edm::LogInfo ("RunInfoHandler") << "------- " << m_name
20  << " - > getNewObjects\n"
21  << "got offlineInfo " << tagInfo().name
22  << ", size " << tagInfo().size
23  << ", last object valid since "
24  << tagInfo().lastInterval.first
25  << " token " << tagInfo().lastPayloadToken
26  << std::endl;
27  unsigned int snc;
28  std::cerr << "Source implementation test ::getNewObjects : enter runnumber as a first since !\n";
29  std::cin >> snc;
30  std::cout <<"runnumber/first since = " << snc << std::endl;
31  RunInfo* r = new RunInfo();
32 
33  //fill with null runinfo if empty run are found beetween the two last valid ones
34  size_t n_empty_run = 0;
35  if(tagInfo().size > 0 && (tagInfo().lastInterval.first+1) < snc) {
36  n_empty_run = snc - tagInfo().lastInterval.first - 1;
37  edm::LogInfo ("RunInfoHandler") << "------- " << "entering fake run from "
38  << tagInfo().lastInterval.first + 1
39  << "to " << snc - 1 << "- > getNewObjects"
40  << std::endl;
41  n_empty_run = snc - tagInfo().lastInterval.first - 1;
42  }
43  // transfer fake run for 1 to since for the first time
44  if (tagInfo().size == 0 && snc != 1) {
45  m_to_transfer.push_back(std::make_pair((RunInfo*) (r->Fake_RunInfo()),1));
46  }
47  if (n_empty_run != 0) {
48  m_to_transfer.push_back(std::make_pair((RunInfo*) (r->Fake_RunInfo()),tagInfo().lastInterval.first + 1));
49  }
50 
51  //reading from omds
53  *r = rn.readData("RUNSESSION_PARAMETER", "STRING_VALUE",(int)snc);
54  m_to_transfer.push_back(std::make_pair((RunInfo*)r,snc));
55  std::ostringstream ss;
56  ss << "since =" << snc;
57  m_userTextLog = ss.str() + ";";
58  edm::LogInfo ("RunInfoHandler") << "------- " << m_name << " - > getNewObjects" << std::endl;
59 }
std::string m_user
std::string m_connectionString
std::string lastPayloadToken
Definition: TagInfo.h:12
cond::TagInfo const & tagInfo() const
std::string name
Definition: TagInfo.h:9
size_t size
Definition: TagInfo.h:13
std::string m_name
static RunInfo * Fake_RunInfo()
Definition: RunInfo.cc:4
cond::ValidityInterval lastInterval
Definition: TagInfo.h:11
tuple cout
Definition: gather_cfg.py:121
tuple size
Write out results.
std::string m_pass
std::string RunInfoHandler::id ( void  ) const
inlinevirtual

Implements popcon::PopConSourceHandler< RunInfo >.

Definition at line 13 of file RunInfoHandler.h.

References m_name.

13 { return m_name;}
std::string m_name

Member Data Documentation

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().