11 from variables
import printVars
12 from variables
import std_vector
13 from variables
import variables
as v
18 assert len(v.getVariables()) > 0
22 var = v.getVariable(
'M')
23 assert 'M' == var.name
24 print(var.description)
26 v.addAlias(
'sigProb',
'extraInfo(SignalProbability)')
27 var = v.getVariable(
'sigProb')
28 assert 'extraInfo(SignalProbability)' == var.name
30 assert (v.evaluate(
'constant(123)', ROOT.nullptr) - 123) < 0.001
32 v.addAlias(
'anotherAlias',
'daughter(1, p)')
34 for vn
in v.getAliasNames():
35 assert (vn ==
'sigProb' or vn ==
'anotherAlias')
37 v.addAlias(
'formulaAlias',
'abs(3**2)')
38 assert v.evaluate(
'formulaAlias', ROOT.nullptr) == 9.0
41 assert 'extraInfo__boSignalProbability__bc' == ROOT.Belle2.MakeROOTCompatible.makeROOTCompatible(
'extraInfo(SignalProbability)')
42 assert 'extraInfo(SignalProbability)' == ROOT.Belle2.MakeROOTCompatible.invertMakeROOTCompatible(
43 'extraInfo__boSignalProbability__bc')
45 v.addCollection(
'kin', std_vector(
'p',
'px',
'py',
'pz'))
46 vec = v.getCollection(
'kin')