ATLAS Offline Software
run.py
Go to the documentation of this file.
1 # run.py
2 #
3 # David Adams
4 # January 2014
5 #
6 # Example job option for running demo tools from Athena.
7 #
8 # Run with
9 # > athena.py run.py
10 #
11 
12 # Specify input file.
13 infile = "/afs/cern.ch/user/d/dadams/pubdata/xaod_jetclusters.root"
14 
15 #--------------------------------------------------------------
16 # Input stream
17 #--------------------------------------------------------------
18 
19 from AthenaCommon.AppMgr import ServiceMgr
20 import AthenaPoolCnvSvc.ReadAthenaPool
21 ServiceMgr.EventSelector.InputCollections = [infile]
22 
23 #--------------------------------------------------------------
24 # Event related parameters
25 #--------------------------------------------------------------
26 
27 # Number of events to be processed (default is until the end of
28 # input, or -1, however, since we have no input, a limit needs
29 # to be set explicitly, here, choose 10)
30 theApp.EvtMax = 5
31 
32 #--------------------------------------------------------------
33 # Configure algorithm.
34 #--------------------------------------------------------------
35 
36 # Allow messge service more than default 500 lines.
37 ServiceMgr.MessageSvc.infoLimit = 10000
38 
39 # Full job is a list of algorithms
40 from AthenaCommon.AlgSequence import AlgSequence
41 job = AlgSequence()
42 
43 # Add the algorithm. It runs the demo tools.
44 from AsgExampleTools.AsgExampleToolsConf import AsgExampleAlgorithm
45 job += AsgExampleAlgorithm("halg")
46 halg = job.halg
47 halg.OutputLevel = INFO
48 
49 #--------------------------------------------------------------
50 # Configure tools.
51 #--------------------------------------------------------------
52 
53 if 1:
54  from AsgExampleTools.AsgExampleToolsConf import AsgHelloTool
55  ToolSvc += AsgHelloTool("atool")
56  atool = ToolSvc.atool
57  atool.Message = "Hello from my Athena tool."
58  atool.OutputLevel = VERBOSE
59  halg.Tools += [atool]
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7