Skip to content
Snippets Groups Projects

DCube improvements

Merged Tim Adye requested to merge adye/athena:master-dcube1 into master
4 files
+ 66
24
Compare changes
  • Side-by-side
  • Inline
Files
4
  •   - Specify XML attributes, mon="/dir/hist" and/or ref="dir2/hist".
        Default is mon=name (in current TDirectory) and ref=mon, as before.
      - "dcube.py --generate --flat" generates an XML config with flat structure
        in a single <TDirectory>, specifying the full 'mon' path for each plot.
        This might be simpler for editing, but lists all together in the "Normal view"
        (simpler, but could lead to confusion if there are duplicate names).
      - Revert defaults: --branch=* --cmtconfig=* --install=* --project=* --jobId=*
        only for --generate, so the XML file matches any config.
      - Fix crash when Chi2TestX can't be run.
      - Remove spurious error message on --generate.
      - Don't exit if --branch="" etc.
@@ -327,21 +327,34 @@ class DCubeApp( DCubeObject ):
else:
if child.hasAttribute("name"):
objName = child.getAttribute("name")
if child.hasAttribute("mon"):
objName = child.getAttribute("mon")
else:
objName = child.getAttribute("name")
if child.hasAttribute("ref"):
refName = child.getAttribute("ref")
else:
refName = objName
objTests = child.getAttribute("tests").split(",")
if path == "/":
objPath = objName
refPath = refName
else:
objPath = os.path.normpath( os.path.join(path, objName) )
refPath = os.path.normpath( os.path.join(path, refName) )
if objPath == refPath:
self.info("test %s '%s' [%s]" % (tagName, objPath, ",".join(objTests)))
else:
objPath = os.path.join(path, objName)
self.info("test %s '%s' [%s]" % (tagName, objPath, ",".join(objTests)))
self.info("test %s '%s' vs '%s' [%s]" % (tagName, objPath, refPath, ",".join(objTests)))
# objPath is type unicode in Python2, which isn't recognised by TFile.Get().
# Not a problem with Python3.
if not isinstance(objPath,str):
objPath = objPath.encode('ascii', 'ignore')
refPath = refPath.encode('ascii', 'ignore')
refObj = self.refTFile.Get(objPath)
refObj = self.refTFile.Get(refPath)
monObj = self.monTFile.Get(objPath)
status.append(self.tester.test(child, monObj, refObj))
Loading