ATLAS Offline Software
Loading...
Searching...
No Matches
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
3import os
4from AthenaCommon.Utils import unixtools
5
6if 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
11if not isinstance(FNAMES, (list,tuple)):
12 FNAMES = [FNAMES]
13 pass
14
15if not 'TUPLENAME' in dir():
16 TUPLENAME = 'egamma'
17
18import AthenaRootComps.ReadAthenaRoot
19svcMgr.EventSelector.InputCollections = FNAMES
20svcMgr.EventSelector.TupleName = TUPLENAME
21
22from AthenaCommon.AlgSequence import AlgSequence
23job = AlgSequence()
24
25import AthenaRootComps.AthenaRootCompsConf as arcc
26if not 'USEVARHANDLE' in dir():
27 USEVARHANDLE=1
28if USEVARHANDLE: job += arcc.Athena__RootAsciiDumperAlgHandle("rootdumper")
29else: job += arcc.Athena__RootAsciiDumperAlg ("rootdumper")
30
31if not 'EVTMAX' in dir():
32 EVTMAX=-1
33theApp.EvtMax = EVTMAX
34
35if not 'DOWRITE' in dir():
36 DOWRITE=1
37if 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
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177