|
musrfit 1.10.0
|
Example user function implementing a third-order polynomial. More...
#include <PUserFcn.h>


Public Member Functions | |
| PUserFcn () | |
| Default constructor. | |
| ~PUserFcn () | |
| Destructor. | |
| Double_t | operator() (Double_t t, const std::vector< Double_t > ¶m) const |
| Evaluates the third-order polynomial at time t. | |
Public Member Functions inherited from PUserFcnBase | |
| PUserFcnBase () | |
| Default constructor. | |
| virtual | ~PUserFcnBase () |
| Virtual destructor. | |
| virtual Bool_t | NeedGlobalPart () const |
| virtual void | SetGlobalPart (std::vector< void * > &globalPart, UInt_t idx) |
| virtual Bool_t | GlobalPartIsValid () const |
Example user function implementing a third-order polynomial.
PUserFcn demonstrates how to create custom theory functions by deriving from PUserFcnBase. This example implements a cubic polynomial:
![\[ P(t) = a_0 + a_1 t + a_2 t^2 + a_3 t^3 \]](form_43.png)
where 
To use this function in your analysis:
Polynomial backgrounds are useful for:
This class serves as a minimal working example for creating custom user functions. To create your own:
Definition at line 85 of file PUserFcn.h.
| PUserFcn::PUserFcn | ( | ) |
| PUserFcn::~PUserFcn | ( | ) |
Destructor.
Destructor for PUserFcn.
Cleans up any resources allocated by the polynomial function. Since this implementation has no dynamically allocated resources, the destructor is empty.
Definition at line 65 of file PUserFcn.cpp.
|
virtual |
Evaluates the third-order polynomial at time t.
Evaluates the third-order polynomial at the given time.
Computes:
![\[ P(t) = \texttt{param[0]} + \texttt{param[1]} \cdot t
+ \texttt{param[2]} \cdot t^2 + \texttt{param[3]} \cdot t^3 \]](form_45.png)
| t | Time value (typically in microseconds) |
| param | Vector of polynomial coefficients:
|
Computes a cubic polynomial of the form:
![\[ P(t) = c_0 + c_1 t + c_2 t^2 + c_3 t^3 = \sum_{k=0}^{3} c_k t^k \]](form_188.png)
where the coefficients 
| t | Independent variable (time in μs for μSR, or general x-axis value for non-μSR fits) |
| param | Vector containing exactly 4 polynomial coefficients:
|

Implements PUserFcnBase.
Definition at line 114 of file PUserFcn.cpp.