17 #include "CondCore/IOVService/interface/IOV.h"
23 #include "CondTools/Hcal/interface/HcalDbOnline.h"
24 #include "CondTools/Hcal/interface/HcalDbTool.h"
47 void parse (
int nArgs,
char* fArgs []);
50 std::vector<std::string>
arguments ()
const;
57 std::vector <std::string>
mArgs;
58 std::map <std::string, std::string>
mParsed;
64 std::cout <<
"Tool to delete object from Hcal Calibrations" << std::endl;
65 std::cout <<
"CAUTION: Could cause inconsistency for running jobs using DB" << std::endl;
66 std::cout <<
" feedback -> ratnikov@fnal.gov" << std::endl;
68 sprintf (buffer,
" %s <what> <options> <parameters>\n", args.
command ().c_str());
70 std::cout <<
" where <what> is: \n pedestals\n gains\n pwidths\n gwidths\n emap\n qie\n calibqie" << std::endl;
76 HcalDbTool poolDb (fInput, fVerbose);
77 return poolDb.deleteObject (fObject, fInputTag, fInputRun);
84 args.
defineParameter (
"-run",
"run # for which constands should be deleted");
88 args.
parse (argn, argv);
90 std::vector<std::string> arguments = args.
arguments ();
92 if (arguments.size () < 1 || args.
optionIsSet (
"-help")) {
107 if (what ==
"pedestals") {
109 deleteObject (
object, input, inputTag, inputRun, verbose);
111 else if (what ==
"gains") {
114 else if (what ==
"pwidths") {
117 else if (what ==
"gwidths") {
120 else if (what ==
"emap") {
123 else if (what ==
"qie") {
126 else if (what ==
"calibqie") {
144 if (nArgs <= 0)
return;
147 while (++iarg < nArgs) {
149 if (arg [0] !=
'-')
mArgs.push_back (arg);
156 std::cerr <<
"ERROR: Parameter " << arg <<
" has no value specified. Ignore parameter." << std::endl;
172 sprintf (buffer,
" %-8s <value> : %s", (
mParameters [i]).c_str(), comment.c_str());
177 std::map<std::string, std::string>::const_iterator it =
mComments.find (
mOptions [
i]);
179 sprintf (buffer,
" %-8s : %s", (
mOptions [i]).c_str(), comment.c_str());
void defineOption(const std::string &fOption, const std::string &fComment="")
std::map< std::string, std::string > mComments
std::vector< std::string > arguments() const
std::vector< std::string > mOptions
std::map< IOVRun, std::string > IOVCollection
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static std::string const input
int main(int argc, char **argv)
std::vector< std::string > mParameters
std::vector< std::string > mArgs
void printOptionsHelp() const
void parse(int nArgs, char *fArgs[])
void printHelp(const Args &args)
std::string command() const
HcalDbTool::IOVRun IOVRun
std::map< std::string, std::string > mParsed
bool deleteObject(T *fObject, const std::string &fInput, const std::string &fInputTag, HcalDbTool::IOVRun fInputRun, bool fVerbose)
void defineParameter(const std::string &fParameter, const std::string &fComment="")
bool optionIsSet(const std::string &fOption) const
std::string getParameter(const std::string &fKey)