CMS 3D CMS Logo

hcalDeleteObject.cc File Reference

#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h"
#include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
#include "Geometry/CaloTopology/interface/HcalTopology.h"
#include "CondCore/IOVService/interface/IOV.h"
#include "CalibCalorimetry/HcalAlgos/interface/HcalDbHardcode.h"
#include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h"
#include "CalibCalorimetry/HcalAlgos/interface/HcalDbXml.h"
#include "CondTools/Hcal/interface/HcalDbOnline.h"
#include "CondTools/Hcal/interface/HcalDbTool.h"
#include "CondFormats/HcalObjects/interface/HcalPedestals.h"
#include "CondFormats/HcalObjects/interface/HcalPedestalWidths.h"
#include "CondFormats/HcalObjects/interface/HcalGains.h"
#include "CondFormats/HcalObjects/interface/HcalGainWidths.h"
#include "CondFormats/HcalObjects/interface/HcalElectronicsMap.h"
#include "CondFormats/HcalObjects/interface/HcalChannelQuality.h"
#include "CondFormats/HcalObjects/interface/HcalQIEData.h"
#include "CondFormats/HcalObjects/interface/HcalCalibrationQIEData.h"

Go to the source code of this file.

Classes

class  Args

Typedefs

typedef std::map< IOVRun,
std::string > 
IOVCollection
typedef HcalDbTool::IOVRun IOVRun

Functions

template<class T>
bool deleteObject (T *fObject, const std::string &fInput, const std::string &fInputTag, HcalDbTool::IOVRun fInputRun, bool fVerbose)
int main (int argn, char *argv[])
void printHelp (const Args &args)


Typedef Documentation

typedef std::map<IOVRun,std::string> IOVCollection

Definition at line 38 of file hcalDeleteObject.cc.

typedef HcalDbTool::IOVRun IOVRun

Definition at line 37 of file hcalDeleteObject.cc.


Function Documentation

template<class T>
bool deleteObject ( T *  fObject,
const std::string &  fInput,
const std::string &  fInputTag,
HcalDbTool::IOVRun  fInputRun,
bool  fVerbose 
) [inline]

Definition at line 74 of file hcalDeleteObject.cc.

Referenced by main().

00075                                                                                                                                       {
00076   HcalDbTool poolDb (fInput, fVerbose);
00077   return poolDb.deleteObject (fObject, fInputTag, fInputRun);
00078 }

int main ( int  argn,
char *  argv[] 
)

Definition at line 80 of file hcalDeleteObject.cc.

References Args::arguments(), Args::defineOption(), Args::defineParameter(), deleteObject(), Args::getParameter(), iggi_31X_cfg::input, Args::optionIsSet(), Args::parse(), and printHelp().

00080                                    {
00081 
00082   Args args;
00083   args.defineParameter ("-db", "DB connection string, POOL format");
00084   args.defineParameter ("-run", "run # for which constands should be deleted");
00085   args.defineParameter ("-tag", "tag for the input constants set");
00086   args.defineOption ("-verbose", "makes program verbose");
00087   
00088   args.parse (argn, argv);
00089   
00090   std::vector<std::string> arguments = args.arguments ();
00091 
00092   if (arguments.size () < 1 || args.optionIsSet ("-help")) {
00093     printHelp (args);
00094     return -1;
00095   }
00096 
00097   std::string input = args.getParameter ("-db");
00098   
00099   unsigned inputRun = args.getParameter ("-run").empty () ? 0 : strtoull (args.getParameter ("-run").c_str (), 0, 0);
00100   std::string inputTag = args.getParameter ("-tag");
00101 
00102   bool verbose = args.optionIsSet ("-verbose");
00103 
00104 
00105   std::string what = arguments [0];
00106 
00107   if (what == "pedestals") {
00108     HcalPedestals* object = 0;
00109     deleteObject (object, input, inputTag, inputRun, verbose);
00110   }
00111   else if (what == "gains") {
00112     HcalGains* object = 0;
00113   }
00114   else if (what == "pwidths") {
00115     HcalPedestalWidths* object = 0;
00116   }
00117   else if (what == "gwidths") {
00118     HcalGainWidths* object = 0;
00119   }
00120   else if (what == "emap") {
00121     HcalElectronicsMap* object = 0;
00122   }
00123   else if (what == "qie") {
00124     HcalQIEData* object = 0;
00125   }
00126   else if (what == "calibqie") {
00127     HcalCalibrationQIEData* object = 0;
00128   }
00129 }

void printHelp ( const Args args  ) 

Definition at line 62 of file hcalDeleteObject.cc.

References Args::command(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and Args::printOptionsHelp().

00062                                   {
00063   char buffer [1024];
00064   std::cout << "Tool to delete object from Hcal Calibrations" << std::endl;
00065   std::cout << "CAUTION: Could cause inconsistency for running jobs using DB" << std::endl;
00066   std::cout << "    feedback -> ratnikov@fnal.gov" << std::endl;
00067   std::cout << "Use:" << std::endl;
00068   sprintf (buffer, " %s <what> <options> <parameters>\n", args.command ().c_str());
00069   std::cout << buffer;
00070   std::cout << "  where <what> is: \n    pedestals\n    gains\n    pwidths\n    gwidths\n    emap\n    qie\n    calibqie" << std::endl;
00071   args.printOptionsHelp ();
00072 }


Generated on Tue Jun 9 17:51:44 2009 for CMSSW by  doxygen 1.5.4