CMS 3D CMS Logo

RunSummaryHandler.cc
Go to the documentation of this file.
5 
6 #include <iostream>
7 #include <vector>
8 
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 }
19 
21 
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 }
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
MessageLogger.h
RunSummaryHandler::m_name
std::string m_name
Definition: RunSummaryHandler.h:18
gather_cfg.cout
cout
Definition: gather_cfg.py:144
RunSummaryRead::readData
RunSummary readData(const std::string &table, const std::string &column, const int r_number)
Definition: RunSummaryRead.cc:44
RunSummaryHandler.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
RunSummaryRead.h
cond::TagInfo_t::name
std::string name
Definition: Types.h:72
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
RunSummaryHandler::getNewObjects
void getNewObjects() override
Definition: RunSummaryHandler.cc:22
RunSummaryHandler::m_connectionString
std::string m_connectionString
Definition: RunSummaryHandler.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
popcon::PopConSourceHandler< RunSummary >::tagInfo
cond::TagInfo_t const & tagInfo() const
Definition: PopConSourceHandler.h:78
cond::Iov_t::payloadId
Hash payloadId
Definition: Types.h:55
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
std
Definition: JetResolutionObject.h:76
RunSummaryHandler::RunSummaryHandler
RunSummaryHandler(const edm::ParameterSet &pset)
Definition: RunSummaryHandler.cc:9
ParameterSet.h
RunSummaryHandler::m_user
std::string m_user
Definition: RunSummaryHandler.h:28
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
popcon::PopConSourceHandler< RunSummary >::m_userTextLog
std::string m_userTextLog
Definition: PopConSourceHandler.h:168
RunSummaryHandler::~RunSummaryHandler
~RunSummaryHandler() override
Definition: RunSummaryHandler.cc:20
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