hep.aida.ref.function
Class FunctionFactory
- java.lang.Object
-
- hep.aida.ref.function.FunctionFactory
-
- All Implemented Interfaces:
- IFunctionFactory
public class FunctionFactory extends java.lang.Object implements IFunctionFactory
-
-
Constructor Summary
Constructors Constructor and Description FunctionFactory(ITree tree)Create a new FunctionFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description IFunctionCatalogcatalog()get access to the function catalogIFunctioncloneFunction(java.lang.String path, IFunction f)Create a clone of an existing function.IFunctioncreateFunctionByName(java.lang.String path, java.lang.String model)Create function from a name registered in the catalog.IFunctioncreateFunctionFromScript(java.lang.String path, int dim, java.lang.String valexpr, java.lang.String parameters, java.lang.String description)Create function from script.IFunctioncreateFunctionFromScript(java.lang.String path, int dim, java.lang.String valexpr, java.lang.String parameters, java.lang.String description, java.lang.String gradexpr)Create function from script.
-
-
-
Constructor Detail
-
FunctionFactory
public FunctionFactory(ITree tree)
Create a new FunctionFactory. This constructor is used by AnalysisFactory, the Master Factory.- Parameters:
tree- the ITree where the histogram is added.
-
-
Method Detail
-
createFunctionByName
public IFunction createFunctionByName(java.lang.String path, java.lang.String model)
Create function from a name registered in the catalog. This is the easiest way to create simple model functions for fitting. Every AIDA compliant implementation should predefine "G", "E", "Pn" (n is an integer, e.e "P0","P5"). Simple operations are permitted, e.g. "G+P2".- Specified by:
createFunctionByNamein interfaceIFunctionFactory- Parameters:
path- The path of the IFunction. The path can either be a relative or full path. ("/folder1/folder2/functionName" and "../folder/functionName" are valid paths). All the directories in the path must exist. The characther `/` cannot be used in names; it is only used to delimit directories within paths.model- The model of the function to be created.- Returns:
- The newly created function.
-
createFunctionFromScript
public IFunction createFunctionFromScript(java.lang.String path, int dim, java.lang.String valexpr, java.lang.String parameters, java.lang.String description)
Create function from script. Script conventions: example: createFunctionFromScript(2, "a*x[0]*x[0] + b*x[1]", "a,b", "this is my function", "2*a*x[0],b")- Specified by:
createFunctionFromScriptin interfaceIFunctionFactorydim- The dimension of the function, i.e. the number of variables.valexpr- The expression of the scripted function.parameters- A comma separeted list of what has to be considered as a parameter in the valexpr expression.description- The description of the function.- Returns:
- The newly created function
-
createFunctionFromScript
public IFunction createFunctionFromScript(java.lang.String path, int dim, java.lang.String valexpr, java.lang.String parameters, java.lang.String description, java.lang.String gradexpr)
Create function from script. Script conventions: example: createFunctionFromScript(2, "a*x[0]*x[0] + b*x[1]", "a,b", "this is my function", "2*a*x[0],b")- Specified by:
createFunctionFromScriptin interfaceIFunctionFactorydim- The dimension of the function, i.e. the number of variables.valexpr- The expression of the scripted function.parameters- A comma separeted list of what has to be considered as a parameter in the valexpr expression.description- The description of the function.gradexpr- A comma separated list of the expressions for the derivatives of the function with respect to the parameters.- Returns:
- The newly created function
-
cloneFunction
public IFunction cloneFunction(java.lang.String path, IFunction f)
Description copied from interface:IFunctionFactoryCreate a clone of an existing function.- Specified by:
cloneFunctionin interfaceIFunctionFactory- Parameters:
path- The path of the IFunction. The path can either be a relative or full path. ("/folder1/folder2/functionName" and "../folder/functionName" are valid paths). All the directories in the path must exist. The characther `/` cannot be used in names; it is only used to delimit directories within paths.f- The IFunction to be cloned.- Returns:
- The clone of the provided IFunction.
-
catalog
public IFunctionCatalog catalog()
get access to the function catalog- Specified by:
catalogin interfaceIFunctionFactory
-
-
DMelt 3.0 © DataMelt by jWork.ORG