Belle II Software  release-08-01-10
printTOPVariables.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # ---------------------------------------------------------------------
13 # Print all available TOP variables
14 # usage: basf2 top/examples/printTOPVariables.py
15 # ---------------------------------------------------------------------
16 
17 from variables import variables
18 import basf2.utils as b2utils
19 from ROOT import gSystem
20 
21 # load top library
22 gSystem.Load('libtop.so')
23 
24 allVars = variables.getVariables()
25 vars = []
26 for v in allVars:
27  vars.append((v.group, v.name, v.description))
28 
29 rows = []
30 current_group = ''
31 for (group, name, description) in vars:
32  if 'TOP' in group:
33  if current_group != group:
34  current_group = group
35  rows.append([group])
36  rows.append([name, description])
37 
38 b2utils.pretty_print_description_list(rows)