4 from AthenaCommon.Utils
import unixtools
6 if 'FNAMES' not in dir():
7 paths = os.getenv(
'DATAPATH').
split(os.pathsep) + [os.getenv(
'ATLAS_REFERENCE_DATA',
'')]
8 testdir = unixtools.find_datafile(os.getenv(
'ATLAS_REFERENCE_TAG'), paths)
9 FNAMES = [os.path.join(testdir, f)
for f
in (
'ntuple.0.root',
'ntuple.1.root')]
11 if not isinstance(FNAMES, (list,tuple)):
15 import AthenaRootComps.ReadAthenaRoot
16 svcMgr.EventSelector.InputCollections = FNAMES
17 svcMgr.EventSelector.TupleName =
"egamma"
19 from AthenaCommon.AlgSequence
import AlgSequence
22 from AthenaPython
import PyAthena
23 StatusCode = PyAthena.StatusCode
37 self.
fname = kw.get(
'fname',
'data.var.txt')
42 self.
evtstore = PyAthena.py_svc(
'StoreGateSvc')
44 return StatusCode.Success
47 self.
msg.
info(
'running execute...')
56 raise KeyError(
"no such object [%s] in store" % br)
60 for i,v
in enumerate(o):
61 if hasattr(v,
'at')
and not isinstance(v, str):
64 print (
"%s: %r" % (br, o), file=self.
fd)
65 except Exception
as err:
66 self.
msg.
info(
' --> err for [%s]: %s' % (br, err))
68 return StatusCode.Success
71 if hasattr(self,
'fd')
and self.
fd:
74 return StatusCode.Success
78 from AthenaCommon.AlgSequence
import AlgSequence
80 job +=
MyAlg(
'py_alg')
82 if 'BRANCHES' in dir():
83 job.py_alg.activeBranches = BRANCHES
86 if not 'EVTMAX' in dir():
88 theApp.EvtMax = EVTMAX
90 if not 'DOWRITE' in dir():
93 svcMgr += CfgMgr.DecisionSvc()
94 import AthenaRootComps.WriteAthenaRoot
as arcw
95 out = arcw.createNtupleOutputStream(
"StreamD3PD",
"d3pd.root",
"egamma")
96 if 'OUTBRANCHES' not in dir():
102 out.ItemList += OUTBRANCHES