Belle II Software development
PythonVariableManager Class Reference

Public Member Functions

def getVariable (self, *args)
 
def getVariables (self, *args)
 
def addAlias (self, alias, variable)
 
def printAliases (self)
 
def clearAliases (self)
 
def resolveAlias (self, alias)
 
def addCollection (self, *args)
 
def getCollection (self, collection)
 
def resolveCollections (self, *args)
 
def checkDeprecatedVariable (self, variable)
 
def evaluate (self, variable, particle)
 
def getNames (self)
 
def getAliasNames (self)
 
def assertValidName (self, variable)
 

Protected Member Functions

def _instance (self)
 

Detailed Description

Wrapper around the variable manager class.
This is necessary for avoiding to import ROOT globally when 'variables' is imported.

Definition at line 13 of file __init__.py.

Member Function Documentation

◆ _instance()

def _instance (   self)
protected
Return an instance to the variable manager.

Definition at line 20 of file __init__.py.

20 def _instance(self):
21 '''
22 Return an instance to the variable manager.
23 '''
24 # Always avoid the top-level 'import ROOT'.
25 import ROOT # noqa
26 instance = ROOT.Belle2.Variable.Manager.Instance()
27 return instance
28

◆ addAlias()

def addAlias (   self,
  alias,
  variable 
)
Wrapper around Manager::addAlias(const std::string& alias, const std::string& variable).

Definition at line 45 of file __init__.py.

45 def addAlias(self, alias, variable):
46 '''
47 Wrapper around Manager::addAlias(const std::string& alias, const std::string& variable).
48 '''
49 instance = PythonVariableManager._instance()
50 assert(instance.addAlias(alias, variable))
51 return alias
52

◆ addCollection()

def addCollection (   self,
args 
)
Wrapper around Manager::addCollection(const std::string& collection, const std::vector<std::string>& variables)

Definition at line 74 of file __init__.py.

74 def addCollection(self, *args):
75 '''
76 Wrapper around Manager::addCollection(const std::string& collection, const std::vector<std::string>& variables)
77 '''
78 instance = PythonVariableManager._instance()
79 assert(instance.addCollection(*args))
80

◆ assertValidName()

def assertValidName (   self,
  variable 
)
Wrapper around Manager::assertValidName(const std::string& name).

Definition at line 123 of file __init__.py.

123 def assertValidName(self, variable):
124 '''
125 Wrapper around Manager::assertValidName(const std::string& name).
126 '''
127 instance = PythonVariableManager._instance()
128 instance.assertValidName(variable)
129
130

◆ checkDeprecatedVariable()

def checkDeprecatedVariable (   self,
  variable 
)
Wrapper around Manager::checkDeprecatedVariable(const std::string& name).

Definition at line 95 of file __init__.py.

95 def checkDeprecatedVariable(self, variable):
96 '''
97 Wrapper around Manager::checkDeprecatedVariable(const std::string& name).
98 '''
99 instance = PythonVariableManager._instance()
100 instance.checkDeprecatedVariable(variable)
101

◆ clearAliases()

def clearAliases (   self)
Wrapper around Manager::clearAliases().

Definition at line 60 of file __init__.py.

60 def clearAliases(self):
61 '''
62 Wrapper around Manager::clearAliases().
63 '''
64 instance = PythonVariableManager._instance()
65 instance.clearAliases()
66

◆ evaluate()

def evaluate (   self,
  variable,
  particle 
)
Wrapper around Manager::evaluate(const std::string& varName, const Particle* p).

Definition at line 102 of file __init__.py.

102 def evaluate(self, variable, particle):
103 '''
104 Wrapper around Manager::evaluate(const std::string& varName, const Particle* p).
105 '''
106 instance = PythonVariableManager._instance()
107 return instance.evaluate(variable, particle)
108

◆ getAliasNames()

def getAliasNames (   self)
Wrapper around Manager::getAliasNames().

Definition at line 116 of file __init__.py.

116 def getAliasNames(self):
117 '''
118 Wrapper around Manager::getAliasNames().
119 '''
120 instance = PythonVariableManager._instance()
121 return instance.getAliasNames()
122

◆ getCollection()

def getCollection (   self,
  collection 
)
Wrapper around Manager::getCollection(const std::string& collection).

Definition at line 81 of file __init__.py.

81 def getCollection(self, collection):
82 '''
83 Wrapper around Manager::getCollection(const std::string& collection).
84 '''
85 instance = PythonVariableManager._instance()
86 return instance.getCollection(collection)
87

◆ getNames()

def getNames (   self)
Wrapper around Manager::getNames().

Definition at line 109 of file __init__.py.

109 def getNames(self):
110 '''
111 Wrapper around Manager::getNames().
112 '''
113 instance = PythonVariableManager._instance()
114 return instance.getNames()
115

◆ getVariable()

def getVariable (   self,
args 
)
Wrapper around Manager::getVariable(std::string name) and
Manager::getVariable(const std::string& functionName, const std::vector<std::string>& functionArguments).

Definition at line 29 of file __init__.py.

29 def getVariable(self, *args):
30 '''
31 Wrapper around Manager::getVariable(std::string name) and
32 Manager::getVariable(const std::string& functionName, const std::vector<std::string>& functionArguments).
33 '''
34 instance = PythonVariableManager._instance()
35 return instance.getVariable(*args)
36

◆ getVariables()

def getVariables (   self,
args 
)
Wrapper around Manager::getVariables(const std::vector<std::string>& variables) and
Manager::getVariables().

Definition at line 37 of file __init__.py.

37 def getVariables(self, *args):
38 '''
39 Wrapper around Manager::getVariables(const std::vector<std::string>& variables) and
40 Manager::getVariables().
41 '''
42 instance = PythonVariableManager._instance()
43 return instance.getVariables(*args)
44

◆ printAliases()

def printAliases (   self)
Wrapper around Manager::printAliases().

Definition at line 53 of file __init__.py.

53 def printAliases(self):
54 '''
55 Wrapper around Manager::printAliases().
56 '''
57 instance = PythonVariableManager._instance()
58 instance.printAliases()
59

◆ resolveAlias()

def resolveAlias (   self,
  alias 
)
Wrapper around Manager::resolveAlias(const std::string& alias).

Definition at line 67 of file __init__.py.

67 def resolveAlias(self, alias):
68 '''
69 Wrapper around Manager::resolveAlias(const std::string& alias).
70 '''
71 instance = PythonVariableManager._instance()
72 return instance.resolveAlias(alias)
73

◆ resolveCollections()

def resolveCollections (   self,
args 
)
Wrapper around Manager::resolveCollections(const std::vector<std::string>& variables).

Definition at line 88 of file __init__.py.

88 def resolveCollections(self, *args):
89 '''
90 Wrapper around Manager::resolveCollections(const std::vector<std::string>& variables).
91 '''
92 instance = PythonVariableManager._instance()
93 return instance.resolveCollections(*args)
94

The documentation for this class was generated from the following file: