ATLAS Offline Software
Loading...
Searching...
No Matches
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.
13infile = "/afs/cern.ch/user/d/dadams/pubdata/xaod_jetclusters.root"
14
15#--------------------------------------------------------------
16# Input stream
17#--------------------------------------------------------------
18
19from AthenaCommon.AppMgr import ServiceMgr
20import AthenaPoolCnvSvc.ReadAthenaPool
21ServiceMgr.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)
30theApp.EvtMax = 5
31
32#--------------------------------------------------------------
33# Configure algorithm.
34#--------------------------------------------------------------
35
36# Allow messge service more than default 500 lines.
37ServiceMgr.MessageSvc.infoLimit = 10000
38
39# Full job is a list of algorithms
40from AthenaCommon.AlgSequence import AlgSequence
41job = AlgSequence()
42
43# Add the algorithm. It runs the demo tools.
44from AsgExampleTools.AsgExampleToolsConf import AsgExampleAlgorithm
45job += AsgExampleAlgorithm("halg")
46halg = job.halg
47halg.OutputLevel = INFO
48
49#--------------------------------------------------------------
50# Configure tools.
51#--------------------------------------------------------------
52
53if 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]