Belle II Software  release-05-01-25
caf_simplest.py
1 # This steering file shows pretty much the most minimal setup for
2 # running the CAF. You will need to have data already from running
3 # calibration/examples/1_create_sample_DSTs.sh or just make your own
4 # and change the input data below.
5 
6 import basf2 as b2
7 
8 import os
9 import sys
10 
11 from ROOT.Belle2 import TestCalibrationAlgorithm
12 from caf.framework import Calibration, CAF
13 
14 b2.set_log_level(b2.LogLevel.INFO)
15 
16 
17 def main(argv):
18  if len(argv) == 1:
19  data_dir = argv[0]
20  else:
21  print("Usage: basf2 CAF_simplest.py <data directory>")
22  sys.exit(1)
23 
24 
29  input_files_test = []
30  input_files_test.append(os.path.join(os.path.abspath(data_dir), '*.root'))
31 
32 
34  alg_test = TestCalibrationAlgorithm() # Getting a calibration algorithm instance
35 
36  # Create a single calibration from a collector module name + algorithm + input files
37  cal_test = Calibration(name="TestCalibration", collector="CaTest", algorithms=alg_test, input_files=input_files_test)
38 
39 
41  cal_fw = CAF()
42  cal_fw.add_calibration(cal_test)
43  cal_fw.run()
44  print("End of CAF processing.")
45 
46 
47 if __name__ == "__main__":
48  main(sys.argv[1:])
main
int main(int argc, char **argv)
Run all tests.
Definition: test_main.cc:77
Calibration
Definition: Calibration.py:1