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