+ std::cerr << "ERROR in LauFitter::setFitterMaxPars : The fitter has already been created, cannot change the maximum number of parameters now." << std::endl;
+ return;
+ }
+
+ fitterMaxPars_ = maxPars;
+}
+
+LauAbsFitter& LauFitter::fitter()
{
- // Returns a pointer to a singleton LauAbsFitter object.
+ // Returns a reference to a singleton LauAbsFitter object.
// Creates the object the first time it is called.
- if ( theInstance_ == 0 ) {
- if ( fitterType_ == Minuit ) {
- theInstance_ = new LauMinuit();
+ if ( theInstance_ == nullptr ) {
+ if ( fitterType_ == Type::Minuit ) {
+ // NB cannot use std::make_unique here since the LauMinuit constructor is private
+ theInstance_.reset( new LauMinuit( fitterMaxPars_, fitterVerbosity_ ) );
// We need to make sure to calculate everything for every resonance
integralsToBeCalculated_.clear();
- for ( UInt_t i(0); i < nAmp_+nIncohAmp_; ++i ) {
+ for ( UInt_t i{0}; i < nAmp_+nIncohAmp_; ++i ) {
integralsToBeCalculated_.insert(i);
}
+ if ( aSqMaxAuto_ ) {
+ std::cout<<"INFO in LauIsobarDynamics::generate : Starting auto-location of |A|^2 maximum"<<std::endl;
+
+ LauASqMaxFinder finder{*this};
+ aSqMaxSet_ = finder.find();
+ aSqMaxAuto_ = kFALSE;
+
+ std::cout<<"INFO in LauIsobarDynamics::generate : auto-location of |A|^2 maximum finds: "<<aSqMaxSet_<<std::endl;
+ aSqMaxSet_ *= 1.10;
+ std::cout<<" : applying safety factor of 10\% gives: "<<aSqMaxSet_<<std::endl;
+ }
+
nSigGenLoop_ = 0;
Bool_t generatedSig(kFALSE);
@@ -2369,6 +2382,7 @@
// Found a value of ASq higher than the accept/reject ceiling - the generation is biased
if (printErrorMessages) {
std::cerr<<"WARNING in LauIsobarDynamics::checkToyMC : |A|^2 maximum was set to "<<aSqMaxSet_<<" but a value exceeding this was found: "<<aSqMaxVar_<<std::endl;
+ std::cerr<<" : This value was found at m13Sq = "<<kinematics_->getm13Sq()<<" and m23Sq = "<<kinematics_->getm23Sq()<<std::endl;
std::cerr<<" : Run was invalid, as any generated MC will be biased, according to the accept/reject method!"<<std::endl;
std::cerr<<" : The value of |A|^2 maximum be reset to be > "<<aSqMaxVar_<<" and the generation restarted."<<std::endl;
}
diff --git a/src/LauMinuit.cc b/src/LauMinuit.cc
--- a/src/LauMinuit.cc
+++ b/src/LauMinuit.cc
@@ -26,18 +26,20 @@
\brief File containing implementation of LauMinuit methods.
*/
-#include <iostream>
-#include <algorithm>
-
-#include "TMatrixD.h"
-#include "TVirtualFitter.h"
+#include "LauMinuit.hh"
#include "LauFitObject.hh"
#include "LauFitter.hh"
-#include "LauMinuit.hh"
#include "LauParameter.hh"
#include "LauParamFixed.hh"
+#include "TMatrixD.h"
+#include "TVirtualFitter.h"
+
+#include <algorithm>
+#include <array>
+#include <iostream>
+
// It's necessary to define an external function that specifies the address of the function
// that Minuit needs to minimise. Minuit doesn't know about any classes - therefore
// use gMinuit->SetFCN(external_function), gMinuit->SetObjectFit(this).