#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include "CondCore/IOVService/interface/IOV.h"
#include "CondTools/Hcal/interface/HcalDbTool.h"
#include "CondTools/Hcal/interface/HcalDbOnline.h"
Go to the source code of this file.
|
int | main (int argn, char *argv[]) |
|
void | printHelp (const Args &args) |
|
void | printRuns (const std::string &fDb, const std::string fTag, bool fVerbose) |
|
void | printTags (const std::string &fDb, bool fVerbose) |
|
int main |
( |
int |
argn, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 112 of file hcalIovTool.cc.
References harvestRelVal::args, Args::arguments(), gather_cfg::cout, EcalCondDB::db, Args::defineOption(), Args::defineParameter(), Args::getParameter(), Args::optionIsSet(), Args::parse(), printHelp(), printRuns(), printTags(), and GlobalPosition_Frontier_DevDB_cff::tag.
115 args.
defineParameter (
"-db",
"DB connection string, POOL format, or online format");
122 std::vector<std::string> arguments = args.
arguments ();
124 if (arguments.size () < 1 || args.
optionIsSet (
"-help")) {
133 std::string what = arguments [0];
138 else if (what ==
"iov") {
141 std::cout <<
"Program has completed successfully" << std::endl;
void defineOption(const std::string &fOption, const std::string &fComment="")
std::vector< std::string > arguments() const
void parse(int nArgs, char *fArgs[])
void printHelp(const Args &args)
void defineParameter(const std::string &fParameter, const std::string &fComment="")
bool optionIsSet(const std::string &fOption) const
std::string getParameter(const std::string &fKey)
void printHelp |
( |
const Args & |
args | ) |
|
void printRuns |
( |
const std::string & |
fDb, |
|
|
const std::string |
fTag, |
|
|
bool |
fVerbose |
|
) |
| |
Definition at line 90 of file hcalIovTool.cc.
References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, dbFile(), HcalDbOnline::getIOVs(), i, o2o::iov, and onlineFile().
Referenced by main().
91 std::vector <IntervalOV> allIOVs;
93 HcalDbTool poolDb (fDb, fVerbose);
95 if (poolDb.getObject (&iov, fTag)) {
96 allIOVs = allIOV (iov);
97 std::cout <<
"IOVs available for tag " << fTag <<
" in CMS POOL DB instance: " << fDb << std::endl;
100 std::cerr <<
"printRuns-> can not find IOV for tag " << fTag << std::endl;
105 allIOVs = onlineDb.getIOVs (fTag);
107 for (
unsigned i = 0;
i < allIOVs.size();
i++) {
108 std::cout <<
"[ " << allIOVs[
i].first <<
" ... " << allIOVs[
i].second <<
" )" << std::endl;
Gather conditions data from online DB.
bool dbFile(const std::string fParam)
bool onlineFile(const std::string fParam)
void printTags |
( |
const std::string & |
fDb, |
|
|
bool |
fVerbose |
|
) |
| |
Definition at line 73 of file hcalIovTool.cc.
References gather_cfg::cout, dbFile(), i, HcalDbOnline::metadataAllTags(), and onlineFile().
Referenced by main().
74 std::vector<std::string> allTags;
76 HcalDbTool poolDb (fDb, fVerbose);
77 allTags = poolDb.metadataAllTags ();
78 std::cout <<
"Tags available in CMS POOL DB instance: " << fDb << std::endl;
82 allTags = onlineDb.metadataAllTags ();
83 std::cout <<
"Tags available in HCAL master DB instance: " << fDb << std::endl;
85 for (
unsigned i = 0;
i < allTags.size();
i++) {
Gather conditions data from online DB.
bool dbFile(const std::string fParam)
bool onlineFile(const std::string fParam)