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 (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Attributes

std::string m_authpath
 
std::string m_connectionString
 
std::string m_name
 
std::string m_pass
 
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 17 of file RunInfoHandler.cc.

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

Definition at line 8 of file RunInfoHandler.cc.

8  :
9  m_name( pset.getUntrackedParameter<std::string>( "name", "RunInfoHandler") )
10  ,m_since( pset.getParameter<unsigned long long>( "runNumber" ) )
11  ,m_connectionString( pset.getUntrackedParameter<std::string>( "connectionString", "oracle://cms_omds_adg/CMS_RUNINFO") )
12  ,m_authpath( pset.getUntrackedParameter<std::string>( "authenticationPath", "." ) )
13  ,m_user( pset.getUntrackedParameter<std::string>( "OnlineDBUser", "CMS_RUNINFO_R" ) )
14  ,m_pass( pset.getUntrackedParameter<std::string>( "OnlineDBPass", "PASSWORD") ) {
15 }
std::string m_user
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned long long m_since
std::string m_connectionString
std::string m_authpath
std::string m_name
std::string m_pass

Member Function Documentation

void RunInfoHandler::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< RunInfo >.

Definition at line 19 of file RunInfoHandler.cc.

References RunInfo::Fake_RunInfo(), cond::TagInfo_t::lastInterval, cond::TagInfo_t::lastPayloadToken, m_connectionString, m_name, m_pass, m_since, popcon::PopConSourceHandler< RunInfo >::m_to_transfer, m_user, popcon::PopConSourceHandler< RunInfo >::m_userTextLog, cond::TagInfo_t::name, alignCSCRings::r, RunInfoRead::readData(), cond::TagInfo_t::size, findQualityFiles::size, contentValuesCheck::ss, and popcon::PopConSourceHandler< RunInfo >::tagInfo().

19  {
20  //check whats already inside of database
21  edm::LogInfo( "RunInfoHandler" ) << "------- " << m_name
22  << " - > getNewObjects\n"
23  << "got offlineInfo " << tagInfo().name
24  << ", size " << tagInfo().size
25  << ", last object valid since " << tagInfo().lastInterval.first
26  << " token " << tagInfo().lastPayloadToken << std::endl;
27  edm::LogInfo( "RunInfoHandler" ) << "runnumber/first since = " << m_since << std::endl;
28  RunInfo* r = new RunInfo();
29 
30  //fill with null runinfo if empty run are found beetween the two last valid ones
31  size_t n_empty_run = 0;
32  if( tagInfo().size > 0 && (tagInfo().lastInterval.first + 1) < m_since ) {
33  n_empty_run = m_since - tagInfo().lastInterval.first - 1;
34  edm::LogInfo( "RunInfoHandler" ) << "------- " << "entering fake run from "
35  << tagInfo().lastInterval.first + 1
36  << "to " << m_since - 1 << "- > getNewObjects"
37  << std::endl;
38  }
39  // transfer fake run for 1 to since for the first time
40  if( tagInfo().size == 0 && m_since != 1 ) {
41  m_to_transfer.push_back( std::make_pair( (RunInfo*)(r->Fake_RunInfo()), 1 ) );
42  }
43  if ( n_empty_run != 0 ) {
44  m_to_transfer.push_back(std::make_pair( (RunInfo*)(r->Fake_RunInfo()), tagInfo().lastInterval.first + 1 ) );
45  }
46 
47  //reading from omds
49  *r = rn.readData( "RUNSESSION_PARAMETER", "STRING_VALUE",(int)m_since );
50  m_to_transfer.push_back( std::make_pair( (RunInfo*)r, m_since) );
51  std::ostringstream ss;
52  ss << "since =" << m_since;
53  m_userTextLog = ss.str() + ";";
54  edm::LogInfo( "RunInfoHandler" ) << "------- " << m_name << " - > getNewObjects" << std::endl;
55 }
std::string m_user
unsigned long long m_since
std::string m_connectionString
size_t size
Definition: Types.h:75
std::string name
Definition: Types.h:71
cond::ValidityInterval lastInterval
Definition: Types.h:73
std::string lastPayloadToken
Definition: Types.h:74
std::string m_name
static RunInfo * Fake_RunInfo()
Definition: RunInfo.cc:4
tuple size
Write out results.
std::string m_pass
cond::TagInfo_t const & tagInfo() const
std::string RunInfoHandler::id ( ) 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 23 of file RunInfoHandler.h.

std::string RunInfoHandler::m_connectionString
private

Definition at line 22 of file RunInfoHandler.h.

Referenced by getNewObjects().

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 25 of file RunInfoHandler.h.

Referenced by getNewObjects().

unsigned long long RunInfoHandler::m_since
private

Definition at line 19 of file RunInfoHandler.h.

Referenced by getNewObjects().

std::string RunInfoHandler::m_user
private

Definition at line 24 of file RunInfoHandler.h.

Referenced by getNewObjects().