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 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_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::vector< Triplet > Container
 
typedef std::vector< std::pair< RunSummary *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< RunSummaryself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef RunSummary value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< RunSummary >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< RunSummary >
OldContainer 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.

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 }

References m_connectionString.

Member Function Documentation

◆ getNewObjects()

void RunSummaryHandler::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< RunSummary >.

Definition at line 22 of file RunSummaryHandler.cc.

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  n_empty_run = snc - tagInfo().lastInterval.since - 1;
51  edm::LogInfo("RunSummaryHandler") << "------- "
52  << "entering fake run from " << tagInfo().lastInterval.since + 1 << "to "
53  << snc - 1 << "- > getNewObjects" << std::endl;
54  n_empty_run = snc - tagInfo().lastInterval.since - 1;
55  // for (size_t i=1; i<= n_empty_run ; i++){
56 
57  // r->summary.push_back(empty->fake_Run());
58  // }
59  }
60 
61  // transfer fake run for 1 to since for the first time
62  if (tagInfo().size == 0) {
63  m_to_transfer.push_back(std::make_pair((RunSummary*)(r->Fake_RunSummary()), 1));
64  }
65 
66  // transfer also empty run if tag already existing
67  if (n_empty_run != 0) {
68  m_to_transfer.push_back(std::make_pair((RunSummary*)(r->Fake_RunSummary()), tagInfo().lastInterval.since + 1));
69  }
70 
71  // reading from omds
73 
74  *r = rn.readData("RUNSESSION_PARAMETER", "STRING_VALUE", (int)snc);
75  m_to_transfer.push_back(std::make_pair((RunSummary*)r, snc));
76  std::ostringstream ss;
77  ss << "since =" << snc;
78 
79  m_userTextLog = ss.str() + ";";
80 
81  edm::LogInfo("RunSummaryHandler") << "------- " << m_name << " - > getNewObjects" << std::endl;
82 }

References beam_dqm_sourceclient-live_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().

◆ id()

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

Implements popcon::PopConSourceHandler< RunSummary >.

Definition at line 13 of file RunSummaryHandler.h.

13 { return m_name; }

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

RunSummaryRead
Definition: RunSummaryRead.h:8
RunSummary
Definition: RunSummary.h:18
RunSummaryHandler::m_pass
std::string m_pass
Definition: RunSummaryHandler.h:29
popcon::PopConSourceHandler< RunSummary >::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
RunSummaryHandler::m_name
std::string m_name
Definition: RunSummaryHandler.h:18
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
cond::TagInfo_t::name
std::string name
Definition: Types.h:72
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
RunSummaryHandler::m_connectionString
std::string m_connectionString
Definition: RunSummaryHandler.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
popcon::PopConSourceHandler< RunSummary >::tagInfo
cond::TagInfo_t const & tagInfo() const
Definition: PopConSourceHandler.h:78
cond::Iov_t::payloadId
Hash payloadId
Definition: Types.h:55
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
cond::Iov_t::since
Time_t since
Definition: Types.h:53
alignCSCRings.r
r
Definition: alignCSCRings.py:93
cond::TagInfo_t::lastInterval
Iov_t lastInterval
Definition: Types.h:73
RunSummaryHandler::m_user
std::string m_user
Definition: RunSummaryHandler.h:28
popcon::PopConSourceHandler< RunSummary >::m_userTextLog
std::string m_userTextLog
Definition: PopConSourceHandler.h:168
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
cond::TagInfo_t::size
size_t size
Definition: Types.h:74
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443