- auto dtEffSpline = std::make_unique<Lau1DCubicSpline>(dtvals,effvals,Lau1DCubicSpline::AkimaSpline,Lau1DCubicSpline::Natural,Lau1DCubicSpline::Natural);
+ auto dtEffSpline = std::make_unique<Lau1DCubicSpline>( dtvals, effvals, Lau1DCubicSpline::SplineType::AkimaSpline );
auto dtaModel = std::make_unique<LauSplineDecayTimeEfficiency<LauSplineOrder::Cubic>>( "dteff_QFS", std::move(dtEffSpline) );
dtaModel->fitToTH1(dtaHist);
// Set which knots to float and which to fix (at least 1 knot must be fixed, not the first one)
// Knots should only be floating if requested AND the B lifetime is fixed!
if ( settings.fixSplineKnots or not settings.fixLifetime ) {
dtaModel->fixKnots();
} else {
dtaModel->floatKnots();
dtaModel->fixKnot( 0, true );
dtaModel->fixKnot( 3, true );
}
if ( settings.dType == LauTimeDepFitModel::CPEigenvalue::QFS ) {
// For the QFS mode we just use the cubic model as it is
// For the CP modes we modify it using a corrective spline
- auto dtCorrSpline = std::make_unique<Lau1DCubicSpline>(dtvals,corvals,Lau1DCubicSpline::AkimaSpline,Lau1DCubicSpline::Natural,Lau1DCubicSpline::Natural);
+ auto dtCorrSpline = std::make_unique<Lau1DCubicSpline>( dtvals, corvals, Lau1DCubicSpline::SplineType::AkimaSpline );
auto dtaCPModel = std::make_unique<LauSplineDecayTimeEfficiency<LauSplineOrder::Sixth>>( "dteff_CP", *dtaModel, std::move( dtCorrSpline ) );
//! Get the coefficients of a given spline segment in the form a + bx + cx^2 + dx^3
/*!
\param [in] segIndex refers to the index of the knot at the left end of the segment (segIndex = 0 gets the coefficients of the the segment between x_0 and x_1)
\param [in] normalise if true, the coefficients returned will be normalised by the integral of the complete spline (defaults to false)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Laura++ package authors:
John Back
Paul Harrison
Thomas Latham
*/
/*! \file LauEFKLLMRes.hh
\brief File containing declaration of LauEFKLLMRes class.
*/
/*! \class LauEFKLLMRes
\brief Class for defining the EFKLLM K-pi S-wave model
Class for defining the EFKLLM form-factor model for the K-pi S-wave.
The model consists of a tabulated form-factor, which is interpolated using cubic splines (one for magnitude values and one for phase values), multiplied by a mass-dependence (e.g. constant, 1/m^2, etc.).
The massFactor resonance parameter is the power of the mass dependence - defaults to zero, i.e. constant.
For more details see B. El-Bennich et al. Phys. Rev. D 79, 094005 (2009), arXiv:0902.3645 [hep-ph].
(The acronym EFKLLM is constructed from the surnames of the authors of the above paper.)
*/
#ifndef LAU_EFKLLM_RES
#define LAU_EFKLLM_RES
+#include <memory>
+
#include "TString.h"
#include "LauComplex.hh"
#include "LauAbsResonance.hh"
class Lau1DCubicSpline;
class LauEFKLLMRes : public LauAbsResonance {
public:
//! Constructor
/*!
\param [in] resInfo the object containing information on the resonance name, mass, width, spin, charge, etc.
\param [in] resPairAmpInt the number of the daughter not produced by the resonance
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Laura++ package authors:
John Back
Paul Harrison
Thomas Latham
*/
/*! \file LauModIndPartWaveRealImag.hh
\brief File containing declaration of LauModIndPartWaveRealImag class.
*/
/*! \class LauModIndPartWaveRealImag
\brief Class for defining a model independent partial wave component where the amplitudes are parameterised in terms of real and imaginary parts
This model uses splines to produce a partial wave from the values of the real and imaginary parts of the amplitude at a series of points in the phase space.
The values at each point can be floated in the fit.
*/
#ifndef LAU_MODINDPARTWAVE_REALIMAG
#define LAU_MODINDPARTWAVE_REALIMAG
#include "LauComplex.hh"
#include "LauAbsModIndPartWave.hh"
class TSpline3;
class LauModIndPartWaveRealImag : public LauAbsModIndPartWave {
public:
//! Constructor
/*!
\param [in] resInfo the object containing information on the resonance name, mass, width, spin, charge, etc.
\param [in] resPairAmpInt the number of the daughter not produced by the resonance
std::cerr << "WARNING in LauSplineDecayTimeEfficiency::fitToTH1 : fit failed with status " << fitResult->Status() << " and covariance matrix status " << fitResult->CovMatrixStatus() << "\n";
std::cerr << " : will not update spline parameters based on this fit result" << std::endl;
return;
}
if ( fitResult->CovMatrixStatus() == 2 )
{
- std::cerr << "WARNING in LauSplineDecayTimeEfficiency::fitToTH1 : final covariance matrix not PosDef!" << std::endl;
+ std::cerr << "WARNING in LauSplineDecayTimeEfficiency::fitToTH1 : final covariance matrix not positive definite\n";
std::cerr << " : continuing, but double check your fit!" << std::endl;
}
const std::size_t nKnots { ownedParams_.size() };
for ( std::size_t knot{0}; knot < nKnots; ++knot ) {
-/* case Lau1DCubicSpline::AkimaSpline: // Double check the Akima description of splines (in evaluate) right now they're the same except for the first derivatives
+/* case SplineType::AkimaSpline: // Double check the Akima description of splines (in evaluate) right now they're the same except for the first derivatives
{
//using fomulae from https://asmquantmacro.com/2015/09/01/akima-spline-interpolation-in-excel/
std::function<Double_t(Int_t)> m = [&](Int_t j) //formula to get the straight line gradient
{
if(j < 0){return 2*m(j+1)-m(j+2);}
if(j >= nKnots_){return 2*m(j-1)-m(j-2);}
return (y_[j+1]-y_[j]) / (x_[j+1]-x_[j]);
};
auto t = [&](Int_t j)
{
Double_t res = 0.; //originally res was called 't' but that produced a shadow warning
std::cerr << "ERROR in LauEFKLLMRes::setupFormFactor : Unexpected number of fields in text file, aborting reading of form-factor information." << std::endl;
return;
}
- mSqVals.push_back( atof(line[0].c_str()));
- magVals.push_back( atof(line[1].c_str()));
- phaseVals.push_back(atof(line[2].c_str()));
- line=readFile.getNextLine();
+
+ mSqVals.push_back( std::stod(line[0]) );
+ magVals.push_back( std::stod(line[1]) );
+ phaseVals.push_back( std::stod(line[2]) );
+
+ line = readFile.getNextLine();
}
// Destroy any splines we already had defined but issue a warning just in case
std::cerr << "WARNING in LauModIndPartWaveMagPhase::setKnotAmp : Index " << knot << " does not correspond to an existing knot in resonance " << this->getResonanceName() << std::endl;
std::cerr << " : Index must be in range 0 to " << nknots-1 << std::endl;
std::cerr << "WARNING in LauModIndPartWaveRealImag::setKnotAmp : Index " << knot << " does not correspond to an existing knot in resonance " << this->getResonanceName() << std::endl;
std::cerr << " : Index must be in range 0 to " << nknots-1 << std::endl;