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
DTLVStatusHandler Class Reference

#include <DTLVStatusHandler.h>

Inheritance diagram for DTLVStatusHandler:
popcon::PopConSourceHandler< DTLVStatus >

Public Member Functions

 DTLVStatusHandler (const edm::ParameterSet &ps)
 
void getNewObjects ()
 
std::string id () const
 
virtual ~DTLVStatusHandler ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< DTLVStatus >
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

cond::persistency::Session buff_session
 
std::string bufferConnect
 
DTLVStatusccbStatus
 
std::string dataTag
 
cond::persistency::Session omds_session
 
std::string onlineAuthentication
 
std::string onlineConnect
 

Additional Inherited Members

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

Detailed Description

Description: Class to copy CCB DCS-status via PopCon

Date:
2010/07/21 16:06:53
Revision:
1.2
Author
Paolo Ronchese INFN Padova

Definition at line 37 of file DTLVStatusHandler.h.

Constructor & Destructor Documentation

DTLVStatusHandler::DTLVStatusHandler ( const edm::ParameterSet ps)

Constructor

Definition at line 43 of file DTLVStatusHandler.cc.

References gather_cfg::cout.

43  :
44  dataTag( ps.getParameter<std::string> ( "tag" ) ),
45  onlineConnect( ps.getParameter<std::string> ( "onlineDB" ) ),
47  "onlineAuthentication" ) ),
48  bufferConnect( ps.getParameter<std::string> ( "bufferDB" ) ),
49  omds_session(),
50  buff_session() {
51  std::cout << " PopCon application for DT DCS data (CCB status) export "
52  << std::endl;
53 }
T getParameter(std::string const &) const
cond::persistency::Session buff_session
std::string onlineAuthentication
cond::persistency::Session omds_session
std::string onlineConnect
tuple cout
Definition: gather_cfg.py:145
std::string bufferConnect
DTLVStatusHandler::~DTLVStatusHandler ( )
virtual

Destructor

Definition at line 58 of file DTLVStatusHandler.cc.

58  {
59 }

Member Function Documentation

void DTLVStatusHandler::getNewObjects ( )
virtual

Operations

Implements popcon::PopConSourceHandler< DTLVStatus >.

Definition at line 64 of file DTLVStatusHandler.cc.

References buff_session, bufferConnect, cond::persistency::Session::close(), cond::persistency::Transaction::commit(), cond::persistency::ConnectionPool::configure(), gather_cfg::cout, cond::persistency::ConnectionPool::createSession(), dataTag, plotBeamSpotDB::last, cond::TagInfo_t::lastInterval, MergeJob_cfg::lastRun, popcon::PopConSourceHandler< DTLVStatus >::m_to_transfer, omds_session, onlineAuthentication, onlineConnect, cond::persistency::ConnectionPool::setAuthenticationPath(), cond::persistency::Transaction::start(), popcon::PopConSourceHandler< DTLVStatus >::tagInfo(), and cond::persistency::Session::transaction().

64  {
65 
66  // online DB connection
67  std::cout << "configure omds DbConnection" << std::endl;
70  connection.configure();
71  std::cout << "create omds DbSession" << std::endl;
73  std::cout << "start omds transaction" << std::endl;
75  std::cout << "" << std::endl;
76 
77  // buffer DB connection
78  std::cout << "create buffer DbSession" << std::endl;
80  std::cout << "start buffer transaction" << std::endl;
81  buff_session.transaction().start();
82 
83  // offline info
84 
85  //to access the information on the tag inside the offline database:
86  cond::TagInfo const & ti = tagInfo();
87  unsigned int last = ti.lastInterval.first;
88  std::cout << "latest DCS data (CCB status) already copied for run: "
89  << last << std::endl;
90 
91  if ( last == 0 ) {
92  DTLVStatus* dummyConf = new DTLVStatus( dataTag );
93  cond::Time_t snc = 1;
94  m_to_transfer.push_back( std::make_pair( dummyConf, snc ) );
95  }
96 
97  //to access the information on last successful log entry for this tag:
98 // cond::LogDBEntry const & lde = logDBEntry();
99 
100  //to access the lastest payload (Ref is a smart pointer)
101 // Ref payload = lastPayload();
102 
103  unsigned lastRun = last;
104  std::cout << "check for new runs since " << lastRun << std::endl;
105 
106  buff_session.transaction().commit();
107  buff_session.close();
109 
110  return;
111 
112 }
cond::persistency::Session buff_session
void start(bool readOnly=true)
Definition: Session.cc:22
Transaction & transaction()
Definition: Session.cc:66
cond::ValidityInterval lastInterval
Definition: Types.h:73
unsigned long long Time_t
Definition: Time.h:16
Session createSession(const std::string &connectionString, bool writeCapable=false)
std::string onlineAuthentication
cond::persistency::Session omds_session
std::string onlineConnect
tuple cout
Definition: gather_cfg.py:145
std::string bufferConnect
void setAuthenticationPath(const std::string &p)
cond::TagInfo_t const & tagInfo() const
std::string DTLVStatusHandler::id ( ) const
virtual

Implements popcon::PopConSourceHandler< DTLVStatus >.

Definition at line 115 of file DTLVStatusHandler.cc.

References dataTag.

115  {
116  return dataTag;
117 }

Member Data Documentation

cond::persistency::Session DTLVStatusHandler::buff_session
private

Definition at line 64 of file DTLVStatusHandler.h.

Referenced by getNewObjects().

std::string DTLVStatusHandler::bufferConnect
private

Definition at line 60 of file DTLVStatusHandler.h.

Referenced by getNewObjects().

DTLVStatus* DTLVStatusHandler::ccbStatus
private

Definition at line 61 of file DTLVStatusHandler.h.

std::string DTLVStatusHandler::dataTag
private

Definition at line 57 of file DTLVStatusHandler.h.

Referenced by getNewObjects(), and id().

cond::persistency::Session DTLVStatusHandler::omds_session
private

Definition at line 63 of file DTLVStatusHandler.h.

Referenced by getNewObjects().

std::string DTLVStatusHandler::onlineAuthentication
private

Definition at line 59 of file DTLVStatusHandler.h.

Referenced by getNewObjects().

std::string DTLVStatusHandler::onlineConnect
private

Definition at line 58 of file DTLVStatusHandler.h.

Referenced by getNewObjects().