|
def | checkKeys (name) |
|
def | CompareTrees (pname, sname) |
|
def | switchDict (d) |
|
def | printDict (d, name='unspecified') |
|
def | Reader (readerType, filename, qacross, qToEngine) |
|
def | ComparisonEngine (pQueue, sQueue) |
|
def | checkForAddressDifference (a, b) |
|
def | compareEvents (s, p) |
|
def | CheckFileRecords (par, ser) |
|
def | LumiFSR (lumi) |
|
def | GetFSRdict (filename, queue) |
|
def | CompareFSR (pout, sout) |
|
◆ CheckFileRecords()
def compareOutputFiles.CheckFileRecords |
( |
|
par, |
|
|
|
ser |
|
) |
| |
Definition at line 308 of file compareOutputFiles.py.
310 print(
"Checking File Records")
312 parFSR = GetFSRdicts(par)
313 serFSR = GetFSRdicts(ser)
315 diff1 = set(parFSR[
"TimeSpanFSR"].
iteritems()) - \
317 diff2 = set(parFSR[
"EventCountFSR"].
iteritems()) - \
320 print(
"\nDifferent entries in TimeSpanFSR: \t" + \
321 str(len(diff1)) +
"\nDifferent entries in EventCountFSR:\t" + str(len(diff2)))
323 for k
in [
"LumiFSRBeamCrossing",
"LumiFSRBeam2",
"LumiFSRNoBeam"]:
324 diff3 = set(parFSR[k][
"key"]) - set(serFSR[k][
"key"])
325 diff4 = set(parFSR[k][
"incr"]) - set(serFSR[k][
"incr"])
326 diff5 = set(parFSR[k][
"integral"]) - set(serFSR[k][
"integral"])
327 print(
"Different entries in " + str(k) +
": \tkey: " +
328 str(len(diff3)) +
" increment: " + str(len(diff4)) +
329 " integral: " + str(len(diff5)))
◆ checkForAddressDifference()
def compareOutputFiles.checkForAddressDifference |
( |
|
a, |
|
|
|
b |
|
) |
| |
◆ checkKeys()
def compareOutputFiles.checkKeys |
( |
|
name | ) |
|
◆ compareEvents()
def compareOutputFiles.compareEvents |
( |
|
s, |
|
|
|
p |
|
) |
| |
Definition at line 249 of file compareOutputFiles.py.
258 if len(sks) == len(pks):
269 extras = list(set(pks) - set(sks))
271 if p[e][0] ==
'DataObject':
274 print(
'Extra Other thing found!', e, p[e][0])
289 if s[key][0] == p[key][0]:
294 if s[key][1] == p[key][1]:
◆ CompareFSR()
def compareOutputFiles.CompareFSR |
( |
|
pout, |
|
|
|
sout |
|
) |
| |
Definition at line 440 of file compareOutputFiles.py.
445 print(
"Comparing File Records")
447 diff1 = set(parFSR[
"TimeSpanFSR"].
iteritems()) - \
449 diff2 = set(parFSR[
"EventCountFSR"].
iteritems()) - \
452 print(
"\nDifferent entries in TimeSpanFSR: \t" + \
453 str(len(diff1)) +
"\nDifferent entries in EventCountFSR:\t" + str(len(diff2)))
455 for k
in [
"LumiFSRBeamCrossing",
"LumiFSRBeam2",
"LumiFSRNoBeam"]:
456 diff3 = set(parFSR[k][
'key']) - set(serFSR[k][
'key'])
457 diff4 = set(parFSR[k][
'incr']) - set(serFSR[k][
'incr'])
458 diff5 = set(parFSR[k][
'integral']) - set(serFSR[k][
"integral"])
459 print(
"Different entries in " + str(k) +
": \tkey: " +
460 str(len(diff3)) +
" increment: " + str(len(diff4)) +
461 " integral: " + str(len(diff5)))
463 print(
"\nParallel: \n" + str(parFSR))
464 print(
"\nSerial: \n" + str(serFSR))
◆ CompareTrees()
def compareOutputFiles.CompareTrees |
( |
|
pname, |
|
|
|
sname |
|
) |
| |
Definition at line 47 of file compareOutputFiles.py.
48 pf = TFile(pname,
'REC')
49 sf = TFile(sname,
'REC')
51 pfks = pf.GetListOfKeys()
52 sfks = sf.GetListOfKeys()
53 pfkeys = list([pfk.GetName()
for pfk
in pfks])
55 sfkeys = list([sfk.GetName()
for sfk
in sfks])
61 if k.startswith(event):
63 elif k.startswith(
'##'):
71 if k.startswith(event):
73 elif k.startswith(
'##'):
81 print(
'Meta Data differs')
86 print(
'Event data differs')
94 print(
'Extra Data in parallel file : ', pExtra)
96 print(
'Extra Data in serial file : ', sExtra)
98 print(
'Files will have different sizes')
◆ ComparisonEngine()
def compareOutputFiles.ComparisonEngine |
( |
|
pQueue, |
|
|
|
sQueue |
|
) |
| |
Definition at line 201 of file compareOutputFiles.py.
214 if pitem == sitem ==
None:
215 print(
'Termination Signals received ok')
218 print(
'pitem != sitem : ', pitem, sitem)
221 print(
'pitem != sitem : ', pitem, sitem)
225 print(
'Comparison Engine Finished')
227 print(
'Total Events Checked : %i' % (len(results)))
228 print(
'Perfect Matches : %i' % (sum(results)))
229 print(
'Errors : %i' % (len(results) - sum(results)))
◆ GetFSRdict()
def compareOutputFiles.GetFSRdict |
( |
|
filename, |
|
|
|
queue |
|
) |
| |
Definition at line 360 of file compareOutputFiles.py.
367 "LumiFSRBeamCrossing": {
394 options =
"from LumiAlgs.LumiFsrReaderConf import LumiFsrReaderConf as LumiFsrReader; LumiFsrReader().OutputLevel = INFO; LumiFsrReader().inputFiles = ['%s'] ;" % filename
395 options +=
"LumiFsrReader().Persistency='ROOT'; LumiFsrReader().EvtMax = 1; from Configurables import LHCbApp; LHCbApp().Persistency='ROOT'; from Configurables import CondDB, DDDBConf;"
396 options +=
" CondDB().UseLatestTags=['%s']; DDDBConf(DataType='%s');" % (
401 fsr = app.filerecordsvc()
403 lst = fsr.getHistoNames()
408 ob = fsr.retrieveObject(l)
412 assert ob.numberOfObjects() == 1
413 k = ob.containedObject(0)
414 runs, files, keys, increment, integral =
LumiFSR(k)
416 FSR[l[l.rfind(
'/') + 1:]][
'runs'] = runs
417 FSR[l[l.rfind(
'/') + 1:]][
'files'] = files
418 FSR[l[l.rfind(
'/') + 1:]][
'key'] = keys
419 FSR[l[l.rfind(
'/') + 1:]][
'incr'] = increment
420 FSR[l[l.rfind(
'/') + 1:]][
'integral'] = integral
422 if "TimeSpanFSR" in l:
424 FSR[
"TimeSpanFSR"][
'earliest'] = ob.containedObject(
426 FSR[
"TimeSpanFSR"][
'latest'] = ob.containedObject(0).latest()
428 if "EventCountFSR" in l:
430 FSR[
"EventCountFSR"][
'input'] = ob.input()
431 FSR[
"EventCountFSR"][
'output'] = ob.output()
432 FSR[
"EventCountFSR"][
'statusFlag'] = ob.statusFlag()
◆ LumiFSR()
def compareOutputFiles.LumiFSR |
( |
|
lumi | ) |
|
Definition at line 332 of file compareOutputFiles.py.
339 for r
in lumi.runNumbers():
342 for f
in lumi.fileIDs():
345 sa = s.split(
"info (key/incr/integral) : ")[-1]
346 sa = sa.split(
'/')[:-1]
352 k, i, t = rec.split()
355 integral.append(int(t))
357 return (runs, files, key, incr, integral)
◆ printDict()
def compareOutputFiles.printDict |
( |
|
d, |
|
|
|
name = 'unspecified' |
|
) |
| |
Definition at line 121 of file compareOutputFiles.py.
130 print(
'Dictionary %s : ' % (name))
131 for k
in iter(d.keys()):
132 print(
'\t', k,
'\t', d[k])
◆ Reader()
def compareOutputFiles.Reader |
( |
|
readerType, |
|
|
|
filename, |
|
|
|
qacross, |
|
|
|
qToEngine |
|
) |
| |
Definition at line 136 of file compareOutputFiles.py.
136 def Reader(readerType, filename, qacross, qToEngine):
153 header =
'/Event/Rec/Header'
163 eNumber = int(evt[header].evtNumber())
169 if readerType == SER:
176 elif readerType == PAR:
178 for serOrder
in iter(qacross.get,
None):
180 lsks = len(serOrder.keys())
181 lpks = len(order.keys())
182 print(
'Events in Files (serial/parallel) : %i / %i' % (lsks, lpks))
186 for i
in iter(serOrder.keys()):
187 if readerType == PAR:
188 i = order[serOrder[i]]
190 a.runSelectedEvents(fname, i)
195 [(l, (evt[l].__class__.__name__, evt[l].
__repr__()))
for l
in lst])
198 print(
'%s Reader Finished' % (readerType))
◆ switchDict()
def compareOutputFiles.switchDict |
( |
|
d | ) |
|
Definition at line 103 of file compareOutputFiles.py.
106 nkeys = len(d.keys())
110 if vals.count(v) > 1:
111 print(
'Dictionary cannot be switched, values not unique')
113 print(
'Dict has keys/values : %i/%i' % (nkeys, nvals))
116 for k, entry
in pairs:
◆ args
compareOutputFiles.args = sys.argv |
◆ com
◆ cp
◆ PAR
string compareOutputFiles.PAR = 'PARALLEL' |
◆ par
compareOutputFiles.par = 'PFN:' + args[0] |
◆ pname
string compareOutputFiles.pname = par[4:] |
◆ pout
compareOutputFiles.pout = Queue() |
◆ pp
◆ qacross
compareOutputFiles.qacross = Queue() |
◆ SER
string compareOutputFiles.SER = 'SERIAL' |
◆ ser
compareOutputFiles.ser = 'PFN:' + args[1] |
◆ sname
string compareOutputFiles.sname = ser[4:] |
◆ sout
compareOutputFiles.sout = Queue() |
◆ sp
A small to stream Data I/O.
def ComparisonEngine(pQueue, sQueue)
def CompareTrees(pname, sname)
def CheckFileRecords(par, ser)
def importOptions(optsfile)
def GetFSRdict(filename, queue)
HistogramPersistencySvc class implementation definition.
Definition of class EventSelector.
def Reader(readerType, filename, qacross, qToEngine)
def CompareFSR(pout, sout)
def printDict(d, name='unspecified')
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.
def checkForAddressDifference(a, b)