Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
python_algorithm.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file python_algorithm.py
1 #!/usr/bin/env python3
2 
3 import acts
4 import acts.examples
5 
6 
7 s = acts.examples.Sequencer(events=1000, numThreads=10, logLevel=acts.logging.VERBOSE)
8 
9 
10 class PyAlg(acts.examples.IAlgorithm):
11  def __init__(self, name, level):
12  acts.examples.IAlgorithm.__init__(self, name, level)
13 
14  # def name(self):
15  # return "PyAlg"
16 
17  def execute(self, context):
18  return acts.examples.ProcessCode.SUCCESS
19 
20 
21 class PyAlg1(acts.examples.IAlgorithm):
22  def name(self):
23  return "PyAlg1"
24 
25  def execute(self, context):
26  print(context.eventStore.exists("blubb"))
27  return acts.examples.ProcessCode.SUCCESS
28 
29 
30 s.addAlgorithm(PyAlg(name="blubb", level=acts.logging.INFO))
31 
32 print("alg go")
33 s.run()