Cleaned up libBNMR a bit.
This commit is contained in:
parent
52ecd62c90
commit
e73ded0078
16
src/external/libBNMR/TBNMR.cpp
vendored
16
src/external/libBNMR/TBNMR.cpp
vendored
@ -39,20 +39,10 @@
|
|||||||
#define PI 3.14159265358979323846
|
#define PI 3.14159265358979323846
|
||||||
#define TWOPI 6.28318530717958647692
|
#define TWOPI 6.28318530717958647692
|
||||||
|
|
||||||
ClassImp(TBNMR) // for the ROOT-dictionary
|
ClassImp(ExpRlx) // for the ROOT-dictionary
|
||||||
ClassImp(ExpRlx)
|
|
||||||
ClassImp(SExpRlx)
|
ClassImp(SExpRlx)
|
||||||
ClassImp(MLRes)
|
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
|
|
||||||
|
|
||||||
double arg(par[0]*x);
|
|
||||||
|
|
||||||
if(!arg)
|
|
||||||
return 1.0;
|
|
||||||
return sin(arg)/arg;
|
|
||||||
}
|
|
||||||
|
|
||||||
double ExpRlx::operator()(double x, const vector<double> &par) const {
|
double ExpRlx::operator()(double x, const vector<double> &par) const {
|
||||||
assert(par.size()==2); // make sure the number of parameters handed to the function is correct
|
assert(par.size()==2); // make sure the number of parameters handed to the function is correct
|
||||||
@ -81,10 +71,8 @@ double SExpRlx::operator()(double x, const vector<double> &par) const {
|
|||||||
// par[0] time of beam off
|
// par[0] time of beam off
|
||||||
// par[1] is the relaxation rate
|
// par[1] is the relaxation rate
|
||||||
// par[2] is the exponent
|
// par[2] is the exponent
|
||||||
double tau_p;
|
|
||||||
double y;
|
|
||||||
|
|
||||||
tau_p = (tau_Li/(1.+par[1]*tau_Li));
|
double y;
|
||||||
|
|
||||||
|
|
||||||
if ( x >= 0 && x <= par[0] ) {
|
if ( x >= 0 && x <= par[0] ) {
|
||||||
|
22
src/external/libBNMR/TBNMR.h
vendored
22
src/external/libBNMR/TBNMR.h
vendored
@ -35,25 +35,11 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#ifndef LIBBNMRH
|
||||||
|
#define LIBBNMRH
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
class TBNMR : public PUserFcnBase {
|
|
||||||
|
|
||||||
public:
|
|
||||||
// default constructor and destructor
|
|
||||||
TBNMR(){}
|
|
||||||
~TBNMR(){}
|
|
||||||
|
|
||||||
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(TBNMR,1)
|
|
||||||
};
|
|
||||||
|
|
||||||
class ExpRlx : public PUserFcnBase {
|
class ExpRlx : public PUserFcnBase {
|
||||||
|
|
||||||
@ -108,3 +94,5 @@ public:
|
|||||||
// definition of the class for the ROOT-dictionary
|
// definition of the class for the ROOT-dictionary
|
||||||
ClassDef(MLRes,1)
|
ClassDef(MLRes,1)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif //LIBBNMRH
|
1
src/external/libBNMR/TBNMRLinkDef.h
vendored
1
src/external/libBNMR/TBNMRLinkDef.h
vendored
@ -35,7 +35,6 @@
|
|||||||
#pragma link off all classes;
|
#pragma link off all classes;
|
||||||
#pragma link off all functions;
|
#pragma link off all functions;
|
||||||
|
|
||||||
#pragma link C++ class TBNMR+;
|
|
||||||
#pragma link C++ class ExpRlx+;
|
#pragma link C++ class ExpRlx+;
|
||||||
#pragma link C++ class SExpRlx+;
|
#pragma link C++ class SExpRlx+;
|
||||||
#pragma link C++ class MLRes+;
|
#pragma link C++ class MLRes+;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user