11 from PyCool
import cool
14 readonly=(connstr.find(
'//')==-1)
15 tokens=connstr.split(
'/')
18 connstr2=
'oracle://ATLAS_COOLPROD;schema=ATLAS_%s;dbname=%s' % (schema,dbname)
19 dbSvc=cool.DatabaseSvcFactory.databaseService()
20 dbconn=dbSvc.openDatabase(connstr2,readonly)
21 folder=dbconn.getFolder(foldername)
23 iovend=iovstart+0xFFFFFFFF
24 objs=folder.browseObjects(iovstart,iovend,cool.ChannelSelection.all(),tag)
26 payload = obj.payload()
27 payload_string =
"%s" %( payload )
28 DB_number = payload_string.split()[-1].
split(
"]")[0].
split(
"[")[1]
35 readonly=(connstr.find(
'//')==-1)
36 tokens=connstr.split(
'/')
39 connstr2=
'oracle://ATLAS_COOLPROD;schema=ATLAS_%s;dbname=%s' % (schema,dbname)
40 dbSvc=cool.DatabaseSvcFactory.databaseService()
41 dbconn=dbSvc.openDatabase(connstr2,readonly)
42 folder=dbconn.getFolder(foldername)
44 objs=folder.browseObjects( cool.ValidityKeyMin,
47 cool.ChannelSelection.all(),
49 print (
"ref", DB_number)
51 payload = obj.payload()
52 payload_string =
"%s" %( payload )
53 test_number = payload_string.split()[-1].
split(
"]")[0].
split(
"[")[1]
55 run_string = obj.since() >> 32,
',',obj.since()%0x100000000
58 if test_number == DB_number:
64 from optparse
import OptionParser
66 parser=OptionParser(usage=
"\n ./checkUPD1.py --upd4 <UPD4 folder tag name> --upd1 <UPD1 folder tag name> --folder <e.g. /Indet/Align> -r <run> \n")
67 parser.add_option(
"-r",
"--run" ,type=
"string" ,dest=
"run" ,default=
None ,help=
"runnumber in UPD4 tag")
68 parser.add_option(
"-b",
"--upd4" ,type=
"string" ,dest=
"upd4" ,default=
'InDetAlign-RUN2-BLK-UPD4-13' ,help=
"runnumber in UPD4 tag")
69 parser.add_option(
"-e",
"--upd1" ,type=
"string" ,dest=
"upd1" ,default=
'InDetAlign-RUN2-ES1-UPD1-06' ,help=
"runnumber in UPD1 tag")
70 parser.add_option(
"-f",
"--folder" ,type=
"string" ,dest=
"folder" ,default=
'/Indet/Align' ,help=
"runnumber in UPD1 tag")
71 (options,args)=parser.parse_args()
74 upd4_tag = options.upd4
75 upd1_tag = options.upd1
77 foldername = options.folder
78 connstr =
'COOLOFL_INDET/CONDBR2'
80 if foldername ==
'/TRT/Align':
81 connstr =
'COOLOFL_TRT/CONDBR2'
88 print (
"first run in UPD1 tag with matching UPD4 conditions is run %i" %(run[0]))
90 print (
"no matching conditions found in UPD1 tag!!!")