13 from PyCool
import cool
17 theString=technology+
'://'+server+
';schema='+schema+
';dbname='+dbname
22 dbSvc=cool.DatabaseSvcFactory.databaseService()
24 server=
'ATLAS_COOLPROD'
25 [schema,dbname]=dbstring.split(
'/')
26 myDbString=
formDbString(technology, server, schema, dbname)
28 db=dbSvc.openDatabase(myDbString)
29 except Exception
as e:
30 print(
'Problem opening %s in GetRunList'%myDbString)
37 s,u=((runNumber) << 32), ((runNumber + 1) << 32) - 1
38 print (
"formIOV: ", s, u)
43 s,u=((runNumberStart ) << 32), ((runNumber + 1) << 32) - 1
44 print (
"formIOV: ", s, u)
50 runlistfile =
open(
"/afs/cern.ch/work/s/sctcalib/lastRuns.txt", mode =
'r')
51 content = runlistfile.read()
53 content_list = content.split(
"\n")
54 content_list = [line
for line
in content_list
if line.strip()]
55 integer_int_list =
list(map(int, content_list))
56 if (runNumber >= integer_int_list[-1]):
57 RNS = integer_int_list[len(integer_int_list)-(k+5)]
59 RNS = integer_int_list[integer_int_list.index(runNumber)-(k+5)]
65 print(
'TAG ',tag,
' TAG')
66 folderlist=db.listAllNodes()
67 print(
' folderlist=db.listAllNodes()')
69 for i
in folderlist:
print(i)
71 myfolder=db.getFolder(folder)
72 taglist=myfolder.listTags()
73 print(
' taglist=myfolder.listTags()')
74 for i
in taglist:
print(i)
81 objs=myfolder.browseObjects(iovSince,iovUntil,cool.ChannelSelection.all(),tag)
85 temp.append(obj.since()>>32)
93 if ( Temp[0] != runNumber ):
96 for i
in range(len(Temp)-1):
97 if (Temp[i] != runtmp):
98 if ( Temp[i] != runNumber ):
105 for i
in range(k): mylist.append( ls[len(ls)-i-1] )
113 myfolder=db.getFolder(folder)
114 iovSince, iovUntil =
formIov(runNumber)
117 objs=myfolder.browseObjects(iovSince,iovUntil,cool.ChannelSelection.all(),tag)
119 mypayload=obj.payload()
120 dfl=mypayload[
'DefectList']
123 NumNoisyMods=NumNoisyMods+1
132 myfolder=db.getFolder(folder)
133 iovSince, iovUntil =
formIov(runNumber)
137 objs=myfolder.browseObjects(iovSince,iovUntil,cool.ChannelSelection.all(),tag)
139 mypayload=obj.payload()
140 dfl=mypayload[
'DefectList']
147 for j
in range(len(words)):
150 sep=jk.replace (
'-',
' ' )
152 numNoisyStripsAdds=numNoisyStripsAdds+
int(sep1[1])-
int(sep1[0])
153 numNoisyStrips=numNoisyStrips+len(words)+numNoisyStripsAdds
157 return numNoisyStrips