|
ATLAS Offline Software
|
|
def | StartDate (period) |
| --> Definitions: More...
|
|
def | ConvertedRunNumber (rNumber) |
|
def | RunListInDBTotal (start_date, end_date, file_name, string_pattern) |
|
def | channelValueQuery (server, schema, dbname, folder, iov0, iov1, tag, channels) |
|
def | RunListInDB (array, server, schema, dbname, folder, tag, channels) |
|
def | GetNumberOfNoisyModulesInDB (array, server, schema, dbname, folder, tag, channels) |
|
def | GetNumberOfNoisyStripsInDB (array, server, schema, dbname, folder, tag, channels) |
|
def | GetNoisyModulesAverageInDB (array) |
|
def | DisplayInfoForRunsInDB (runs, noisy_mods, noisy_strips) |
|
def | UnpackData (data) |
|
def | iov_keygen (iov) |
|
def | DumpFolderSummary (db_string, folder, tag, run=None) |
|
def | ReadRtCool (db_string, folder, tag, run_number) |
|
def | ReadT0Cool (db_string, folder, tag, run_number) |
|
def | GetFolderTag (db_string, folder) |
|
◆ channelValueQuery()
def ReadCool.channelValueQuery |
( |
|
server, |
|
|
|
schema, |
|
|
|
dbname, |
|
|
|
folder, |
|
|
|
iov0, |
|
|
|
iov1, |
|
|
|
tag, |
|
|
|
channels |
|
) |
| |
Definition at line 64 of file InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCool.py.
65 timespan=
str(iov0) +
'-' +
str(iov1)
66 prefix=
'http://voatlas11.cern.ch:8080/cooldb/'
68 url = prefix+server+d+schema+d+dbname+folder+
'/timespan/'+timespan+
'/tag/'+tag+
'/channels/'+channels
69 httpHeaders={
'Accept':
'text/xml'}
72 request=urllib2.Request(url,textData, httpHeaders)
73 u=urllib2.urlopen(request)
74 xmlDocString = u.read()
◆ ConvertedRunNumber()
def ReadCool.ConvertedRunNumber |
( |
|
rNumber | ) |
|
◆ DisplayInfoForRunsInDB()
def ReadCool.DisplayInfoForRunsInDB |
( |
|
runs, |
|
|
|
noisy_mods, |
|
|
|
noisy_strips |
|
) |
| |
◆ DumpFolderSummary()
def ReadCool.DumpFolderSummary |
( |
|
db_string, |
|
|
|
folder, |
|
|
|
tag, |
|
|
|
run = None |
|
) |
| |
Definition at line 31 of file MuonSpectrometer/MuonCalib/MuonCalibDbOperations/python/ReadCool.py.
34 db=AtlCoolLib.indirectOpen(db_string, readOnly=
True, debug=
True)
35 except Exception
as e:
36 print (
'Problem opening database',e)
40 cool_folder=db.getFolder(folder)
45 objs=cool_folder.browseObjects((run<<32), ((run+1)<<32), cool.ChannelSelection.all(), cool_tag)
47 objs=cool_folder.browseObjects(0, (999999<<32), cool.ChannelSelection.all(), cool_tag)
49 file_col=obj.payload()[
'file']
50 file_items=re.split(
'[A-Z,a-z]*', file_col)
53 if len(file_items)==2:
55 head_id =
int(file_items[1])
56 site = re.sub(
"[0-9]",
"", file_col)
62 ident=(obj.since()>>32, obj.until()>>32, site, head_id, ts)
63 if ident
not in counters:
66 for ident
in sorted(counters.keys(), key=iov_keygen):
67 print (
"[", ident[0],
",", ident[1],
"[", ident[2], ident[3], ident[4],
":" , counters[ident])
◆ GetFolderTag()
def ReadCool.GetFolderTag |
( |
|
db_string, |
|
|
|
folder |
|
) |
| |
◆ GetNoisyModulesAverageInDB()
def ReadCool.GetNoisyModulesAverageInDB |
( |
|
array | ) |
|
◆ GetNumberOfNoisyModulesInDB()
def ReadCool.GetNumberOfNoisyModulesInDB |
( |
|
array, |
|
|
|
server, |
|
|
|
schema, |
|
|
|
dbname, |
|
|
|
folder, |
|
|
|
tag, |
|
|
|
channels |
|
) |
| |
Definition at line 100 of file InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCool.py.
101 Array_numNoisyModules=[]
102 if (array[0] != -999):
103 for i
in range(len(array)):
108 derived_string=
channelValueQuery(server, schema, dbname, folder, iovSince, iovUntil, tag, channels)
110 derived=NonvalidatingReader.parseString(derived_string,uri=
"dummy")
111 numNoisyModules=derived.xpath(
u'count(//channel)')
112 if numNoisyModules !=0.0:
113 Array_numNoisyModules.append(numNoisyModules)
115 Array_numNoisyModules.append(-999)
117 return Array_numNoisyModules
◆ GetNumberOfNoisyStripsInDB()
def ReadCool.GetNumberOfNoisyStripsInDB |
( |
|
array, |
|
|
|
server, |
|
|
|
schema, |
|
|
|
dbname, |
|
|
|
folder, |
|
|
|
tag, |
|
|
|
channels |
|
) |
| |
Definition at line 120 of file InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCool.py.
121 Array_numNoisyStrips = []
122 if (array[0] != -999):
123 for i
in range(len(array)):
128 derived_string=
channelValueQuery(server, schema, dbname, folder, iovSince, iovUntil, tag, channels)
130 derived=NonvalidatingReader.parseString(derived_string,uri=
"dummy")
131 numNoisyModules=derived.xpath(
u'count(//channel)')
132 if numNoisyModules !=0.0:
134 allDefectStripsList=(derived.xpath(
u"//channel/value[@name='DefectList']"))
138 for strips
in allDefectStripsList:
139 words=strips.firstChild.data.split()
140 for j
in range(len(words)):
143 sep=jk.replace (
'-',
' ' )
145 numNoisyStripsAdds=numNoisyStripsAdds+
int(sep1[1])-
int(sep1[0])
147 numNoisyStrips=numNoisyStrips+len(strips.firstChild.data.split())
149 Array_numNoisyStrips.append(numNoisyStrips + numNoisyStripsAdds)
152 Array_numNoisyStrips.append(-999)
154 return Array_numNoisyStrips
◆ iov_keygen()
def ReadCool.iov_keygen |
( |
|
iov | ) |
|
◆ ReadRtCool()
def ReadCool.ReadRtCool |
( |
|
db_string, |
|
|
|
folder, |
|
|
|
tag, |
|
|
|
run_number |
|
) |
| |
Definition at line 70 of file MuonSpectrometer/MuonCalib/MuonCalibDbOperations/python/ReadCool.py.
70 def ReadRtCool(db_string, folder, tag, run_number):
73 db=AtlCoolLib.indirectOpen(db_string, readOnly=
True, debug=
True)
74 except Exception
as e:
75 print (
'Problem opening database',e)
79 cool_folder=db.getFolder(folder)
87 myiov=(run_number<<32)
89 objs=cool_folder.browseObjects(myiov,myiov, cool.ChannelSelection.all(), cool_tag)
91 iov=(obj.since(), obj.until())
98 graphs[chamber]=TGraphErrors(n_points)
100 if up.stationNameString()==
'XXX':
101 print (
"Invalid station name in ", obj.payload()[
'file'])
103 nm=up.stationNameString() +
"_" +
str(up.stationPhi()) +
"_" +
str(up.stationEta())
106 for i
in range(0, n_points):
113 graphs[chamber].SetPoint(i, r, t)
114 graphs[chamber].SetPointError(i, 0, s)
115 splines[chamber]=TSpline3(
"sp_" + nm, graphs[chamber])
116 if gDirectory.IsWritable():
117 splines[chamber].Write(
"sp_" + nm)
118 graphs[chamber].Write(
"gr_" + nm)
120 return graphs, splines, iovs
◆ ReadT0Cool()
def ReadCool.ReadT0Cool |
( |
|
db_string, |
|
|
|
folder, |
|
|
|
tag, |
|
|
|
run_number |
|
) |
| |
Definition at line 123 of file MuonSpectrometer/MuonCalib/MuonCalibDbOperations/python/ReadCool.py.
123 def ReadT0Cool(db_string, folder, tag, run_number):
126 db=AtlCoolLib.indirectOpen(db_string, readOnly=
True, debug=
True)
127 except Exception
as e:
128 print (
'Problem opening database',e)
132 cool_folder=db.getFolder(folder)
134 myiov=(run_number<<32)
138 objs=cool_folder.browseObjects(myiov,myiov, cool.ChannelSelection.all(), cool_tag)
143 ch_sp=sp1[0][2:].
split(
"_")
144 ch_id=(ch_sp[0],
int(ch_sp[1]),
int(ch_sp[2]))
147 t0_items=sp[1].
split(
",")
148 t0_values[ch_id] = []
150 for i
in range(0, ntubes):
151 t0=
float(t0_items[3*i+0])
153 t0+= GasmonDriftTimeOffsetT0
154 t0_values[ch_id].
append((t0,
int(t0_items[3*i+1]),
float(t0_items[3*i+2])))
◆ RunListInDB()
def ReadCool.RunListInDB |
( |
|
array, |
|
|
|
server, |
|
|
|
schema, |
|
|
|
dbname, |
|
|
|
folder, |
|
|
|
tag, |
|
|
|
channels |
|
) |
| |
Definition at line 78 of file InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCool.py.
78 def RunListInDB(array, server, schema, dbname, folder, tag, channels):
81 for i
in range(len(array)):
86 derived_string=
channelValueQuery(server, schema, dbname, folder, iovSince, iovUntil, tag, channels)
88 derived=NonvalidatingReader.parseString(derived_string,uri=
"dummy")
89 numNoisyModules=derived.xpath(
u'count(//channel)')
91 if numNoisyModules !=0.0:
92 Array_runsInDB.append(runNumber)
94 Array_runsInDB.append(-999)
◆ RunListInDBTotal()
def ReadCool.RunListInDBTotal |
( |
|
start_date, |
|
|
|
end_date, |
|
|
|
file_name, |
|
|
|
string_pattern |
|
) |
| |
Definition at line 28 of file InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCool.py.
29 prefix=
"http://atlas-service-runinformation.web.cern.ch/atlas-service-runinformation/cgi-bin/runnumbers.py?"
30 url=prefix+
"start.date="+start_date+
"%2012:06:00&end.date="+end_date+
"%2012:06:00&format=html"
32 request=urllib2.Request(url)
33 u=urllib2.urlopen(request)
36 DocString_1 = DocString.replace (
'<td>',
' ' )
37 DocString_2 = DocString_1.replace (
'</td>',
' ' )
38 DocString_3 = DocString_2.replace (
'<tr>',
' ' )
39 DocString_4 = DocString_3.replace (
'</tr>',
' ' )
40 DocString_5 = DocString_4.replace (
'<th>Name</th><th>Number</th><th>Start At (UTC)</th><th>Duration</th><th>Partition</th>',
' ' )
43 f=
open(file_name,
'w')
48 if os.path.exists(file_name):
49 f =
open(file_name,
'r')
50 for line
in f.readlines():
51 if line.find(string_pattern)>= 0:
53 Runs.append(
int(ar[1]))
56 print(
"-->ERROR: athena_checkUpload: Can't find input file !")
◆ StartDate()
def ReadCool.StartDate |
( |
|
period | ) |
|
◆ UnpackData()
def ReadCool.UnpackData |
( |
|
data | ) |
|
◆ argv
def ConvertedRunNumber(rNumber)
def DumpFolderSummary(db_string, folder, tag, run=None)
def ReadT0Cool(db_string, folder, tag, run_number)
def RunListInDBTotal(start_date, end_date, file_name, string_pattern)
def TimeSlewingApplied(obj)
def GetNoisyModulesAverageInDB(array)
def RunListInDB(array, server, schema, dbname, folder, tag, channels)
def GetNumberOfNoisyStripsInDB(array, server, schema, dbname, folder, tag, channels)
def GetNumberOfNoisyModulesInDB(array, server, schema, dbname, folder, tag, channels)
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
def channelValueQuery(server, schema, dbname, folder, iov0, iov1, tag, channels)
def StartDate(period)
--> Definitions:
def GetFolderTag(db_string, folder)
def DisplayInfoForRunsInDB(runs, noisy_mods, noisy_strips)
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
def ReadRtCool(db_string, folder, tag, run_number)
def ResolveTag(folder, tag)