34 Int_t resPairAmpInt, Int_t nChannels,
35 Int_t nPoles, Int_t rowIndex) :
37 paramFileName_(paramFile),
38 resPairAmpInt_(resPairAmpInt),
43 nChannels_(nChannels),
46 m2piSq_(4.0*LauConstants::
mPiSq),
47 m2KSq_( 4.0*LauConstants::
mKSq),
48 m2EtaSq_(4.0*LauConstants::
mEtaSq),
50 mEtaEtaPDiffSq_((LauConstants::
mEta - LauConstants::mEtaPrime)*(LauConstants::
mEta - LauConstants::mEtaPrime)),
51 mKpiSumSq_((LauConstants::
mK + LauConstants::
mPi)*(LauConstants::
mK + LauConstants::
mPi)),
52 mKpiDiffSq_((LauConstants::
mK - LauConstants::mPi)*(LauConstants::
mK - LauConstants::mPi)),
53 mKEtaPSumSq_((LauConstants::
mK + LauConstants::mEtaPrime)*(LauConstants::
mK + LauConstants::mEtaPrime)),
54 mKEtaPDiffSq_((LauConstants::
mK - LauConstants::mEtaPrime)*(LauConstants::
mK - LauConstants::mEtaPrime)),
55 mK3piDiffSq_((LauConstants::
mK - 3.0*LauConstants::mPi)*(LauConstants::
mK - 3.0*LauConstants::mPi)),
56 k3piFactor_(TMath::Power((1.44 - mK3piDiffSq_)/1.44, -2.5)),
57 fourPiFactor1_(16.0*LauConstants::mPiSq),
58 fourPiFactor2_(TMath::Sqrt(1.0 - fourPiFactor1_)),
59 adlerZeroFactor_(0.0),
60 parametersSet_(kFALSE),
66 if (index_ < 0 || index_ >= nChannels_) {
67 std::cerr <<
"ERROR in LauKMatrixPropagator constructor. The rowIndex, which is set to "
68 << rowIndex <<
", must be between 1 and the number of channels "
69 << nChannels_ << std::endl;
70 gSystem->Exit(EXIT_FAILURE);
73 this->setParameters(paramFile);
133 if (!kinematics) {
return;}
195 TMatrixD invA(TMatrixD::kInverted, A);
196 TMatrixD invA_B(invA);
198 TMatrixD B_invA_B(B);
205 realProp_ = TMatrixD(TMatrixD::kInverted, invC);
244 cout<<
"Initialising K-matrix propagator "<<
name_<<
" parameters from "<<inputFile.Data()<<endl;
252 std::vector<std::string> channelTypeLine = readFile.
getNextLine();
253 Int_t nTypes =
static_cast<Int_t
>(channelTypeLine.size());
255 cerr<<
"Error in LauKMatrixPropagator::setParameters. Input file "<<inputFile
256 <<
" defines "<<nTypes<<
" channels when "<<
nChannels_<<
" are expected"<<endl;
264 for (iChannel = 0; iChannel <
nChannels_; iChannel++) {
266 Int_t phaseSpaceInt = atoi(channelTypeLine[iChannel].c_str());
269 if (checkChannel == kTRUE) {
270 cout<<
"Adding phase space channel index "<<phaseSpaceInt
271 <<
" to K-matrix propagator "<<
name_<<endl;
274 cerr<<
"Phase space channel index "<<phaseSpaceInt
276 cerr<<
"Stopping initialisation of the K-matrix propagator "<<
name_<<endl;
277 cerr<<
"Please correct the channel index on the first line of "<<inputFile<<endl;
286 Double_t poleMass(0.0), poleMassSq(0.0), couplingConst(0.0);
288 Int_t nPoleNumbers(nChannels_+1);
290 for (iPole = 0; iPole <
nPoles_; iPole++) {
294 std::vector<std::string> poleLine = readFile.
getNextLine();
295 Int_t nPoleValues =
static_cast<Int_t
>(poleLine.size());
296 if (nPoleValues != nPoleNumbers) {
297 cerr<<
"Error in LauKMatrixPropagator::setParameters. Expecting "
298 <<nPoleNumbers<<
" numbers for the bare pole "<<iPole<<
" line (mass and "
299 <<nChannels_<<
" coupling constants). Found "<<nPoleValues<<
" values instead."
304 poleMass = atof(poleLine[0].c_str());
305 poleMassSq = poleMass*poleMass;
309 std::vector<LauParameter> couplingVector;
311 cout<<
"Added bare pole mass "<<poleMass<<
" GeV for pole number "<<iPole+1<<endl;
313 for (iChannel = 0; iChannel <
nChannels_; iChannel++) {
315 couplingConst = atof(poleLine[iChannel+1].c_str());
317 couplingVector.push_back(couplingParam);
319 cout<<
"Added coupling parameter g^"<<iPole+1<<
"_"<<iChannel+1<<
" = "<<couplingConst<<endl;
332 std::vector<std::string> scatteringLine = readFile.
getNextLine();
333 Int_t nScatteringValues =
static_cast<Int_t
>(scatteringLine.size());
334 if (nScatteringValues != nChannels_) {
335 cerr<<
"Error in LauKMatrixPropagator::setParameters. Expecting "
336 <<nChannels_<<
" scattering SVP f constants instead of "<<nScatteringValues
337 <<
" for the K-matrix row index "<<
index_<<endl;
341 std::vector<LauParameter> scatteringVect;
342 for (jChannel = 0; jChannel <
nChannels_; jChannel++) {
344 Double_t fScattValue = atof(scatteringLine[jChannel].c_str());
346 scatteringVect.push_back(scatteringParam);
348 cout<<
"Added scattering SVP f("<<
index_+1<<
","<<jChannel+1<<
") = "<<fScattValue<<endl;
355 std::vector<std::string> constLine = readFile.
getNextLine();
356 Int_t nConstValues =
static_cast<Int_t
>(constLine.size());
357 if (nConstValues != 5) {
358 cerr<<
"Error in LauKMatrixPropagator::setParameters. Expecting 5 values for the Adler-zero constants:"
359 <<
" m0^2 s0Scatt s0Prod sA sA0"<<endl;
363 Double_t mSq0Value = atof(constLine[0].c_str());
364 Double_t s0ScattValue = atof(constLine[1].c_str());
365 Double_t s0ProdValue = atof(constLine[2].c_str());
366 Double_t sAValue = atof(constLine[3].c_str());
367 Double_t sA0Value = atof(constLine[4].c_str());
369 cout<<
"Adler zero constants:"<<endl;
370 cout<<
"m0Sq = "<<mSq0Value<<
", s0Scattering = "<<s0ScattValue<<
", s0Production = "
371 <<s0ProdValue<<
", sA = "<<sAValue<<
" and sA0 = "<<sA0Value<<endl;
382 IMatrix_.ResizeTo(nChannels_, nChannels_);
383 for (iChannel = 0; iChannel <
nChannels_; iChannel++) {
396 realProp_.ResizeTo(nChannels_, nChannels_);
417 cout<<
"Finished initialising K-matrix propagator "<<
name_<<endl;
428 if (
verbose_) {cout<<
"Within calcScattKMatrix for s = "<<s<<endl;}
433 Int_t iChannel(0), jChannel(0), iPole(0);
443 for (iChannel = 0; iChannel <
nChannels_; iChannel++) {
445 std::vector<LauParameter> SVPVect(0);
447 KMatrixParamMap::iterator SVPIter =
fScattering_.find(iChannel);
448 if (SVPIter !=
fScattering_.end()) {SVPVect = SVPIter->second;}
450 Int_t SVPVectSize =
static_cast<Int_t
>(SVPVect.size());
453 for (jChannel = iChannel; jChannel <
nChannels_; jChannel++) {
458 for (iPole = 0; iPole <
nPoles_; iPole++) {
460 KMatrixParamMap::iterator couplingIter =
gCouplings_.find(iPole);
462 std::vector<LauParameter> couplingVect = couplingIter->second;
464 Double_t g_i = couplingVect[iChannel].unblindValue();
465 Double_t g_j = couplingVect[jChannel].unblindValue();
468 if (
verbose_) {cout<<
"1: Kij for i = "<<iChannel<<
", j = "<<jChannel<<
" = "<<Kij<<endl;}
472 if (SVPVectSize != 0 && jChannel < SVPVectSize) {
473 Double_t fij = SVPVect[jChannel].unblindValue();
478 if (
verbose_) {cout<<
"2: Kij for i = "<<iChannel<<
", j = "<<jChannel<<
" = "<<Kij<<endl;}
496 for (iPole = 0; iPole <
nPoles_; iPole++) {
498 Double_t poleTerm =
mSqPoles_[iPole].unblindValue() - s;
499 Double_t invPoleTerm(0.0);
500 if (TMath::Abs(poleTerm) > 1.0e-6) {invPoleTerm = 1.0/poleTerm;}
513 Double_t poleDenom(0.0);
524 Double_t couplingConst(0.0);
525 KMatrixParamMap::const_iterator couplingIter =
gCouplings_.find(poleIndex);
526 std::vector<LauParameter> couplingVect = couplingIter->second;
527 couplingConst = couplingVect[channelIndex].unblindValue();
529 return couplingConst;
539 Double_t result(0.0);
540 Double_t deltaS = s - s0;
541 if (TMath::Abs(deltaS) > 1.0e-6) {
571 Double_t deltaS = s - sA0Val;
572 if (TMath::Abs(deltaS) > 1e-6) {
590 Int_t phaseSpaceIndex(0);
592 for (Int_t iChannel (0); iChannel <
nChannels_; ++iChannel) {
615 cout<<
"ReRhoMatrix("<<iChannel<<
", "<<iChannel<<
") = "<<rho.
re()<<endl;
616 cout<<
"ImRhoMatrix("<<iChannel<<
", "<<iChannel<<
") = "<<rho.
im()<<endl;
630 if (TMath::Abs(s) < 1e-10) {
return rho;}
632 Double_t sqrtTerm = (-
m2piSq_/s) + 1.0;
633 if (sqrtTerm < 0.0) {
646 if (TMath::Abs(s) < 1e-10) {
return rho;}
648 Double_t sqrtTerm = (-
m2KSq_/s) + 1.0;
649 if (sqrtTerm < 0.0) {
680 if (TMath::Abs(s) < 1e-10) {
return rho;}
683 Double_t rhoTerm = ((1.07885*s + 0.13655)*s - 0.29744)*s - 0.20840;
684 rhoTerm = ((rhoTerm*s + 0.13851)*s - 0.01933)*s + 0.00051;
687 if (rhoTerm < 0.0) {rhoTerm = 0.0;}
700 if (TMath::Abs(s) < 1e-10) {
return rho;}
702 Double_t sqrtTerm = (-
m2EtaSq_/s) + 1.0;
703 if (sqrtTerm < 0.0) {
726 if (TMath::Abs(s) < 1e-10) {
return rho;}
729 if (sqrtTerm < 0.0) {
743 if (TMath::Abs(s) < 1e-10) {
return rho;}
747 Double_t sqrtTerm = sqrtTerm1*sqrtTerm2;
748 if (sqrtTerm < 0.0) {
761 if (TMath::Abs(s) < 1e-10) {
return rho;}
765 Double_t sqrtTerm = sqrtTerm1*sqrtTerm2;
766 if (sqrtTerm < 0.0) {
782 if (TMath::Abs(s) < 1e-10) {
return rho;}
787 if (powerTerm < 0.0) {
802 Bool_t passed(kFALSE);
818 if (channel < 0 || channel >=
nChannels_) {
return TAmp;}
836 if (channel < 0 || channel >=
nChannels_) {
return rho;}
858 if (!kinematics) {
return;}
907 TMatrixD CA(THatReal);
909 TMatrixD DA(THatImag);
911 TMatrixD CB(THatReal);
913 TMatrixD DB(THatImag);
946 for (Int_t iChannel (0); iChannel <
nChannels_; ++iChannel) {
951 Double_t rhoMag = sqrt(realRho*realRho + imagRho*imagRho);
952 Double_t rhoSum = rhoMag + realRho;
953 Double_t rhoDiff = rhoMag - realRho;
955 Double_t reSqrtRho(0.0), imSqrtRho(0.0);
956 if (rhoSum > 0.0) {reSqrtRho = sqrt(0.5*rhoSum);}
957 if (rhoDiff > 0.0) {imSqrtRho = sqrt(0.5*rhoDiff);}
void calcPoleDenomVect(Double_t s)
Calulate the term 1/(m_pole^2 - s) for the scattering and production K-matrix formulae.
TMatrixD ImTMatrix_
Imaginary part of the unitary T matrix.
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.
TMatrixD ReTMatrix_
Real part of the unitary T matrix.
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.
void getSqrtRhoMatrix()
Get the square root of the phase space matrix.
TMatrixD ReSqrtRhoMatrix_
Real part of the square root of the phase space density diagonal matrix.
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. ...
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 phase 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.
TMatrixD ImSqrtRhoMatrix_
Imaginary part of the square root of the phase space density diagonal matrix.
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 getTMatrix(const LauKinematics *kinematics)
Get the unitary transition amplitude matrix for the given kinematics.
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.
Double_t unblindValue() const
The unblinded value of the parameter.
Class for defining a complex number.
Double_t adlerZeroFactor_
Multiplicative factor containing various Adler zero constants.
Class for calculating 3-body kinematic quantities.
LauComplex getTransitionAmp(Double_t s, Int_t channel)
Get the unitary transition amplitude for the given channel.
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)
LauComplex getPhaseSpaceTerm(Double_t s, Int_t channel)
Get the complex phase space term for the given channel and invariant mass squared.
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 phase space density diagonal matrix.