29 return std::make_pair(
run,
lumi);
57 m_condDb(iConfig.getParameter<
std::
string>(
"conditionDatabase")),
58 m_tagName(iConfig.getParameter<
std::
string>(
"tagName")),
59 m_startTime(iConfig.getParameter<unsigned long long>(
"startIOV")),
60 m_endTime(iConfig.getParameter<unsigned long long>(
"endIOV")),
61 m_output(iConfig.getParameter<
std::
string>(
"output")),
62 m_verbose(iConfig.getParameter<
bool>(
"verbose")) {
70 if (startIov > endIov)
72 edm::LogInfo(
"BeamSpotRcdPrinter") <<
"[BeamSpotRcdPrinter::" << __func__ <<
"] " 73 <<
"Set start time " << startIov <<
"\n ... Set end time " << endIov;
76 edm::LogInfo(
"BeamSpotRcdPrinter") <<
"[BeamSpotRcdPrinter::" << __func__ <<
"] " 77 <<
"Query the condition database " <<
m_condDb;
83 std::vector<cond::Time_t> vTime;
86 edm::LogInfo(
"BeamSpotRcdPrinter") <<
"[BeamSpotRcdPrinter::" << __func__ <<
"] " 90 auto iiov = iovs.
find(startIov);
91 auto eiov = iovs.find(endIov);
93 while (iiov != iovs.end() && (*iiov).since <= (*eiov).since) {
95 if ((*iiov).since < startIov) {
96 vTime.push_back(startIov);
98 vTime.push_back((*iiov).since);
103 ss << runLS.first <<
"," << runLS.second <<
" (" << (*iiov).since <<
")" 104 <<
" [hash: " << (*iiov).payloadId <<
"] \n" 111 vTime.push_back(endIov);
113 edm::LogInfo(
"BeamSpotRcdPrinter") <<
"[BeamSpotRcdPrinter::" << __func__ <<
"] " 114 <<
"Read " << niov <<
" IOVs from tag " <<
m_tagName 115 <<
" corresponding to the specified time interval.\n\n" 130 desc.add<
std::string>(
"conditionDatabase",
"frontier://FrontierProd/CMS_CONDITIONS");
131 desc.add<
std::string>(
"tagName",
"BeamSpotObjects_PCL_byLumi_v0_prompt");
132 desc.add<
unsigned long long>(
"startIOV", 1406859487478481);
133 desc.add<
unsigned long long>(
"endIOV", 1406876667347162);
134 desc.add<
std::string>(
"output",
"summary.txt")->setComment(
"ASCII file with the full tag dump information");
135 desc.add<
bool>(
"verbose",
true)->setComment(
"print to screen the dump of all the payloads");
140 descDBParameters.addUntracked<
int>(
"authenticationSystem", 0);
141 descDBParameters.addUntracked<
std::string>(
"security",
"");
142 descDBParameters.addUntracked<
int>(
"messageLevel", 0);
145 descriptions.
add(
"BeamSpotRcdPrinter",
desc);
~BeamSpotRcdPrinter() override=default
T getParameter(std::string const &) const
BeamSpotRcdPrinter(const edm::ParameterSet &iConfig)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void start(bool readOnly=true)
const Time_t kLowMask(0xFFFFFFFF)
std::unique_ptr< T > fetchPayload(const cond::Hash &payloadHash)
cond::persistency::ConnectionPool m_connectionPool
Transaction & transaction()
void setParameters(const edm::ParameterSet &connectionPset)
unsigned long long Time_t
unsigned long long m_startTime
Session createSession(const std::string &connectionString, bool writeCapable=false)
#define DEFINE_FWK_MODULE(type)
Iterator find(cond::Time_t time) const
unsigned long long m_endTime
IOVProxy readIov(const std::string &tag)
Log< level::Info, false > LogInfo
void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)