public class HFitter extends Object implements Serializable
Constructor and Description |
---|
HFitter()
Create a fitter with the Chi2 method by default.
|
HFitter(String method)
Create a fitter using some method.
|
Modifier and Type | Method and Description |
---|---|
void |
addFunc(String name,
hep.aida.IFunction f)
Add a new function to catalog.
|
void |
doc()
Show online documentation.
|
void |
fit(H1D h1d)
Fit histogram
|
void |
fit(H2D h2d)
Fit H2D histogram
|
void |
fit(P1D p1d)
Fit P1D
|
void |
fit(PND pnd)
Fit PND (all errors set to be zero).
|
String[] |
getFitEngines()
Return available fit engines.
|
String |
getFitMethod()
Returns the current fit method.
|
String[] |
getFitMethods()
Return available fit methods.
|
hep.aida.IFunction |
getFittedFunc()
Get results of the fit in form of function
|
hep.aida.IFitter |
getFitter()
Return Jaida fitter
|
hep.aida.IFunction |
getFunc()
Return function
|
String[] |
getFuncCatalog()
Return list of available functions
|
double |
getPar(String name)
Get parameter value
|
hep.aida.IFitResult |
getResult()
Get result of the fit.
|
void |
setFitMethod(String method)
Sets the fit method.
|
void |
setFunc(hep.aida.IFunction func)
Set fit functions
|
void |
setFunc(String func)
Set fit functions from predefined string.
|
void |
setFunc(String name,
int dimension,
String function,
String parameters)
Set functions from a script.
|
void |
setPar(String name,
double value)
Set parameter to a value
|
void |
setParConstraint(String constraint)
Set parameter constraint Example: Set parameter "mean1" to be identical
to "mean2" as: "mean1=mean2"
|
void |
setParFixed(String name)
Fix a given parameter to a constant value
|
void |
setParFixed(String name,
boolean fix)
Fix a given parameter to a constant value or not
|
void |
setParRange(String name,
double min,
double max)
Set range for parameter during the fit
|
void |
setParStep(String name,
double step)
Set step size for parameter (say 0.01)
|
void |
setRange(double rmin,
double rmax)
Set range for fitting for 1D objects (H1D, P1D)
|
public HFitter(String method)
When a function is provided to the fitter the user has to be aware that the AIDA prescription is to leave the input function unchanged, create a clone, do the fit on the clone and return the clone in the fit result. There advantage to this approach is that the input function can be reused as is for multiple identical fits while the fitted-cloned function is left unchanged in the fit result. The default is noClone=false.
method
- the fit method (Could be: uml, leastsquares, cleverchi2, chi2,
bml)public HFitter()
public String[] getFitMethods()
public String getFitMethod()
public void setFitMethod(String method)
The
- fit method.public void addFunc(String name, hep.aida.IFunction f)
name
- function namef
- input functionpublic String[] getFitEngines()
public void setFunc(hep.aida.IFunction func)
public String[] getFuncCatalog()
public void setFunc(String func)
func
- string: G (Gaussian),E (exponential),landau (landa),pow (power
law), and polynomial: P0,P1,P2,P3..public double getPar(String name)
name
- parameter namepublic void setPar(String name, double value)
name
- parameter namevalue
- value to be set.public void setParStep(String name, double step)
name
- parameter namestep
- step used in minimizationpublic void setParFixed(String name)
name
- parameter name to be fixedpublic void setParFixed(String name, boolean fix)
name
- parameter name to be fixed or notfix
- true if the parameter should be fixed.public void setParRange(String name, double min, double max)
name
- parameter namemin
- min valuemax
- max valuepublic void setParConstraint(String constraint)
constraint
- public hep.aida.IFunction getFunc()
public void setFunc(String name, int dimension, String function, String parameters)
name
- function namedimension
- dimensionfunction
- string representing a functionparameters
- parameters (use comma)public void fit(H1D h1d)
h1d
- input H1Dpublic void fit(P1D p1d)
p1d
- input P1Dpublic void fit(PND pnd)
pnd
- input P1Dpublic void fit(H2D h2d)
h2d
- input H2D histogrampublic void setRange(double rmin, double rmax)
rmin
- Min X valuermax
- Max Y valuepublic hep.aida.IFitter getFitter()
public hep.aida.IFunction getFittedFunc()
public hep.aida.IFitResult getResult()
public void doc()
Jas4pp 1.5 © Java Analysis Studio for Particle Physics