Added new functions invloving combiKT.

This commit is contained in:
2013-09-09 10:02:09 +00:00
parent bd551d13ac
commit e1d99a07cb
7 changed files with 265 additions and 80 deletions

View File

@@ -42,6 +42,7 @@
ClassImp(TBNMR) // for the ROOT-dictionary
ClassImp(ExpRlx)
ClassImp(SExpRlx)
ClassImp(MLRes)
double TBNMR::operator()(double x, const vector<double> &par) const {
assert(par.size()==1); // make sure the number of parameters handed to the function is correct
@@ -102,3 +103,31 @@ double SExpRlx::operator()(double x, const vector<double> &par) const {
return y;
}
double MLRes::operator()(double x, const vector<double> &par) const {
assert(par.size()==3); // make sure the number of parameters handed to the function is correct
// par[0] time of beam off
// par[1] is the relaxation rate
// par[2] is the exponent
double tau_p;
double y;
tau_p = (tau_Li/(1.+par[1]*tau_Li));
if ( x >= 0 && x <= par[0] ) {
TF1 sexp("sexp", "exp(-([0]-x)/[3])*exp(-pow(([1]*([0]-x)),[2]))", 0.0, 10000.0);
sexp.SetParameters(x, par[1], par[2],tau_Li);
sexp.SetNpx(1000);
y=sexp.Integral(0.0,x)/(1-exp(-x/tau_Li))/tau_Li;
} else if ( x > par[0] ) {
TF1 sexp("sexp", "exp(-([3]-x)/[4])*exp(-pow(([1]*([0]-x)),[2]))", 0.0, 10000.0);
sexp.SetParameters(x, par[1], par[2], par[0],tau_Li);
sexp.SetNpx(1000);
y=sexp.Integral(0.0,par[0])/(1-exp(-x/tau_Li))/tau_Li;
} else {
y = 0;
}
return y;
}

View File

@@ -90,3 +90,21 @@ public:
// definition of the class for the ROOT-dictionary
ClassDef(SExpRlx,1)
};
class MLRes : public PUserFcnBase {
public:
// default constructor and destructor
MLRes(){}
~MLRes(){}
Bool_t NeedGlobalPart() const { return false; }
void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
Bool_t GlobalPartIsValid() const { return true; }
// function operator
double operator()(double, const vector<double>&) const;
// definition of the class for the ROOT-dictionary
ClassDef(MLRes,1)
};

View File

@@ -38,5 +38,6 @@
#pragma link C++ class TBNMR+;
#pragma link C++ class ExpRlx+;
#pragma link C++ class SExpRlx+;
#pragma link C++ class MLRes+;
#endif //__CINT__