Belle II Software development
caf_state_machine.py
1
8import basf2 as b2
9from ROOT.Belle2 import TestCalibrationAlgorithm as TestAlgo
10from caf.state_machines import CalibrationMachine
11from caf.framework import Calibration
12
13alg = TestAlgo()
14cal1 = Calibration('TestCalibrationClass1', "CaTest", alg, '/path/to/file.root')
15cal2 = Calibration('TestCalibrationClass2', "CaTest", alg, '/path/to/file.root')
16
17cm1 = CalibrationMachine(cal1)
18cm1.save_graph("calibration_graph.dot", "CalibrationMachine")
19
20b2.B2INFO("Currently in " + cm1.state.name + " state.")
21cm1.submit_collector(msg_before="About to submit", msg_after="Now submitted")
22cm1.complete(msg_before="Finishing", msg_after="Collector finished")
23b2.B2INFO("Currently in " + cm1.state.name + " state.")