CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RunSummaryHandler Class Reference

#include <RunSummaryHandler.h>

Inheritance diagram for RunSummaryHandler:
popcon::PopConSourceHandler< RunSummary >

Public Member Functions

void getNewObjects () override
 
std::string id () const override
 
 RunSummaryHandler (const edm::ParameterSet &pset)
 
 ~RunSummaryHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< RunSummary >
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 ()
 
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_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< RunSummary >
typedef std::map< Time_t, std::shared_ptr< RunSummary > > Container
 
typedef std::unique_ptr< RunSummaryRef
 
typedef PopConSourceHandler< RunSummaryself
 
typedef cond::Time_t Time_t
 
typedef RunSummary value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< RunSummary >
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< RunSummary >
Container m_iovs
 
std::vector< std::pair< RunSummary *, Time_t > > m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 10 of file RunSummaryHandler.h.

Constructor & Destructor Documentation

◆ ~RunSummaryHandler()

RunSummaryHandler::~RunSummaryHandler ( )
override

Definition at line 20 of file RunSummaryHandler.cc.

20 {}

◆ RunSummaryHandler()

RunSummaryHandler::RunSummaryHandler ( const edm::ParameterSet pset)

Definition at line 9 of file RunSummaryHandler.cc.

References m_connectionString.

10  : m_name(pset.getUntrackedParameter<std::string>("name", "RunSummaryHandler")),
11  // m_connect(pset.getUntrackedParameter<std::string>("OnlineConn","")),
12 
13  m_user(pset.getUntrackedParameter<std::string>("OnlineDBUser", "CMS_RUNINFO")),
14  m_pass(pset.getUntrackedParameter<std::string>("OnlineDBPass", "********"))
15 
16 {
17  m_connectionString = "oracle://cms_omds_lb/CMS_RUNINFO";
18 }
std::string m_connectionString

Member Function Documentation

◆ getNewObjects()

void RunSummaryHandler::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< RunSummary >.

Definition at line 22 of file RunSummaryHandler.cc.

References DMR_cfg::cerr, gather_cfg::cout, cond::TagInfo_t::lastInterval, m_connectionString, m_name, m_pass, popcon::PopConSourceHandler< RunSummary >::m_to_transfer, m_user, popcon::PopConSourceHandler< RunSummary >::m_userTextLog, cond::TagInfo_t::name, cond::Iov_t::payloadId, alignCSCRings::r, RunSummaryRead::readData(), cond::Iov_t::since, cond::TagInfo_t::size, findQualityFiles::size, contentValuesCheck::ss, and popcon::PopConSourceHandler< RunSummary >::tagInfo().

22  {
23  edm::LogInfo("RunSummaryHandler") << "------- " << m_name << " - > getNewObjects\n"
24  <<
25  //check whats already inside of database
26  "got offlineInfo" << tagInfo().name << ", size " << tagInfo().size << ", last object valid since "
28  << std::endl;
29 
30  /*
31  if (tagInfo().size>0) {
32  Ref payload = lastPayload();
33  //edm::LogInfo ("RunSummaryHandler")<<"size of last payload "<<
34  // payload->..........size()<<std::endl;
35  }
36  */
37  unsigned int snc;
38 
39  std::cerr << "Source implementation test ::getNewObjects : enter runnumber as a first since ! \n";
40  std::cin >> snc;
41 
42  std::cout << "runnumber/first since = " << snc << std::endl;
43 
44  RunSummary* r = new RunSummary();
45 
46  //fill with null runsummary if empty run are found beetween the two last validones
47 
48  size_t n_empty_run = 0;
49  if (tagInfo().size > 0 && (tagInfo().lastInterval.since + 1) < snc) {
50  edm::LogInfo("RunSummaryHandler") << "------- "
51  << "entering fake run from " << tagInfo().lastInterval.since + 1 << "to "
52  << snc - 1 << "- > getNewObjects" << std::endl;
53  n_empty_run = snc - tagInfo().lastInterval.since - 1;
54  // for (size_t i=1; i<= n_empty_run ; i++){
55 
56  // r->summary.push_back(empty->fake_Run());
57  // }
58  }
59 
60  // transfer fake run for 1 to since for the first time
61  if (tagInfo().size == 0) {
62  m_to_transfer.push_back(std::make_pair((RunSummary*)(r->Fake_RunSummary()), 1));
63  }
64 
65  // transfer also empty run if tag already existing
66  if (n_empty_run != 0) {
67  m_to_transfer.push_back(std::make_pair((RunSummary*)(r->Fake_RunSummary()), tagInfo().lastInterval.since + 1));
68  }
69 
70  // reading from omds
72 
73  *r = rn.readData("RUNSESSION_PARAMETER", "STRING_VALUE", (int)snc);
74  m_to_transfer.push_back(std::make_pair((RunSummary*)r, snc));
75  std::ostringstream ss;
76  ss << "since =" << snc;
77 
78  m_userTextLog = ss.str() + ";";
79 
80  edm::LogInfo("RunSummaryHandler") << "------- " << m_name << " - > getNewObjects" << std::endl;
81 }
size
Write out results.
Iov_t lastInterval
Definition: Types.h:73
Time_t since
Definition: Types.h:53
size_t size
Definition: Types.h:74
std::string name
Definition: Types.h:72
cond::TagInfo_t const & tagInfo() const
std::string m_connectionString
std::vector< std::pair< RunSummary *, Time_t > > m_to_transfer
Hash payloadId
Definition: Types.h:55
Log< level::Info, false > LogInfo

◆ id()

std::string RunSummaryHandler::id ( ) const
inlineoverridevirtual

Implements popcon::PopConSourceHandler< RunSummary >.

Definition at line 13 of file RunSummaryHandler.h.

References m_name.

13 { return m_name; }

Member Data Documentation

◆ m_authpath

std::string RunSummaryHandler::m_authpath
private

Definition at line 25 of file RunSummaryHandler.h.

◆ m_connectionString

std::string RunSummaryHandler::m_connectionString
private

Definition at line 23 of file RunSummaryHandler.h.

Referenced by getNewObjects(), and RunSummaryHandler().

◆ m_host

std::string RunSummaryHandler::m_host
private

Definition at line 26 of file RunSummaryHandler.h.

◆ m_name

std::string RunSummaryHandler::m_name
private

Definition at line 18 of file RunSummaryHandler.h.

Referenced by getNewObjects(), and id().

◆ m_pass

std::string RunSummaryHandler::m_pass
private

Definition at line 29 of file RunSummaryHandler.h.

Referenced by getNewObjects().

◆ m_port

int RunSummaryHandler::m_port
private

Definition at line 30 of file RunSummaryHandler.h.

◆ m_sid

std::string RunSummaryHandler::m_sid
private

Definition at line 27 of file RunSummaryHandler.h.

◆ m_since

unsigned long long RunSummaryHandler::m_since
private

Definition at line 19 of file RunSummaryHandler.h.

◆ m_user

std::string RunSummaryHandler::m_user
private

Definition at line 28 of file RunSummaryHandler.h.

Referenced by getNewObjects().