33 Int_t resPairAmpInt, Int_t nChannels,
34 Int_t nPoles, Int_t rowIndex) :
36 paramFileName_(paramFile),
37 resPairAmpInt_(resPairAmpInt),
42 nChannels_(nChannels),
45 m2piSq_(4.0*LauConstants::
mPiSq),
46 m2KSq_( 4.0*LauConstants::
mKSq),
47 m2EtaSq_(4.0*LauConstants::
mEtaSq),
49 mEtaEtaPDiffSq_((LauConstants::
mEta - LauConstants::mEtaPrime)*(LauConstants::
mEta - LauConstants::mEtaPrime)),
50 mKpiSumSq_((LauConstants::
mK + LauConstants::
mPi)*(LauConstants::
mK + LauConstants::
mPi)),
51 mKpiDiffSq_((LauConstants::
mK - LauConstants::mPi)*(LauConstants::
mK - LauConstants::mPi)),
52 mKEtaPSumSq_((LauConstants::
mK + LauConstants::mEtaPrime)*(LauConstants::
mK + LauConstants::mEtaPrime)),
53 mKEtaPDiffSq_((LauConstants::
mK - LauConstants::mEtaPrime)*(LauConstants::
mK - LauConstants::mEtaPrime)),
54 mK3piDiffSq_((LauConstants::
mK - 3.0*LauConstants::mPi)*(LauConstants::
mK - 3.0*LauConstants::mPi)),
55 k3piFactor_(TMath::Power((1.44 - mK3piDiffSq_)/1.44, -2.5)),
56 fourPiFactor1_(16.0*LauConstants::mPiSq),
57 fourPiFactor2_(TMath::Sqrt(1.0 - fourPiFactor1_)),
58 adlerZeroFactor_(0.0),
59 parametersSet_(kFALSE),
63 realProp_.Clear(); negImagProp_.Clear();
64 this->setParameters(paramFile);
176 TMatrixD invA(TMatrixD::kInverted, A);
177 TMatrixD invA_B(invA);
179 TMatrixD B_invA_B(B);
186 realProp_ = TMatrixD(TMatrixD::kInverted, invC);
225 cout<<
"Initialising K-matrix propagator "<<
name_<<
" parameters from "<<inputFile.Data()<<endl;
233 std::vector<std::string> channelTypeLine = readFile.
getNextLine();
234 Int_t nTypes =
static_cast<Int_t
>(channelTypeLine.size());
236 cerr<<
"Error in LauKMatrixPropagator::setParameters. Input file "<<inputFile
237 <<
" defines "<<nTypes<<
" channels when "<<
nChannels_<<
" are expected"<<endl;
245 for (iChannel = 0; iChannel <
nChannels_; iChannel++) {
247 Int_t phaseSpaceInt = atoi(channelTypeLine[iChannel].c_str());
250 if (checkChannel == kTRUE) {
251 cout<<
"Adding phase space channel index "<<phaseSpaceInt
252 <<
" to K-matrix propagator "<<
name_<<endl;
255 cerr<<
"Phase space channel index "<<phaseSpaceInt
257 cerr<<
"Stopping initialisation of the K-matrix propagator "<<
name_<<endl;
258 cerr<<
"Please correct the channel index on the first line of "<<inputFile<<endl;
267 Double_t poleMass(0.0), poleMassSq(0.0), couplingConst(0.0);
269 Int_t nPoleNumbers(nChannels_+1);
271 for (iPole = 0; iPole <
nPoles_; iPole++) {
275 std::vector<std::string> poleLine = readFile.
getNextLine();
276 Int_t nPoleValues =
static_cast<Int_t
>(poleLine.size());
277 if (nPoleValues != nPoleNumbers) {
278 cerr<<
"Error in LauKMatrixPropagator::setParameters. Expecting "
279 <<nPoleNumbers<<
" numbers for the bare pole "<<iPole<<
" line (mass and "
280 <<nChannels_<<
" coupling constants). Found "<<nPoleValues<<
" values instead."
285 poleMass = atof(poleLine[0].c_str());
286 poleMassSq = poleMass*poleMass;
290 std::vector<LauParameter> couplingVector;
292 cout<<
"Added bare pole mass "<<poleMass<<
" GeV for pole number "<<iPole+1<<endl;
294 for (iChannel = 0; iChannel <
nChannels_; iChannel++) {
296 couplingConst = atof(poleLine[iChannel+1].c_str());
298 couplingVector.push_back(couplingParam);
300 cout<<
"Added coupling parameter g^"<<iPole+1<<
"_"<<iChannel+1<<
" = "<<couplingConst<<endl;
313 std::vector<std::string> scatteringLine = readFile.
getNextLine();
314 Int_t nScatteringValues =
static_cast<Int_t
>(scatteringLine.size());
315 if (nScatteringValues != nChannels_) {
316 cerr<<
"Error in LauKMatrixPropagator::setParameters. Expecting "
317 <<nChannels_<<
" scattering SVP f constants instead of "<<nScatteringValues
318 <<
" for the K-matrix row index "<<
index_<<endl;
322 std::vector<LauParameter> scatteringVect;
323 for (jChannel = 0; jChannel <
nChannels_; jChannel++) {
325 Double_t fScattValue = atof(scatteringLine[jChannel].c_str());
327 scatteringVect.push_back(scatteringParam);
329 cout<<
"Added scattering SVP f("<<
index_+1<<
","<<jChannel+1<<
") = "<<fScattValue<<endl;
336 std::vector<std::string> constLine = readFile.
getNextLine();
337 Int_t nConstValues =
static_cast<Int_t
>(constLine.size());
338 if (nConstValues != 5) {
339 cerr<<
"Error in LauKMatrixPropagator::setParameters. Expecting 5 values for the Adler-zero constants:"
340 <<
" m0^2 s0Scatt s0Prod sA sA0"<<endl;
344 Double_t mSq0Value = atof(constLine[0].c_str());
345 Double_t s0ScattValue = atof(constLine[1].c_str());
346 Double_t s0ProdValue = atof(constLine[2].c_str());
347 Double_t sAValue = atof(constLine[3].c_str());
348 Double_t sA0Value = atof(constLine[4].c_str());
350 cout<<
"Adler zero constants:"<<endl;
351 cout<<
"m0Sq = "<<mSq0Value<<
", s0Scattering = "<<s0ScattValue<<
", s0Production = "
352 <<s0ProdValue<<
", sA = "<<sAValue<<
" and sA0 = "<<sA0Value<<endl;
363 IMatrix_.ResizeTo(nChannels_, nChannels_);
364 for (iChannel = 0; iChannel <
nChannels_; iChannel++) {
372 realProp_.ResizeTo(nChannels_, nChannels_);
378 cout<<
"Finished initialising K-matrix propagator "<<
name_<<endl;
389 if (
verbose_) {cout<<
"Within calcScattKMatrix for s = "<<s<<endl;}
395 Int_t iChannel(0), jChannel(0), iPole(0);
405 for (iChannel = 0; iChannel <
nChannels_; iChannel++) {
407 std::vector<LauParameter> SVPVect(0);
409 KMatrixParamMap::iterator SVPIter =
fScattering_.find(iChannel);
410 if (SVPIter !=
fScattering_.end()) {SVPVect = SVPIter->second;}
412 Int_t SVPVectSize =
static_cast<Int_t
>(SVPVect.size());
415 for (jChannel = iChannel; jChannel <
nChannels_; jChannel++) {
420 for (iPole = 0; iPole <
nPoles_; iPole++) {
422 KMatrixParamMap::iterator couplingIter =
gCouplings_.find(iPole);
424 std::vector<LauParameter> couplingVect = couplingIter->second;
426 Double_t g_i = couplingVect[iChannel].value();
427 Double_t g_j = couplingVect[jChannel].value();
430 if (
verbose_) {cout<<
"1: Kij for i = "<<iChannel<<
", j = "<<jChannel<<
" = "<<Kij<<endl;}
434 if (SVPVectSize != 0 && jChannel < SVPVectSize) {
435 Double_t fij = SVPVect[jChannel].value();
440 if (
verbose_) {cout<<
"2: Kij for i = "<<iChannel<<
", j = "<<jChannel<<
" = "<<Kij<<endl;}
458 for (iPole = 0; iPole <
nPoles_; iPole++) {
460 Double_t poleTerm =
mSqPoles_[iPole] - s;
461 Double_t invPoleTerm(0.0);
462 if (TMath::Abs(poleTerm) > 1.0e-6) {invPoleTerm = 1.0/poleTerm;}
475 Double_t poleDenom(0.0);
486 Double_t couplingConst(0.0);
487 KMatrixParamMap::const_iterator couplingIter =
gCouplings_.find(poleIndex);
488 std::vector<LauParameter> couplingVect = couplingIter->second;
489 couplingConst = couplingVect[channelIndex].value();
491 return couplingConst;
501 Double_t result(0.0);
502 Double_t deltaS = s - s0;
503 if (TMath::Abs(deltaS) > 1.0e-6) {
533 Double_t deltaS = s - sA0Val;
534 if (TMath::Abs(deltaS) > 1e-6) {
552 Int_t phaseSpaceIndex(0);
554 for (Int_t iChannel (0); iChannel <
nChannels_; ++iChannel) {
577 cout<<
"ReRhoMatrix("<<iChannel<<
", "<<iChannel<<
") = "<<rho.
re()<<endl;
578 cout<<
"ImRhoMatrix("<<iChannel<<
", "<<iChannel<<
") = "<<rho.
im()<<endl;
592 if (TMath::Abs(s) < 1e-10) {
return rho;}
594 Double_t sqrtTerm = (-
m2piSq_/s) + 1.0;
595 if (sqrtTerm < 0.0) {
608 if (TMath::Abs(s) < 1e-10) {
return rho;}
610 Double_t sqrtTerm = (-
m2KSq_/s) + 1.0;
611 if (sqrtTerm < 0.0) {
625 if (TMath::Abs(s) < 1e-10) {
return rho;}
628 Double_t term1 = (((11.3153*s - 21.8845)*s + 16.8358)*s - 6.39017)*s + 1.2274;
629 term1 += 0.00370909/(s*s);
643 if (TMath::Abs(s) < 1e-10) {
return rho;}
645 Double_t sqrtTerm = (-
m2EtaSq_/s) + 1.0;
646 if (sqrtTerm < 0.0) {
659 if (TMath::Abs(s) < 1e-10) {
return rho;}
663 Double_t sqrtTerm = sqrtTerm1*sqrtTerm2;
664 if (sqrtTerm < 0.0) {
678 if (TMath::Abs(s) < 1e-10) {
return rho;}
682 Double_t sqrtTerm = sqrtTerm1*sqrtTerm2;
683 if (sqrtTerm < 0.0) {
696 if (TMath::Abs(s) < 1e-10) {
return rho;}
700 Double_t sqrtTerm = sqrtTerm1*sqrtTerm2;
701 if (sqrtTerm < 0.0) {
717 if (TMath::Abs(s) < 1e-10) {
return rho;}
722 if (powerTerm < 0.0) {
737 Bool_t passed(kFALSE);
void calcPoleDenomVect(Double_t s)
Calulate the term 1/(m_pole^2 - s) for the scattering and production K-matrix formulae.
const Double_t mEta
Mass of eta (GeV/c^2)
File containing declaration of LauTextFileParser class.
Double_t previousS_
s value of the previous pole
LauComplex calcKThreePiRho(Double_t s) const
Calculate the Kpipipi phase space factor.
Class for parsing text files.
std::vector< Int_t > phaseSpaceTypes_
Vector of phase space types.
Double_t mKEtaPSumSq_
Defined as (mK+mEta')^2.
TMatrixD IMatrix_
Identity matrix.
virtual ~LauKMatrixPropagator()
Destructor.
Double_t calcSVPTerm(Double_t s, Double_t s0) const
Calculate the "slow-varying part".
void calcRhoMatrix(Double_t s)
Calculate the real and imaginary part of the phase space density diagonal matrix. ...
LauComplex calcFourPiRho(Double_t s) const
Calculate the 4 pi phase space factor.
LauComplex calcEtaEtaRho(Double_t s) const
Calculate the eta-eta phase space factor.
LauComplex calcKEtaPRho(Double_t s) const
Calculate the K-eta' phase space factor.
TString name_
String to store the propagator name.
Double_t mKEtaPDiffSq_
Defined as (mK-mEta')^2.
LauParameter()
Default constructor.
LauParameter sA0_
Constant from input file.
const TString & name() const
The parameter name.
LauComplex calcEtaEtaPRho(Double_t s) const
Calculate the eta-eta' phase space factor.
Double_t re() const
Get the real part.
std::vector< std::string > getNextLine()
Retrieve the next line.
Double_t im() const
Get the imaginary part.
Double_t getRealPropTerm(Int_t channelIndex) const
Get the real part of the term of the propagator.
LauParameter s0Prod_
Constant from input file.
TMatrixD ScattKMatrix_
Scattering K-matrix.
Double_t m2piSq_
Defined as 4*mPi*mPi.
std::vector< LauParameter > mSqPoles_
Vector of squared pole masses.
std::vector< Double_t > poleDenomVect_
Vector of 1/(m_pole^2 - s) terms for scattering and production K-matrix formulae. ...
Double_t mEtaEtaPDiffSq_
Defined as (mEta-mEta')^2.
Bool_t checkPhaseSpaceType(Int_t phaseSpaceInt) const
Check the phase space factors that need to be used.
Double_t mEtaEtaPSumSq_
Defined as (mEta+mEta')^2.
Double_t getm23Sq() const
Get the m23 invariant mass square.
File containing declaration of LauKMatrixPropagator class.
const Double_t mPi
Mass of pi+- (GeV/c^2)
TMatrixD zeroMatrix_
Null matrix.
void updateProdSVPTerm(Double_t s)
Update the production "slowly-varying part".
Int_t nChannels_
Number of channels.
LauParameter mSq0_
Constant from input file.
LauComplex calcPiPiRho(Double_t s) const
Calculate the pipi phase space factor.
void setImagPart(Double_t imagpart)
Set the imaginary part.
Double_t mKpiSumSq_
Defined as (mK+mPi)^2.
LauComplex calcKPiRho(Double_t s) const
Calculate the Kpi phase space factor.
Double_t getPoleDenomTerm(Int_t poleIndex) const
Get the 1/(m_pole^2 -s) terms for the scattering and production K-matrix formulae.
LauParameter s0Scatt_
Constant from input file.
const Double_t mEtaSq
Square of eta mass.
KMatrixParamMap gCouplings_
Map of coupling constants.
void updateAdlerZeroFactor(Double_t s)
Calculate the multiplicative factor containing severa Adler zero constants.
TMatrixD ImRhoMatrix_
Imaginary part of the pahse space density diagonal matrix.
Double_t mK3piDiffSq_
Defined as (mK-3*mPi)^2.
Double_t sAConst_
Defined as 0.5*sA*mPi*mPi.
const Double_t mPiSq
Square of pi+- mass.
Double_t fourPiFactor2_
Factor used to calculate the pipipipi phase space term.
Double_t prodSVP_
"slowly-varying part" for the production K-matrix
Bool_t parametersSet_
Tracks if all params have been set.
Class for defining the fit parameter objects.
const Double_t mEtaPrime
Mass of eta' (GeV/c^2)
void setRealPart(Double_t realpart)
Set the real part.
KMatrixParamMap fScattering_
Map of scattering SVP values.
Double_t getCouplingConstant(Int_t poleIndex, Int_t channelIndex) const
Get coupling constants that were loaded from the input file.
LauParameter sA_
Constant from input file.
void updatePropagator(const LauKinematics *kinematics)
Calculate the invariant mass squared s.
Int_t index_
Row index - 1.
Double_t mKpiDiffSq_
Defined as (mK-mPi)^2.
Double_t getImagPropTerm(Int_t channelIndex) const
Get the imaginary part of the term of the propagator.
Double_t getm12Sq() const
Get the m12 invariant mass square.
Bool_t verbose_
Control the output of the functions.
void setParameters(const TString &inputFile)
Read an input file to set parameters.
Double_t m2KSq_
Defined as 4*mK*mK.
TString name_
The parameter name.
Double_t getm13Sq() const
Get the m13 invariant mass square.
Double_t k3piFactor_
Factor used to calculate the Kpipipi phase space term.
Int_t nPoles_
Number of poles.
File containing LauConstants namespace.
Class for defining a complex number.
Double_t adlerZeroFactor_
Multiplicative factor containing various Adler zero constants.
Class for calculating 3-body kinematic quantities.
Double_t value() const
The value of the parameter.
TMatrixD realProp_
Real part of the propagator matrix.
Int_t resPairAmpInt_
Number to identify the DP axis in question.
Double_t scattSVP_
"slowly-varying part" for the scattering K-matrix
LauComplex getPropTerm(Int_t channelIndex) const
Get the full complex propagator term for a given channel.
LauComplex calcKKRho(Double_t s) const
Calculate the KK phase space factor.
void calcScattKMatrix(Double_t s)
Calculate the scattering K-matrix for the given value of s.
void processFile()
Parse the file.
Double_t m2EtaSq_
Defined as 4*mEta*mEta.
Double_t fourPiFactor1_
Factor used to calculate the pipipipi phase space term.
const Double_t mK
Mass of K+- (GeV/c^2)
const Double_t mKSq
Square of K+- mass.
void updateScattSVPTerm(Double_t s)
Update the scattering "slowly-varying part".
TMatrixD negImagProp_
Imaginary part of the propagator matrix.
Class for defining a K-matrix propagator.
TMatrixD ReRhoMatrix_
Real part of the pahse space density diagonal matrix.