ATLAS Offline Software
CalibDbDump.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 from __future__ import print_function
4 
5 import getopt
6 import sys
7 import CalibDbDefaults
8 
9 cool_database_string = CalibDbDefaults.cool_database_string
10 cool_folder=CalibDbDefaults.cool_folder['t0']
11 cool_tag=''
12 
13 def printhelp(argv0):
14  sys.stderr.write("Usage: " + argv0 + " [-h] [-s <cool database string>] [-f <cool folder>] [-t <cool tag>] [<run nr> [<run nr> [..]]]\n")
15  sys.exit(1)
16 
17 optlist, args = getopt.gnu_getopt(sys.argv, 'hs:f:t:')
18 #if not len(args)==0:
19 # printhelp(args[0])
20 
21 for opt, oa in optlist:
22  if opt=='-s':
23  if oa[-2:]=='db':
24  cool_database_string = 'sqlite://;schema=' + oa + ';dbname=COMP200'
25  cool_tag=''
26  else:
27  cool_database_string = oa
28  continue
29  if opt=='-f':
30  cool_folder=oa
31  continue
32  if opt=='-t':
33  cool_tag=oa
34  continue
35  if opt=='-h':
36  printhelp(sys.argv[0])
37 
38 
39 
40 sys.argv=[ sys.argv[0], '-b' ]
42 
43 if not cool_tag:
44  cool_tag = GetFolderTag(cool_database_string, cool_folder)
45 
46 
47 print ("Cool database: " + cool_database_string + " " + cool_folder + " " + cool_tag )
48 
49 if len(args)==1:
50  DumpFolderSummary(cool_database_string, cool_folder, cool_tag)
51  sys.exit(0)
52 
53 for run_nr in args[1:]:
54  print ("IOVs for run ", run_nr)
55  print ((len("IOVs for run ") + len(run_nr) + 1) * "=")
56  DumpFolderSummary(cool_database_string, cool_folder, cool_tag, int(run_nr))
57  print()
58 
59 
60 
61 
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ReadCool.DumpFolderSummary
def DumpFolderSummary(db_string, folder, tag, run=None)
Definition: MuonSpectrometer/MuonCalib/MuonCalibDbOperations/python/ReadCool.py:31
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
CalibDbDump.printhelp
def printhelp(argv0)
Definition: CalibDbDump.py:13
ReadCool.GetFolderTag
def GetFolderTag(db_string, folder)
Definition: MuonSpectrometer/MuonCalib/MuonCalibDbOperations/python/ReadCool.py:159
ReadCool