Skip to content
Snippets Groups Projects
Commit f77fec18 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

AthenaRootComps: remove usage of printfunc and minor flake8 cleanup

parent 8cabc842
No related branches found
Tags release/21.0.109
2 merge requests!708902024-04-25: merge of 24.0 into main,!70857Replace printfunc with print
......@@ -20,7 +20,7 @@ else: job += arcc.Athena__RootAsciiDumperAlg ("rootdumper")
import os, time
printfunc ('attach now', os.getpid())
print ('attach now', os.getpid())
time.sleep(10)
theApp.initialize()
......
# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
import os
from AthenaCommon.Utils import unixtools
if not 'FNAMES' in dir():
if 'FNAMES' not in dir():
paths = os.getenv('DATAPATH').split(os.pathsep) + [os.getenv('ATLAS_REFERENCE_DATA','')]
testdir = unixtools.find_datafile(os.getenv('ATLAS_REFERENCE_TAG'), paths)
FNAMES = [os.path.join(testdir, f) for f in ('ntuple.0.root', 'ntuple.1.root')]
......@@ -52,16 +52,16 @@ class MyAlg( PyAthena.Alg ):
keys.append(p.name())
for br in self.activeBranches:
try:
if not br in keys:
if br not in keys:
raise KeyError("no such object [%s] in store" % br)
o = self.evtstore[br]
if hasattr(o, 'at'):
o = list(o)
for i,v in enumerate(o):
if hasattr(v, 'at') and not isinstance(v, (basestring,)):
if hasattr(v, 'at') and not isinstance(v, str):
o[i] = list(v)
self.msg.info('%s: %r', br, o)
printfunc ("%s: %r" % (br, o), file=self.fd)
print ("%s: %r" % (br, o), file=self.fd)
except Exception as err:
self.msg.info(' --> err for [%s]: %s' % (br, err))
pass
......@@ -93,7 +93,7 @@ if DOWRITE:
svcMgr += CfgMgr.DecisionSvc()
import AthenaRootComps.WriteAthenaRoot as arcw
out = arcw.createNtupleOutputStream("StreamD3PD", "d3pd.root", "egamma")
if not 'OUTBRANCHES' in dir():
if 'OUTBRANCHES' not in dir():
OUTBRANCHES=[
"el_n",
"el_eta",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment