ATLAS Offline Software
Loading...
Searching...
No Matches
AlgorithmTest.py
Go to the documentation of this file.
9
10
11from AthenaCommon.AlgSequence import AlgSequence
12topSequence = AlgSequence()
13
14# add my Algorithm
15from PyAnalysisExamples.PyAnalysisExamplesConf import AthPyEx__MySelectionAlg
16topSequence += AthPyEx__MySelectionAlg("MySelectionAlg")
17
18# set parameters
19myNewKey = "MyNewCollection"
20MySelectionAlg = topSequence.MySelectionAlg
21MySelectionAlg.ThrPT = 30*GeV
22MySelectionAlg.NewKey = myNewKey
23
24# init application mgr
25theApp.initialize()
26
27# run 1 event
28theApp.nextEvent()
29
30# get transient Electrons which are recorded into SG by MySelectonAlg
31econ = PyParticleTools.getElectrons(myNewKey)
32for ie in range(len(econ)):
33 print ("pt %f" % econ[ie].pt())
34
35# load dict for MyDetObj
36pylcgdict.load_library("libPyAnalysisExamplesDict")
37
38# retrieve an object from DetectorStore
39obj = PyKernel.retrieveDet(g.AthPyEx.MyDetObj,'myDetObj')
40print (obj.name())