diff --git a/lib/Physics/CorrelatorFitter.cpp b/lib/Physics/CorrelatorFitter.cpp index d48699f..c997272 100644 --- a/lib/Physics/CorrelatorFitter.cpp +++ b/lib/Physics/CorrelatorFitter.cpp @@ -23,6 +23,9 @@ using namespace std; using namespace Latan; +/****************************************************************************** + * Correlator models * + ******************************************************************************/ DoubleModel CorrelatorModels::makeExpModel(const Index nState) { DoubleModel mod; @@ -224,6 +227,10 @@ DVec CorrelatorModels::parameterGuess(const DMatSample &corr, return init; } +/****************************************************************************** + * CorrelatorFitter implementation * + ******************************************************************************/ +// constructors //////////////////////////////////////////////////////////////// CorrelatorFitter::CorrelatorFitter(const DMatSample &corr) { setCorrelator(corr); @@ -234,6 +241,7 @@ CorrelatorFitter::CorrelatorFitter(const std::vector &corr) setCorrelators(corr); } +// access ////////////////////////////////////////////////////////////////////// XYSampleData & CorrelatorFitter::data(void) { return *data_; @@ -294,7 +302,7 @@ void CorrelatorFitter::setCorrelation(const bool isCorrelated, const Index i, data_->assumeYYCorrelated(isCorrelated, i, j); } -DMat CorrelatorFitter::getVarianceMatrix(void) +DMat CorrelatorFitter::getVarianceMatrix(void) const { return data_->getFitVarMat(); } @@ -305,6 +313,7 @@ void CorrelatorFitter::setThinning(const Index thinning, const Index i) refreshRanges(); } +// fit functions /////////////////////////////////////////////////////////////// SampleFitResult CorrelatorFitter::fit(Minimizer &minimizer, const DVec &init) { vector vecPt = {&minimizer}; @@ -325,6 +334,7 @@ SampleFitResult CorrelatorFitter::fit(vector &minimizer, return data_->fit(minimizer, init, vecPt); } +// internal function to refresh fit ranges ///////////////////////////////////// void CorrelatorFitter::refreshRanges(void) { for (unsigned int i = 0; i < range_.size(); ++i) diff --git a/lib/Physics/CorrelatorFitter.hpp b/lib/Physics/CorrelatorFitter.hpp index 018cb87..9acadb7 100644 --- a/lib/Physics/CorrelatorFitter.hpp +++ b/lib/Physics/CorrelatorFitter.hpp @@ -26,6 +26,9 @@ BEGIN_LATAN_NAMESPACE +/****************************************************************************** + * Correlator types & models * + ******************************************************************************/ enum class CorrelatorType {undefined, exp, cosh, sinh, linear, cst}; namespace CorrelatorModels @@ -46,12 +49,18 @@ namespace CorrelatorModels DVec parameterGuess(const DMatSample &corr, const ModelPar par); }; +/****************************************************************************** + * Correlator fit utility class * + ******************************************************************************/ class CorrelatorFitter { public: + // constructors CorrelatorFitter(const DMatSample &corr); CorrelatorFitter(const std::vector &corr); + // destructor virtual ~CorrelatorFitter(void) = default; + // access XYSampleData & data(void); void setCorrelator(const DMatSample &corr); void setCorrelators(const std::vector &corr); @@ -62,11 +71,13 @@ public: void setFitRange(const Index tMin, const Index tMax, const Index i = 0); void setCorrelation(const bool isCorrelated, const Index i = 0, const Index j = 0); - DMat getVarianceMatrix(void); + DMat getVarianceMatrix(void) const; void setThinning(const Index thinning, const Index i = 0); + // fit functions SampleFitResult fit(Minimizer &minimizer, const DVec &init); SampleFitResult fit(std::vector &minimizer, const DVec &init); private: + // internal function to refresh fit ranges void refreshRanges(void); private: Index nt_{0}; diff --git a/lib/Physics/EffectiveMass.cpp b/lib/Physics/EffectiveMass.cpp index aa21126..7899843 100644 --- a/lib/Physics/EffectiveMass.cpp +++ b/lib/Physics/EffectiveMass.cpp @@ -23,6 +23,9 @@ using namespace std; using namespace Latan; +/****************************************************************************** + * EffectiveMass implementation * + ******************************************************************************/ // constructors //////////////////////////////////////////////////////////////// EffectiveMass::EffectiveMass(const CorrelatorType type) {