7 from ROOT
import Belle2
9 Makes analysis variables (which can be used in many of the functions defined
10 in :mod:`modularAnalysis`) available to Python.
11 Details can be found in the VariableManager section at https://software.belle2.org/
13 from ROOT
import gSystem
14 gSystem.Load(
'libanalysis.so')
20 def std_vector(*args):
22 Creates an std::vector which can be passed to pyROOT
24 v = ROOT.std.vector(type(args[0]))()
30 def getCommandLineOptions():
31 """ Parses the command line options of the fei and returns the corresponding arguments. """
32 parser = argparse.ArgumentParser()
33 parser.add_argument(
'--no-pager', dest=
'pager', default=
True, action=
'store_false',
34 help=
'Use a pager to show output or print to terminal.')
35 args = parser.parse_args()
39 def printVars(changedVariableNames=None):
41 Print list of all available variables.
44 if changedVariableNames:
45 print(changedVariableNames)
46 print(
'Available variables in Variable::Manager:')
47 allVars = variables.getVariables()
50 vars.append((v.group, v.name, v.description))
54 for (group, name, description)
in sorted(vars):
55 if current_group != group:
58 rows.append([name, description])
59 b2utils.pretty_print_description_list(rows)
64 Return all PSNM trigger bit names
70 size = Belle2.TRGSummary.c_ntrgWords * Belle2.TRGSummary.c_trgWordSize
71 return [bits.getoutbitname(i)
for i
in range(size)
if bits.getoutbitname(i) !=
'']