CMS 3D CMS Logo

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 () override
 
std::string id () const override
 
 RunInfoHandler (const edm::ParameterSet &pset)
 
 ~RunInfoHandler () override
 
- 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

edm::ParameterSet m_connectionPset
 
std::string m_connectionString
 
std::string m_dcsenv_schema
 
std::string m_name
 
std::string m_runinfo_schema
 
unsigned long long m_since
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< RunInfo >
typedef std::vector< Triplet > Container
 
typedef std::vector< std::pair< RunInfo *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< RunInfoself
 
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)
 
cond::persistency::SessiondbSession () const
 
- 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::~RunInfoHandler ( )
override

Definition at line 16 of file RunInfoHandler.cc.

16 {}

◆ RunInfoHandler()

RunInfoHandler::RunInfoHandler ( const edm::ParameterSet pset)

Definition at line 8 of file RunInfoHandler.cc.

9  : m_since(pset.getParameter<unsigned long long>("runNumber")),
10  m_name(pset.getUntrackedParameter<std::string>("name", "RunInfoHandler")),
11  m_runinfo_schema(pset.getUntrackedParameter<std::string>("RunInfoSchema", "CMS_RUNINFO")),
12  m_dcsenv_schema(pset.getUntrackedParameter<std::string>("DCSEnvSchema", "CMS_DCS_ENV_PVSS_COND")),
13  m_connectionString(pset.getParameter<std::string>("connect")),
14  m_connectionPset(pset.getParameter<edm::ParameterSet>("DBParameters")) {}

Member Function Documentation

◆ getNewObjects()

void RunInfoHandler::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< RunInfo >.

Definition at line 18 of file RunInfoHandler.cc.

18  {
19  //check whats already inside of database
20  edm::LogInfo("RunInfoHandler") << "["
21  << "RunInfoHandler::" << __func__ << "]:" << m_name << ": "
22  << "Destination Tag Info: name " << tagInfo().name << ", size " << tagInfo().size
23  << ", last object valid since " << tagInfo().lastInterval.since << ", hash "
24  << tagInfo().lastInterval.payloadId << std::endl;
25  edm::LogInfo("RunInfoHandler") << "["
26  << "RunInfoHandler::" << __func__ << "]:" << m_name
27  << ": runnumber/first since = " << m_since << std::endl;
28 
29  //check if a transfer is needed:
30  //if the new run number is smaller than or equal to the latest IOV, exit.
31  //This is needed as now the IOV Editor does not always protect for insertions:
32  //ANY and VALIDATION sychronizations are allowed to write in the past.
33  if (tagInfo().size > 0 && tagInfo().lastInterval.since >= m_since) {
34  edm::LogWarning("RunInfoHandler") << "["
35  << "RunInfoHandler::" << __func__ << "]:" << m_name << ": "
36  << "last IOV " << tagInfo().lastInterval.since
37  << (tagInfo().lastInterval.since == m_since ? " is equal to" : " is larger than")
38  << " the run proposed for insertion " << m_since << ". No transfer needed."
39  << std::endl;
40  return;
41  }
42 
43  RunInfo* r = new RunInfo();
44 
45  //fill with null runinfo if empty run are found beetween the two last valid ones
46  size_t n_empty_run = 0;
47  if (tagInfo().size > 0 && (tagInfo().lastInterval.since + 1) < m_since) {
48  n_empty_run = m_since - tagInfo().lastInterval.since - 1;
49  edm::LogInfo("RunInfoHandler") << "["
50  << "RunInfoHandler::" << __func__ << "]:" << m_name << ": "
51  << "entering fake run from " << tagInfo().lastInterval.since + 1 << " to "
52  << m_since - 1 << std::endl;
53  }
54  std::ostringstream ss;
55  // transfer fake run for 1 to since for the first time
56  if (tagInfo().size == 0 && m_since != 1) {
57  m_to_transfer.push_back(std::make_pair((RunInfo*)(r->Fake_RunInfo()), 1));
58  ss << "fake run number: " << 1 << ", ";
59  }
60  if (n_empty_run != 0) {
61  m_to_transfer.push_back(std::make_pair((RunInfo*)(r->Fake_RunInfo()), tagInfo().lastInterval.since + 1));
62  ss << "fake run number: " << tagInfo().lastInterval.since + 1 << ", ";
63  }
64 
65  //reading from omds
67  *r = rn.readData(m_runinfo_schema, m_dcsenv_schema, (int)m_since);
68  m_to_transfer.push_back(std::make_pair((RunInfo*)r, m_since));
69  ss << "run number: " << m_since << ";";
70  m_userTextLog = ss.str();
71  edm::LogInfo("RunInfoHandler") << "["
72  << "RunInfoHandler::" << __func__ << "]:" << m_name << ": END." << std::endl;
73  // update runinfo table in conditions db
74  RunInfoUpdate updater(dbSession());
75  updater.appendNewRun(*r);
76 }

References RunInfoUpdate::appendNewRun(), popcon::PopConSourceHandler< RunInfo >::dbSession(), cond::TagInfo_t::lastInterval, m_connectionPset, m_connectionString, m_dcsenv_schema, m_name, m_runinfo_schema, m_since, popcon::PopConSourceHandler< RunInfo >::m_to_transfer, popcon::PopConSourceHandler< RunInfo >::m_userTextLog, cond::TagInfo_t::name, cond::Iov_t::payloadId, alignCSCRings::r, RunInfoRead::readData(), cond::Iov_t::since, cond::TagInfo_t::size, findQualityFiles::size, contentValuesCheck::ss, and popcon::PopConSourceHandler< RunInfo >::tagInfo().

◆ id()

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

Implements popcon::PopConSourceHandler< RunInfo >.

Definition at line 13 of file RunInfoHandler.h.

13 { return m_name; }

References m_name.

Member Data Documentation

◆ m_connectionPset

edm::ParameterSet RunInfoHandler::m_connectionPset
private

Definition at line 25 of file RunInfoHandler.h.

Referenced by getNewObjects().

◆ m_connectionString

std::string RunInfoHandler::m_connectionString
private

Definition at line 24 of file RunInfoHandler.h.

Referenced by getNewObjects().

◆ m_dcsenv_schema

std::string RunInfoHandler::m_dcsenv_schema
private

Definition at line 23 of file RunInfoHandler.h.

Referenced by getNewObjects().

◆ m_name

std::string RunInfoHandler::m_name
private

Definition at line 19 of file RunInfoHandler.h.

Referenced by getNewObjects(), and id().

◆ m_runinfo_schema

std::string RunInfoHandler::m_runinfo_schema
private

Definition at line 22 of file RunInfoHandler.h.

Referenced by getNewObjects().

◆ m_since

unsigned long long RunInfoHandler::m_since
private

Definition at line 18 of file RunInfoHandler.h.

Referenced by getNewObjects().

popcon::PopConSourceHandler< RunInfo >::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
popcon::PopConSourceHandler< RunInfo >::dbSession
cond::persistency::Session & dbSession() const
Definition: PopConSourceHandler.h:144
RunInfoHandler::m_since
unsigned long long m_since
Definition: RunInfoHandler.h:18
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
cond::TagInfo_t::name
std::string name
Definition: Types.h:72
RunInfoHandler::m_connectionPset
edm::ParameterSet m_connectionPset
Definition: RunInfoHandler.h:25
RunInfoHandler::m_runinfo_schema
std::string m_runinfo_schema
Definition: RunInfoHandler.h:22
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
RunInfo
Definition: RunInfo.h:18
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
popcon::PopConSourceHandler< RunInfo >::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
RunInfoUpdate
Definition: RunInfoUpdate.h:12
RunInfoHandler::m_connectionString
std::string m_connectionString
Definition: RunInfoHandler.h:24
alignCSCRings.r
r
Definition: alignCSCRings.py:93
cond::TagInfo_t::lastInterval
Iov_t lastInterval
Definition: Types.h:73
RunInfoHandler::m_name
std::string m_name
Definition: RunInfoHandler.h:19
RunInfoRead
Definition: RunInfoRead.h:8
RunInfoHandler::m_dcsenv_schema
std::string m_dcsenv_schema
Definition: RunInfoHandler.h:23
popcon::PopConSourceHandler< RunInfo >::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