ATLAS Offline Software
test_athena_ntuple_dumper.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 import os
4 from AthenaCommon.Utils import unixtools
5 
6 if not 'FNAMES' 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')]
10 
11 if not isinstance(FNAMES, (list,tuple)):
12  FNAMES = [FNAMES]
13  pass
14 
15 if not 'TUPLENAME' in dir():
16  TUPLENAME = 'egamma'
17 
18 import AthenaRootComps.ReadAthenaRoot
19 svcMgr.EventSelector.InputCollections = FNAMES
20 svcMgr.EventSelector.TupleName = TUPLENAME
21 
22 from AthenaCommon.AlgSequence import AlgSequence
23 job = AlgSequence()
24 
25 import AthenaRootComps.AthenaRootCompsConf as arcc
26 if not 'USEVARHANDLE' in dir():
27  USEVARHANDLE=1
28 if USEVARHANDLE: job += arcc.Athena__RootAsciiDumperAlgHandle("rootdumper")
29 else: job += arcc.Athena__RootAsciiDumperAlg ("rootdumper")
30 
31 if not 'EVTMAX' in dir():
32  EVTMAX=-1
33 theApp.EvtMax = EVTMAX
34 
35 if not 'DOWRITE' in dir():
36  DOWRITE=1
37 if DOWRITE:
38  svcMgr += CfgMgr.DecisionSvc()
39  import AthenaRootComps.WriteAthenaRoot as arcw
40  out = arcw.createNtupleOutputStream("StreamD3PD", "d3pd.root", "egamma")
41  out.ItemList += [
42  "el_n",
43  "el_eta",
44  "el_jetcone_dr",
45  ]
46  out.ForceRead = True
47  if DOWRITE>1:
48  # another output stream... with the same content.
49  out = arcw.createNtupleOutputStream("StreamD3PD_2",
50  "d3pd_2.root",
51  "egamma")
52  out.ItemList += [
53  "el_n",
54  "el_eta",
55  "el_jetcone_dr",
56  ]
57  out.ForceRead = True
58 
59  pass
60 
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::split
@ split
Definition: LayerMaterialProperties.h:38