CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
hcalCalibrationsCopy.cc
Go to the documentation of this file.
1 #include <stdlib.h>
2 
3 #include <iostream>
4 #include <fstream>
5 #include <sstream>
6 #include <vector>
7 #include <map>
8 #include <algorithm>
9 #include <string>
10 
11 // other
16 
17 
18 #include "CondCore/IOVService/interface/IOV.h"
19 
20 // Hcal calibrations
24 #include "CondTools/Hcal/interface/HcalDbTool.h"
26 //#include "OnlineDB/HcalCondDB/interface/HcalDbPoolOCCI.h"
35 
36 // CMSSW Message service
38 
39 //using namespace cms;
40 
41 
43 typedef std::map<IOVRun,std::string> IOVCollection;
44 
45 
46 class Args {
47  public:
48  Args () {};
49  ~Args () {};
50  void defineOption (const std::string& fOption, const std::string& fComment = "");
51  void defineParameter (const std::string& fParameter, const std::string& fComment = "");
52  void parse (int nArgs, char* fArgs []);
53  void printOptionsHelp () const;
54  std::string command () const;
55  std::vector<std::string> arguments () const;
56  bool optionIsSet (const std::string& fOption) const;
57  std::string getParameter (const std::string& fKey);
58  private:
60  std::vector <std::string> mOptions;
61  std::vector <std::string> mParameters;
62  std::vector <std::string> mArgs;
63  std::map <std::string, std::string> mParsed;
64  std::map <std::string, std::string> mComments;
65 };
66 
67 template <class T>
68 std::vector<HcalDetId> undefinedCells (const T& fData) {
69  static std::vector<HcalDetId> result;
70  if (result.size () <= 0) {
72  for (int eta = -63; eta < 64; eta++) {
73  for (int phi = 0; phi < 128; phi++) {
74  for (int depth = 1; depth < 5; depth++) {
75  for (int det = 1; det < 5; det++) {
76  HcalDetId cell ((HcalSubdetector) det, eta, phi, depth);
77  try {
78  fData.getValues (cell);
79  }
80  catch (...) {
81  if (topology.valid(cell)) result.push_back (cell);
82  }
83  }
84  }
85  }
86  }
87  }
88  return result;
89 }
90 
91 void fillDefaults (HcalPedestals*& fPedestals) {
92  if (!fPedestals) {
93  fPedestals = new HcalPedestals;
94  fPedestals->sort ();
95  }
96  std::vector<HcalDetId> cells = undefinedCells (*fPedestals);
97  for (std::vector <HcalDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
98  HcalPedestal item = HcalDbHardcode::makePedestal (*cell, false); // do not smear
99  fPedestals->addValue (*cell, item.getValues ());
100  }
101  fPedestals->sort ();
102 }
103 
104 void fillDefaults (HcalPedestalWidths*& fPedestals) {
105  if (!fPedestals) {
106  fPedestals = new HcalPedestalWidths;
107  fPedestals->sort ();
108  }
109  std::vector<HcalDetId> cells = undefinedCells (*fPedestals);
110  for (std::vector <HcalDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
112  fPedestals->setWidth (item);
113  }
114  fPedestals->sort ();
115 }
116 
117 void fillDefaults (HcalGains*& fGains) {
118  if (!fGains) {
119  fGains = new HcalGains;
120  fGains->sort ();
121  }
122  std::vector<HcalDetId> cells = undefinedCells (*fGains);
123  for (std::vector <HcalDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
124  HcalGain item = HcalDbHardcode::makeGain (*cell, false); // do not smear
125  fGains->addValue (*cell, item.getValues ());
126  }
127  fGains->sort ();
128 }
129 
130 void fillDefaults (HcalGainWidths*& fGains) {
131  if (!fGains) {
132  fGains = new HcalGainWidths;
133  fGains->sort ();
134  }
135  std::vector<HcalDetId> cells = undefinedCells (*fGains);
136  for (std::vector <HcalDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
138  fGains->addValue (*cell, item.getValues ());
139  }
140  fGains->sort ();
141 }
142 
144  if (!fMap) {
145  fMap = new HcalElectronicsMap;
146  fMap->sort ();
147  }
148  std::cerr << "Warning: fillDefaults (HcalElectronicsMap* fMap) is not implemented. Ignore." << std::endl;
149 }
150 
151 void fillDefaults (HcalQIEData*& fObject) {
152  if (!fObject) {
153  fObject = new HcalQIEData;
154  fObject->sort ();
155  }
157  for (int eta = -63; eta < 64; eta++) {
158  for (int phi = 0; phi < 128; phi++) {
159  for (int depth = 1; depth < 5; depth++) {
160  for (int det = 1; det < 5; det++) {
161  HcalDetId cell ((HcalSubdetector) det, eta, phi, depth);
162  if (topology.valid(cell)) {
164  fObject->addCoder (item);
165  }
166  }
167  }
168  }
169  }
170  fObject->sort ();
171 }
172 
174  if (!fObject) {
175  fObject = new HcalCalibrationQIEData;
176  fObject->sort ();
177  }
179  for (int eta = -63; eta < 64; eta++) {
180  for (int phi = 0; phi < 128; phi++) {
181  for (int depth = 1; depth < 5; depth++) {
182  for (int det = 1; det < 5; det++) {
183  HcalDetId cell ((HcalSubdetector) det, eta, phi, depth);
184  if (topology.valid(cell)) {
186  fObject->addCoder (item);
187  }
188  }
189  }
190  }
191  }
192  fObject->sort ();
193 }
194 
195 void printHelp (const Args& args) {
196  char buffer [1024];
197  std::cout << "Tool to manipulate by Hcal Calibrations" << std::endl;
198  std::cout << " feedback -> ratnikov@fnal.gov" << std::endl;
199  std::cout << "Use:" << std::endl;
200  sprintf (buffer, " %s <what> <options> <parameters>\n", args.command ().c_str());
201  std::cout << buffer;
202  std::cout << " where <what> is: \n pedestals\n gains\n pwidths\n gwidths\n emap\n qie\n calibqie" << std::endl;
203  args.printOptionsHelp ();
204 }
205 
206 bool defaultsFile (const std::string fParam) {
207  return fParam == "defaults";
208 }
209 
210 bool asciiFile (const std::string fParam) {
211  return fParam.find (':') == std::string::npos && std::string (fParam, fParam.length () - 4) == ".txt";
212 }
213 
214 bool xmlFile (const std::string fParam) {
215  return fParam.find (':') == std::string::npos && std::string (fParam, fParam.length () - 4) == ".xml";
216 }
217 
218 bool dbFile (const std::string fParam) {
219  return fParam.find (':') != std::string::npos;
220 }
221 
222 bool occiFile (const std::string fParam) {
223  return fParam.find ("cms_val_lb.cern.ch") != std::string::npos &&
224  fParam.find (':') == std::string::npos;
225 }
226 
227 bool onlineFile (const std::string fParam) {
228  return fParam.find ('@') != std::string::npos &&
229  fParam.find ("cms_val_lb") == std::string::npos;
230 }
231 
232 template <class T> bool copyObject (T* fObject,
233  const std::string& fInput, const std::string& fInputTag, HcalDbTool::IOVRun fInputRun,
234  const std::string& fOutput, const std::string& fOutputTag, HcalDbTool::IOVRun fOutputRun,
235  bool fAppend,
236  unsigned long long fIovgmtbegin, unsigned long long fIovgmtend,
237  unsigned fNread, unsigned fNwrite, unsigned fNtrace,
238  bool fVerbose,
239  const char* fInputCatalog, const char* fOutputCatalog, bool fXmlAuth
240  ) {
241  typedef std::vector <std::pair<HcalDbTool::IOVRun, T*> > Objects;
242 
243  bool result = false;
244  time_t t0 = time (0);
245  time_t t1 = t0;
246  unsigned traceCounter = 0;
247  HcalDbTool* poolDb = 0;
248  HcalDbOnline* onlineDb = 0;
249  // HcalDbToolOCCI* occiDb = 0;
250  Objects allInstances;
251  while (traceCounter < fNread) {
252  delete fObject;
253  // get input
254  if (defaultsFile (fInput)) {
255  if (!traceCounter) std::cout << "USE INPUT: defaults" << std::endl;
256  fillDefaults (fObject);
257  result = true;
258  }
259  else if (asciiFile (fInput)) {
260  if (!traceCounter) std::cout << "USE INPUT: ASCII: " << fInput << std::endl;
261  std::ifstream inStream (fInput.c_str ());
262  fObject = new T;
263  HcalDbASCIIIO::getObject (inStream, fObject);
264  result = true;
265  }
266  else if (dbFile (fInput)) {
267  if (!traceCounter) std::cout << "USE INPUT: Pool: " << fInput << "/" << fInputRun << std::endl;
268  if (!poolDb) poolDb = new HcalDbTool (fInput, fVerbose, fXmlAuth, fInputCatalog);
269  if (fInputRun > 0) {
270  fObject = new T;
271  result = poolDb->getObject (fObject, fInputTag, fInputRun);
272  }
273  else { // copy all instances
274  std::cout << "Copy all instances... " << std::endl;
275  cond::IOV iov;
276  if (poolDb->getObject (&iov, fInputTag)) {
277  IOVCollection::const_iterator iovi = iov.iov.begin ();
278  for (; iovi != iov.iov.end (); iovi++) {
279  IOVRun iovMax = iovi->first;
280  if (fVerbose) {
281  std::cout << "fetching object for run " << iovMax << std::endl;
282  }
283  T* object = new T;
284  if (!poolDb->getObject (object, fInputTag, iovMax)) {
285  std::cerr << "Failed to fetch object..." << std::endl;
286  result = false;
287  delete object;
288  break;
289  }
290  allInstances.push_back (std::make_pair (iovMax, object));
291  std::cerr << '.';
292  }
293  if (iovi == iov.iov.end ()) result = true;
294  }
295  else {
296  std::cerr << "can not find IOV for tag " << fInputTag << std::endl;
297  result = false;
298  }
299  }
300  }
301  else if (onlineFile (fInput)) {
302  if (!traceCounter) std::cout << "USE INPUT: Online: " << fInput << std::endl;
303  if (!onlineDb) onlineDb = new HcalDbOnline (fInput, fVerbose);
304  if (fInputRun > 0) {
305  fObject = new T;
306  result = onlineDb->getObject (fObject, fInputTag, fInputRun);
307  }
308  else { // copy all instances
309  std::cout << "Copy all instances... " << std::endl;
310  std::vector<HcalDbOnline::IntervalOV> iovs = onlineDb->getIOVs (fInputTag);
311  for (unsigned i = 0; i < iovs.size ();i++) {
312  IOVRun iovMin = iovs[i].first;
313  if (fVerbose) {
314  std::cout << "fetching object for run " << iovMin << std::endl;
315  }
316  T* object = new T;
317  if (!onlineDb->getObject (object, fInputTag, iovMin)) {
318  std::cerr << "Failed to fetch object..." << std::endl;
319  result = false;
320  delete object;
321  break;
322  }
323  allInstances.push_back (std::make_pair (iovMin, object));
324  std::cerr << '.';
325  }
326  result = true;
327  }
328  }
329  // else if (occiFile (fInput)) {
330 // if (!traceCounter) std::cout << "USE INPUT: OCCI" << std::endl;
331 // if (!occiDb) occiDb = new HcalDbPoolOCCI (fInput);
332 // fObject = new T;
333 // result = occiDb->getObject (fObject, fInputTag, fInputRun);
334 // }
335  traceCounter++;
336  fInputRun++;
337  if (fNtrace && !(traceCounter % fNtrace)) {
338  time_t t = time (0);
339  std::cout << "read transaction: " << traceCounter << " time: " << t - t0 << " dtime: " << t - t1 << std::endl;
340  t1 = t;
341  }
342  }
343  delete poolDb;
344  delete onlineDb;
345  poolDb = 0;
346  onlineDb = 0;
347  if (result) {
348  t0 = time (0);
349  t1 = t0;
350  traceCounter = 0;
351  T* object = 0;
352  while (traceCounter < fNwrite) {
353  delete object;
354  object = fObject ? new T (*fObject) : 0; // copy original object
355  if (asciiFile (fOutput)) {
356  if (!traceCounter) std::cout << "USE OUTPUT: ASCII: " << fOutput << std::endl;
357  if (fObject && allInstances.empty ()) {
358  std::ofstream outStream (fOutput.c_str ());
359  HcalDbASCIIIO::dumpObject (outStream, *object);
360  }
361  else {
362  for (unsigned i = 0; i < allInstances.size (); i++) {
363  if (fVerbose) {
364  std::cout << "Storing object for run " << allInstances[i].first << std::endl;
365  }
366  std::ostringstream outName;
367  unsigned ipos = fOutput.find (".txt");
368  if (ipos == std::string::npos) {
369  outName << fOutput << "_" << allInstances[i].first;
370  }
371  else {
372  outName << std::string (fOutput, 0, ipos) << "_" << allInstances[i].first << ".txt";
373  }
374  std::ofstream outStream (outName.str().c_str ());
375  object = allInstances[i].second;
376  HcalDbASCIIIO::dumpObject (outStream, *object);
377  delete object;
378  allInstances[i].second = 0;
379  std::cerr << '.';
380  }
381  }
382  }
383  else if (xmlFile (fOutput)) {
384  if (!traceCounter) std::cout << "USE OUTPUT: XML: " << fOutput << std::endl;
385  std::ofstream outStream (fOutput.c_str ());
386  HcalDbXml::dumpObject (outStream, fOutputRun, fIovgmtbegin, fIovgmtend, fOutputTag, *object);
387  outStream.close ();
388  std::cout << "close file\n";
389  }
390  else if (dbFile (fOutput)) { //POOL
391  if (!traceCounter) std::cout << "USE OUTPUT: Pool: " << fOutput << '/' << fOutputRun << std::endl;
392  if (!poolDb) poolDb = new HcalDbTool (fOutput, fVerbose, fXmlAuth, fOutputCatalog);
393  if (fOutputRun > 0) {
394  poolDb->putObject (object, fOutputTag, fOutputRun, fAppend);
395  object = 0; // owned by POOL
396  }
397  else {
398  for (unsigned i = 0; i < allInstances.size (); i++) {
399  if (fVerbose) {
400  std::cout << "Storing object for run " << allInstances[i].first << std::endl;
401  }
402  poolDb->putObject (allInstances[i].second, fOutputTag, allInstances[i].first, fAppend);
403  allInstances[i].second = 0;
404  std::cerr << '.';
405  }
406  }
407  }
408  traceCounter++;
409  fOutputRun++;
410  if (fNtrace && !(traceCounter % fNtrace)) {
411  time_t t = time (0);
412  std::cout << "write transaction: " << traceCounter << " time: " << t - t0 << " dtime: " << t - t1 << std::endl;
413  t1 = t;
414  }
415  }
416  delete poolDb;
417  poolDb = 0;
418  }
419  return result;
420 }
421 
422 int main (int argn, char* argv []) {
423  // start message service
424  edm::service::MessageServicePresence my_message_service;
425 
426  Args args;
427  args.defineParameter ("-input", "DB connection string, POOL format, or .txt file, or defaults");
428  args.defineParameter ("-output", "DB connection string, POOL format, or .txt, or .xml file");
429  args.defineParameter ("-inputrun", "run # for which constands should be made");
430  args.defineParameter ("-inputtag", "tag for the input constants set");
431  args.defineParameter ("-inputcatalog", "catalog for POOL DB <$POOL_CATALOG>");
432  args.defineParameter ("-outputrun", "run # for which constands should be dumped");
433  args.defineParameter ("-outputtag", "tag for the output constants set");
434  args.defineParameter ("-outputcatalog", "catalog for POOL DB <$POOL_CATALOG>");
435  args.defineParameter ("-iovgmtbegin", "start time for online IOV <outputrun>");
436  args.defineParameter ("-iovgmtend", "end time for online IOV <0>");
437  args.defineParameter ("-nread", "repeat input that many times with increasing run# <1>");
438  args.defineParameter ("-nwrite", "repeat output that many times with increasing run# <1>");
439  args.defineParameter ("-trace", "trace time every that many operations <false>");
440  args.defineOption ("-help", "this help");
441  args.defineOption ("-online", "interpret input DB as an online DB");
442  args.defineOption ("-xmlauth", "use XML authorization <false>");
443  args.defineOption ("-append", "Strip previous IOV, make this IOV open (POOL DB) <false>");
444  args.defineOption ("-verbose", "makes program verbose <false>");
445 
446  args.parse (argn, argv);
447 
448  std::vector<std::string> arguments = args.arguments ();
449 
450  if (arguments.size () < 1 || args.optionIsSet ("-help")) {
451  printHelp (args);
452  return -1;
453  }
454 
455  std::string input = args.getParameter ("-input");
456  std::string output = args.getParameter ("-output");
457 
458  HcalDbTool::IOVRun inputRun = args.getParameter ("-inputrun").empty () ? 0 : strtoull (args.getParameter ("-inputrun").c_str (), 0, 0);
459  HcalDbTool::IOVRun outputRun = args.getParameter ("-outputrun").empty () ? 0 : strtoll (args.getParameter ("-outputrun").c_str (), 0, 0);
460  std::string inputTag = args.getParameter ("-inputtag");
461  std::string outputTag = args.getParameter ("-outputtag");
462 
463  unsigned long long iovgmtbegin = args.getParameter ("-iovgmtbegin").empty () ? outputRun : strtoull (args.getParameter ("-iovgmtbegin").c_str (), 0, 0);
464  unsigned long long iovgmtend = args.getParameter ("-iovgmtend").empty () ? 0 : strtoull (args.getParameter ("-iovgmtend").c_str (), 0, 0);
465 
466  unsigned nread = args.getParameter ("-nread").empty () ? 1 : atoi (args.getParameter ("-nread").c_str ());
467  unsigned nwrite = args.getParameter ("-nwrite").empty () ? 1 : atoi (args.getParameter ("-nwrite").c_str ());
468  unsigned trace = args.getParameter ("-trace").empty () ? 0 : atoi (args.getParameter ("-trace").c_str ());
469 
470  const char* inputCatalog = args.getParameter ("-inputcatalog").empty () ? 0 : args.getParameter ("-inputcatalog").c_str();
471  const char* outputCatalog = args.getParameter ("-outputcatalog").empty () ? 0 : args.getParameter ("-outputcatalog").c_str();
472 
473  bool xmlAuth = args.optionIsSet ("-xmlauth");
474  bool append = args.optionIsSet ("-append");
475 
476  bool verbose = args.optionIsSet ("-verbose");
477 
478 
479  std::string what = arguments [0];
480 
481  if (what == "pedestals") {
482  HcalPedestals* object = 0;
483  copyObject (object, input, inputTag, inputRun, output, outputTag, outputRun, append, iovgmtbegin, iovgmtend, nread, nwrite, trace, verbose, inputCatalog, outputCatalog, xmlAuth);
484  }
485  else if (what == "gains") {
486  HcalGains* object = 0;
487  copyObject (object, input, inputTag, inputRun, output, outputTag, outputRun, append, iovgmtbegin, iovgmtend, nread, nwrite, trace, verbose, inputCatalog, outputCatalog, xmlAuth);
488  }
489  else if (what == "pwidths") {
490  HcalPedestalWidths* object = 0;
491  copyObject (object, input, inputTag, inputRun, output, outputTag, outputRun, append, iovgmtbegin, iovgmtend, nread, nwrite, trace, verbose, inputCatalog, outputCatalog, xmlAuth);
492  }
493  else if (what == "gwidths") {
494  HcalGainWidths* object = 0;
495  copyObject (object, input, inputTag, inputRun, output, outputTag, outputRun, append, iovgmtbegin, iovgmtend, nread, nwrite, trace, verbose, inputCatalog, outputCatalog, xmlAuth);
496  }
497  else if (what == "emap") {
498  HcalElectronicsMap* object = 0;
499  copyObject (object, input, inputTag, inputRun, output, outputTag, outputRun, append, iovgmtbegin, iovgmtend, nread, nwrite, trace, verbose, inputCatalog, outputCatalog, xmlAuth);
500  }
501  else if (what == "qie") {
502  HcalQIEData* object = 0;
503  copyObject (object, input, inputTag, inputRun, output, outputTag, outputRun, append, iovgmtbegin, iovgmtend, nread, nwrite, trace, verbose, inputCatalog, outputCatalog, xmlAuth);
504  }
505  else if (what == "calibqie") {
506  HcalCalibrationQIEData* object = 0;
507  copyObject (object, input, inputTag, inputRun, output, outputTag, outputRun, append, iovgmtbegin, iovgmtend, nread, nwrite, trace, verbose, inputCatalog, outputCatalog, xmlAuth);
508  }
509 }
510 
511 
512 //==================== Args ===== BEGIN ==============================
513 void Args::defineOption (const std::string& fOption, const std::string& fComment) {
514  mOptions.push_back (fOption);
515  mComments [fOption] = fComment;
516 }
517 
518 void Args::defineParameter (const std::string& fParameter, const std::string& fComment) {
519  mParameters.push_back (fParameter);
520  mComments [fParameter] = fComment;
521 }
522 
523 void Args::parse (int nArgs, char* fArgs []) {
524  if (nArgs <= 0) return;
525  mProgramName = std::string (fArgs [0]);
526  int iarg = 0;
527  while (++iarg < nArgs) {
528  std::string arg (fArgs [iarg]);
529  if (arg [0] != '-') mArgs.push_back (arg);
530  else {
531  if (std::find (mOptions.begin(), mOptions.end (), arg) != mOptions.end ()) {
532  mParsed [arg] = "";
533  }
534  if (std::find (mParameters.begin(), mParameters.end (), arg) != mParameters.end ()) {
535  if (iarg >= nArgs) {
536  std::cerr << "ERROR: Parameter " << arg << " has no value specified. Ignore parameter." << std::endl;
537  }
538  else {
539  mParsed [arg] = std::string (fArgs [++iarg]);
540  }
541  }
542  }
543  }
544 }
545 
546 void Args::printOptionsHelp () const {
547  char buffer [1024];
548  std::cout << "Parameters:" << std::endl;
549  for (unsigned i = 0; i < mParameters.size (); i++) {
550  std::map<std::string, std::string>::const_iterator it = mComments.find (mParameters [i]);
551  std::string comment = it != mComments.end () ? it->second : "uncommented";
552  sprintf (buffer, " %-8s <value> : %s", (mParameters [i]).c_str(), comment.c_str());
553  std::cout << buffer << std::endl;
554  }
555  std::cout << "Options:" << std::endl;
556  for (unsigned i = 0; i < mOptions.size (); i++) {
557  std::map<std::string, std::string>::const_iterator it = mComments.find (mOptions [i]);
558  std::string comment = it != mComments.end () ? it->second : "uncommented";
559  sprintf (buffer, " %-8s : %s", (mOptions [i]).c_str(), comment.c_str());
560  std::cout << buffer << std::endl;
561  }
562 }
563 
564 std::string Args::command () const {
565  int ipos = mProgramName.rfind ('/');
566  return std::string (mProgramName, ipos+1);
567 }
568 
569 std::vector<std::string> Args::arguments () const {return mArgs;}
570 
571 bool Args::optionIsSet (const std::string& fOption) const {
572  return mParsed.find (fOption) != mParsed.end ();
573 }
574 
576  if (optionIsSet (fKey)) return mParsed [fKey];
577  return "";
578 }
579 //==================== Args ===== END ==============================
int i
Definition: DBlmapReader.cc:9
void fillDefaults(HcalPedestals *&fPedestals)
std::string mProgramName
void defineOption(const std::string &fOption, const std::string &fComment="")
CaloTopology const * topology(0)
std::map< std::string, std::string > mComments
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
bool defaultsFile(const std::string fParam)
std::vector< std::string > arguments() const
std::vector< std::string > mOptions
bool dumpObject(std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalPedestals &fObject, const HcalPedestalWidths &fError)
Definition: HcalDbXml.cc:168
std::map< IOVRun, std::string > IOVCollection
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
bool copyObject(T *fObject, const std::string &fInput, const std::string &fInputTag, HcalDbTool::IOVRun fInputRun, const std::string &fOutput, const std::string &fOutputTag, HcalDbTool::IOVRun fOutputRun, bool fAppend, unsigned long long fIovgmtbegin, unsigned long long fIovgmtend, unsigned fNread, unsigned fNwrite, unsigned fNtrace, bool fVerbose, const char *fInputCatalog, const char *fOutputCatalog, bool fXmlAuth)
A arg
Definition: Factorize.h:36
HcalCalibrationQIECoder makeCalibrationQIECoder(HcalGenericDetId fId)
bool addCoder(const HcalQIECoder &fCoder)
Definition: HcalQIEData.h:43
const float * getValues() const
get value for all capId = 0..3
Definition: HcalGainWidth.h:19
static std::string const input
Definition: EdmProvDump.cc:44
std::vector< std::string > mParameters
U second(std::pair< T, U > const &p)
HcalQIECoder makeQIECoder(HcalGenericDetId fId)
HcalPedestalWidth makePedestalWidth(HcalGenericDetId fId)
HcalGain makeGain(HcalGenericDetId fId, bool fSmear=false)
tuple iov
Definition: o2o.py:307
bool occiFile(const std::string fParam)
std::vector< IntervalOV > getIOVs(const std::string &fTag)
std::vector< std::string > mArgs
tuple result
Definition: query.py:137
HcalSubdetector
Definition: HcalAssistant.h:31
void printOptionsHelp() const
void parse(int nArgs, char *fArgs[])
Gather conditions data from online DB.
Definition: HcalDbOnline.h:34
const float * getValues() const
get value for all capId = 0..3
Definition: HcalGain.h:20
double trace(const ROOT::Math::SMatrix< double, N, N > &matrix)
bool dbFile(const std::string fParam)
bool getObject(HcalPedestals *fObject, HcalPedestalWidths *fWidths, const std::string &fTag, IOVTime fTime)
void printHelp(const Args &args)
void sort()
Definition: HcalQIEData.h:45
std::string command() const
virtual bool valid(const DetId &id) const
bool xmlFile(const std::string fParam)
Geom::Phi< T > phi() const
HcalGainWidth makeGainWidth(HcalGenericDetId fId)
bool getObject(std::istream &fInput, HcalPedestals *fObject)
HcalDbTool::IOVRun IOVRun
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
bool asciiFile(const std::string fParam)
std::vector< HcalDetId > undefinedCells(const T &fData)
const float * getValues() const
get value for all capId = 0..3
Definition: HcalPedestal.h:19
tuple cout
Definition: gather_cfg.py:145
std::map< std::string, std::string > mParsed
bool addCoder(const HcalCalibrationQIECoder &fCoder)
void defineParameter(const std::string &fParameter, const std::string &fComment="")
long double T
bool onlineFile(const std::string fParam)
bool optionIsSet(const std::string &fOption) const
std::string getParameter(const std::string &fKey)
HcalPedestal makePedestal(HcalGenericDetId fId, bool fSmear=false)
#define comment(par)
Definition: vmac.h:161