|
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 313 of file compareOutputFiles.py.
314 print(
"Checking File Records")
316 parFSR = GetFSRdicts(par)
317 serFSR = GetFSRdicts(ser)
319 diff1 = set(parFSR[
"TimeSpanFSR"].iteritems()) - set(
320 serFSR[
"TimeSpanFSR"].iteritems()
322 diff2 = set(parFSR[
"EventCountFSR"].iteritems()) - set(
323 serFSR[
"EventCountFSR"].iteritems()
327 "\nDifferent entries in TimeSpanFSR: \t"
329 +
"\nDifferent entries in EventCountFSR:\t"
333 for k
in [
"LumiFSRBeamCrossing",
"LumiFSRBeam2",
"LumiFSRNoBeam"]:
334 diff3 = set(parFSR[k][
"key"]) - set(serFSR[k][
"key"])
335 diff4 = set(parFSR[k][
"incr"]) - set(serFSR[k][
"incr"])
336 diff5 = set(parFSR[k][
"integral"]) - set(serFSR[k][
"integral"])
338 "Different entries in "
◆ checkForAddressDifference()
def compareOutputFiles.checkForAddressDifference |
( |
|
a, |
|
|
|
b |
|
) |
| |
◆ checkKeys()
def compareOutputFiles.checkKeys |
( |
|
name | ) |
|
◆ compareEvents()
def compareOutputFiles.compareEvents |
( |
|
s, |
|
|
|
p |
|
) |
| |
Definition at line 254 of file compareOutputFiles.py.
263 if len(sks) == len(pks):
274 extras = list(set(pks) - set(sks))
276 if p[e][0] ==
"DataObject":
279 print(
"Extra Other thing found!", e, p[e][0])
294 if s[key][0] == p[key][0]:
299 if s[key][1] == p[key][1]:
◆ CompareFSR()
def compareOutputFiles.CompareFSR |
( |
|
pout, |
|
|
|
sout |
|
) |
| |
Definition at line 429 of file compareOutputFiles.py.
433 print(
"Comparing File Records")
435 diff1 = set(parFSR[
"TimeSpanFSR"].iteritems()) - set(
436 serFSR[
"TimeSpanFSR"].iteritems()
438 diff2 = set(parFSR[
"EventCountFSR"].iteritems()) - set(
439 serFSR[
"EventCountFSR"].iteritems()
443 "\nDifferent entries in TimeSpanFSR: \t"
445 +
"\nDifferent entries in EventCountFSR:\t"
449 for k
in [
"LumiFSRBeamCrossing",
"LumiFSRBeam2",
"LumiFSRNoBeam"]:
450 diff3 = set(parFSR[k][
"key"]) - set(serFSR[k][
"key"])
451 diff4 = set(parFSR[k][
"incr"]) - set(serFSR[k][
"incr"])
452 diff5 = set(parFSR[k][
"integral"]) - set(serFSR[k][
"integral"])
454 "Different entries in "
464 print(
"\nParallel: \n" + str(parFSR))
465 print(
"\nSerial: \n" + str(serFSR))
◆ CompareTrees()
def compareOutputFiles.CompareTrees |
( |
|
pname, |
|
|
|
sname |
|
) |
| |
Definition at line 53 of file compareOutputFiles.py.
54 pf = TFile(pname,
"REC")
55 sf = TFile(sname,
"REC")
57 pfks = pf.GetListOfKeys()
58 sfks = sf.GetListOfKeys()
59 pfkeys = list([pfk.GetName()
for pfk
in pfks])
61 sfkeys = list([sfk.GetName()
for sfk
in sfks])
67 if k.startswith(event):
69 elif k.startswith(
"##"):
77 if k.startswith(event):
79 elif k.startswith(
"##"):
87 print(
"Meta Data differs")
92 print(
"Event data differs")
100 print(
"Extra Data in parallel file : ", pExtra)
102 print(
"Extra Data in serial file : ", sExtra)
104 print(
"Files will have different sizes")
◆ ComparisonEngine()
def compareOutputFiles.ComparisonEngine |
( |
|
pQueue, |
|
|
|
sQueue |
|
) |
| |
Definition at line 206 of file compareOutputFiles.py.
219 if pitem == sitem ==
None:
220 print(
"Termination Signals received ok")
223 print(
"pitem != sitem : ", pitem, sitem)
226 print(
"pitem != sitem : ", pitem, sitem)
230 print(
"Comparison Engine Finished")
232 print(
"Total Events Checked : %i" % (len(results)))
233 print(
"Perfect Matches : %i" % (sum(results)))
234 print(
"Errors : %i" % (len(results) - sum(results)))
◆ GetFSRdict()
def compareOutputFiles.GetFSRdict |
( |
|
filename, |
|
|
|
queue |
|
) |
| |
Definition at line 376 of file compareOutputFiles.py.
378 "TimeSpanFSR": {
"earliest": 0,
"latest": 0},
379 "LumiFSRBeamCrossing": {
"key": 0,
"incr": 0,
"integral": 0},
380 "LumiFSRBeam1": {
"key": 0,
"incr": 0,
"integral": 0},
381 "LumiFSRBeam2": {
"key": 0,
"incr": 0,
"integral": 0},
382 "LumiFSRNoBeam": {
"key": 0,
"incr": 0,
"integral": 0},
383 "EventCountFSR": {
"input": 0,
"output": 0,
"statusFlag": 0},
387 "from LumiAlgs.LumiFsrReaderConf import LumiFsrReaderConf as LumiFsrReader; LumiFsrReader().OutputLevel = INFO; LumiFsrReader().inputFiles = ['%s'] ;"
390 options +=
"LumiFsrReader().Persistency='ROOT'; LumiFsrReader().EvtMax = 1; from Configurables import LHCbApp; LHCbApp().Persistency='ROOT'; from Configurables import CondDB, DDDBConf;"
391 options +=
" CondDB().UseLatestTags=['%s']; DDDBConf(DataType='%s');" % (2011, 2011)
395 fsr = app.filerecordsvc()
397 lst = fsr.getHistoNames()
401 ob = fsr.retrieveObject(l)
404 assert ob.numberOfObjects() == 1
405 k = ob.containedObject(0)
406 runs, files, keys, increment, integral =
LumiFSR(k)
408 FSR[l[l.rfind(
"/") + 1 :]][
"runs"] = runs
409 FSR[l[l.rfind(
"/") + 1 :]][
"files"] = files
410 FSR[l[l.rfind(
"/") + 1 :]][
"key"] = keys
411 FSR[l[l.rfind(
"/") + 1 :]][
"incr"] = increment
412 FSR[l[l.rfind(
"/") + 1 :]][
"integral"] = integral
414 if "TimeSpanFSR" in l:
415 FSR[
"TimeSpanFSR"][
"earliest"] = ob.containedObject(0).earliest()
416 FSR[
"TimeSpanFSR"][
"latest"] = ob.containedObject(0).latest()
418 if "EventCountFSR" in l:
419 FSR[
"EventCountFSR"][
"input"] = ob.input()
420 FSR[
"EventCountFSR"][
"output"] = ob.output()
421 FSR[
"EventCountFSR"][
"statusFlag"] = ob.statusFlag()
◆ LumiFSR()
def compareOutputFiles.LumiFSR |
( |
|
lumi | ) |
|
Definition at line 349 of file compareOutputFiles.py.
355 for r
in lumi.runNumbers():
358 for f
in lumi.fileIDs():
361 sa = s.split(
"info (key/incr/integral) : ")[-1]
362 sa = sa.split(
"/")[:-1]
368 k, i, t = rec.split()
371 integral.append(int(t))
373 return (runs, files, key, incr, integral)
◆ printDict()
def compareOutputFiles.printDict |
( |
|
d, |
|
|
|
name = "unspecified" |
|
) |
| |
Definition at line 127 of file compareOutputFiles.py.
136 print(
"Dictionary %s : " % (name))
137 for k
in iter(d.keys()):
138 print(
"\t", k,
"\t", d[k])
◆ Reader()
def compareOutputFiles.Reader |
( |
|
readerType, |
|
|
|
filename, |
|
|
|
qacross, |
|
|
|
qToEngine |
|
) |
| |
Definition at line 142 of file compareOutputFiles.py.
142 def Reader(readerType, filename, qacross, qToEngine):
159 header =
"/Event/Rec/Header"
169 eNumber = int(evt[header].evtNumber())
175 if readerType == SER:
182 elif readerType == PAR:
184 for serOrder
in iter(qacross.get,
None):
186 lsks = len(serOrder.keys())
187 lpks = len(order.keys())
188 print(
"Events in Files (serial/parallel) : %i / %i" % (lsks, lpks))
192 for i
in iter(serOrder.keys()):
193 if readerType == PAR:
194 i = order[serOrder[i]]
196 a.runSelectedEvents(fname, i)
200 ascii = dict([(l, (evt[l].__class__.__name__, evt[l].
__repr__()))
for l
in lst])
203 print(
"%s Reader Finished" % (readerType))
◆ switchDict()
def compareOutputFiles.switchDict |
( |
|
d | ) |
|
Definition at line 109 of file compareOutputFiles.py.
112 nkeys = len(d.keys())
116 if vals.count(v) > 1:
117 print(
"Dictionary cannot be switched, values not unique")
119 print(
"Dict has keys/values : %i/%i" % (nkeys, nvals))
122 for k, entry
in pairs:
◆ args
◆ com
◆ CompareFSR
compareOutputFiles.CompareFSR |
◆ ComparisonEngine
compareOutputFiles.ComparisonEngine |
◆ cp
◆ GetFSRdict
compareOutputFiles.GetFSRdict |
◆ PAR
◆ par
◆ pname
◆ pout
◆ pp
◆ qacross
compareOutputFiles.qacross |
◆ Reader
compareOutputFiles.Reader |
◆ SER
◆ ser
◆ sname
◆ sout
◆ sp
◆ target
compareOutputFiles.target |
A small to stream Data I/O.
def ComparisonEngine(pQueue, sQueue)
__repr__
decorate the vector of properties
def CompareTrees(pname, sname)
def printDict(d, name="unspecified")
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)
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.
def checkForAddressDifference(a, b)