THIS PAGE IS UNDER CONSTRUCTION
AIDA for Power Users
...
Code Block |
---|
from hep.aida import IFunction
from org.lcsim.util.aida import AIDATutorialAIDA
import math
class MyFunc(IFunction):
def __init__(self, track):
self.title = "My Own Function"
return
def providesGradient(self):
return false
# This Function returns the value f(x)
# x can be multi-dimensional
def value(self, x):
y = x[0] + math.exp(x[1]) + x[0]*x[1]
externalValue = AIDATutorial.someExternalFunction(y, x)
return externalValue-y
# This tells AIDA the dimension of the function
def dimension(self):
return 2
def annotation(self):
ann = IAnnotation()
ann.addItem('Title', self.title)
return ann
|
Code Block |
---|
h2. Tuples
h3. Flat Tuples
h3. Nested Tuples
|
- AIDATutorial.py
- this is a comment
...
def someExternalFunction(y, x): |
...
return 2*y+3*x[0]
def main():
tree = aidaMasterTree
aida = AIDA.defaultInstance()
funcFac = aida.analysisFactory().createFunctionFactory(tree)
|
Tuples
Flat Tuples
Nested Tuples