diff --git a/inc/adani/CoefficientFunction.h b/inc/adani/CoefficientFunction.h index e71e156..f2faa4b 100644 --- a/inc/adani/CoefficientFunction.h +++ b/inc/adani/CoefficientFunction.h @@ -69,11 +69,6 @@ class CoefficientFunction { char GetKind() const { return kind_; }; char GetChannel() const { return channel_; }; - // set methods - void SetOrder(const int &order); - void SetKind(const char &kind); - void SetChannel(const char &channel); - private: int order_; // order = 1, 2, or 3 char kind_; // kind_ = '2' for F2 and 'L' for FL diff --git a/inc/adani/Convolution.h b/inc/adani/Convolution.h index b1f1380..3c499a5 100644 --- a/inc/adani/Convolution.h +++ b/inc/adani/Convolution.h @@ -60,11 +60,6 @@ class AbstractConvolution { CoefficientFunction *GetCoeffFunc() const { return coefffunc_; }; AbstractSplittingFunction *GetSplitFunc() const { return splitfunc_; }; - // set methods - void SetAbserr(const double &abserr); - void SetRelerr(const double &relerr); - void SetDim(const int &dim); - private: double abserr_; double relerr_; diff --git a/inc/adani/HighEnergyCoefficientFunction.h b/inc/adani/HighEnergyCoefficientFunction.h index 0d85eb8..d44e291 100644 --- a/inc/adani/HighEnergyCoefficientFunction.h +++ b/inc/adani/HighEnergyCoefficientFunction.h @@ -43,9 +43,6 @@ class AbstractHighEnergyCoefficientFunction : public CoefficientFunction { // get methods bool GetNLL() const { return NLL_; }; - // set methods - void SetNLL(const bool &NLL) { NLL_ = NLL; }; - private: bool NLL_; diff --git a/src/CoefficientFunction.cc b/src/CoefficientFunction.cc index c5d91c8..10d6947 100644 --- a/src/CoefficientFunction.cc +++ b/src/CoefficientFunction.cc @@ -11,48 +11,20 @@ CoefficientFunction::CoefficientFunction( const int &order, const char &kind, const char &channel ) { - SetOrder(order); - SetKind(kind); - SetChannel(channel); -} - -//==========================================================================================// -// CoefficientFunction: destructor -//------------------------------------------------------------------------------------------// - -CoefficientFunction::~CoefficientFunction(){}; - -//==========================================================================================// -// CoefficientFunction: set method for order: order = 1, 2, 3 -//------------------------------------------------------------------------------------------// - -void CoefficientFunction::SetOrder(const int &order) { // check order if (order < 1 || order > 3) { cout << "Error: order must be 1, 2 or 3. Got: " << order << endl; exit(-1); } order_ = order; -} -//==========================================================================================// -// CoefficientFunction: set method for kind: kind = '2', 'L' -//------------------------------------------------------------------------------------------// - -void CoefficientFunction::SetKind(const char &kind) { // check kind if (kind != '2' && kind != 'L') { cout << "Error: kind must be 2 or L. Got: " << kind << endl; exit(-1); } kind_ = kind; -} -//==========================================================================================// -// CoefficientFunction: set method for channel: channel = 'g', 'q' -//------------------------------------------------------------------------------------------// - -void CoefficientFunction::SetChannel(const char &channel) { // check channel if (channel != 'g' && channel != 'q') { cout << "Error: channel must be g or q. Got: " << channel << endl; @@ -64,8 +36,16 @@ void CoefficientFunction::SetChannel(const char &channel) { exit(-1); } channel_ = channel; + } +//==========================================================================================// +// CoefficientFunction: destructor +//------------------------------------------------------------------------------------------// + +CoefficientFunction::~CoefficientFunction(){}; + + //==========================================================================================// // CoefficientFunction: central value of fx //------------------------------------------------------------------------------------------// diff --git a/src/Convolution.cc b/src/Convolution.cc index 2ef6315..61a93fa 100644 --- a/src/Convolution.cc +++ b/src/Convolution.cc @@ -17,64 +17,43 @@ AbstractConvolution::AbstractConvolution( CoefficientFunction *coefffunc, AbstractSplittingFunction *splitfunc, const double &abserr, const double &relerr, const int &dim ) { - abserr_ = abserr; - relerr_ = relerr; - dim_ = dim; - - w_ = gsl_integration_workspace_alloc(dim); - - coefffunc_ = coefffunc; - splitfunc_ = splitfunc; -} - -//==========================================================================================// -// AbstractConvolution: destructor -//------------------------------------------------------------------------------------------// - -AbstractConvolution::~AbstractConvolution() { - gsl_integration_workspace_free(w_); -}; - -//==========================================================================================// -// AbstractConvolution: set method for abserr -//------------------------------------------------------------------------------------------// - -void AbstractConvolution::SetAbserr(const double &abserr) { // check abserr if (abserr <= 0) { cout << "Error: abserr must be positive. Got " << abserr << endl; exit(-1); } abserr_ = abserr; -} -//==========================================================================================// -// AbstractConvolution: set method for relerr -//------------------------------------------------------------------------------------------// - -void AbstractConvolution::SetRelerr(const double &relerr) { // check relerr if (relerr <= 0) { cout << "Error: relerr must be positive. Got " << relerr << endl; exit(-1); } relerr_ = relerr; -} -//==========================================================================================// -// AbstractConvolution: set method for dim -//------------------------------------------------------------------------------------------// - -void AbstractConvolution::SetDim(const int &dim) { // check dim if (dim <= 0) { cout << "Error: dim must be positive. Got " << dim << endl; exit(-1); } dim_ = dim; + + w_ = gsl_integration_workspace_alloc(dim); + + coefffunc_ = coefffunc; + splitfunc_ = splitfunc; } +//==========================================================================================// +// AbstractConvolution: destructor +//------------------------------------------------------------------------------------------// + +AbstractConvolution::~AbstractConvolution() { + + gsl_integration_workspace_free(w_); +}; + //==========================================================================================// // AbstractConvolution: convolute splitting function with coefficient function //------------------------------------------------------------------------------------------// diff --git a/src/HighEnergyCoefficientFunction.cc b/src/HighEnergyCoefficientFunction.cc index 1dacb27..465f176 100644 --- a/src/HighEnergyCoefficientFunction.cc +++ b/src/HighEnergyCoefficientFunction.cc @@ -16,7 +16,7 @@ AbstractHighEnergyCoefficientFunction::AbstractHighEnergyCoefficientFunction( ) : CoefficientFunction(order, kind, channel) { - SetNLL(NLL); + NLL_ = NLL; } //==========================================================================================//