Changeset View
Changeset View
Standalone View
Standalone View
src/LauKMatrixPropagator.cc
Show All 39 Lines | |||||
using std::cout; | using std::cout; | ||||
using std::endl; | using std::endl; | ||||
using std::cerr; | using std::cerr; | ||||
ClassImp(LauKMatrixPropagator) | ClassImp(LauKMatrixPropagator) | ||||
LauKMatrixPropagator::LauKMatrixPropagator(const TString& name, const TString& paramFile, | LauKMatrixPropagator::LauKMatrixPropagator(const TString& name, const TString& paramFile, | ||||
Int_t resPairAmpInt, Int_t nChannels, | Int_t resPairAmpInt, Int_t nChannels, | ||||
Int_t nPoles, Int_t rowIndex) : | Int_t nPoles, Int_t rowIndex) : | ||||
name_(name), | name_(name), | ||||
paramFileName_(paramFile), | paramFileName_(paramFile), | ||||
resPairAmpInt_(resPairAmpInt), | resPairAmpInt_(resPairAmpInt), | ||||
index_(rowIndex - 1), | index_(rowIndex - 1), | ||||
previousS_(0.0), | previousS_(0.0), | ||||
scattSVP_(0.0), | scattSVP_(0.0), | ||||
prodSVP_(0.0), | prodSVP_(0.0), | ||||
▲ Show 20 Lines • Show All 390 Lines • ▼ Show 20 Lines | void LauKMatrixPropagator::storePole(const std::vector<std::string>& theLine) | ||||
if (nWords == nExpect) { | if (nWords == nExpect) { | ||||
Int_t poleIndex = std::atoi(theLine[1].c_str()) - 1; | Int_t poleIndex = std::atoi(theLine[1].c_str()) - 1; | ||||
if (poleIndex >= 0 && poleIndex < nPoles_) { | if (poleIndex >= 0 && poleIndex < nPoles_) { | ||||
Double_t poleMass = std::atof(theLine[2].c_str()); | Double_t poleMass = std::atof(theLine[2].c_str()); | ||||
Double_t poleMassSq = poleMass*poleMass; | Double_t poleMassSq = poleMass*poleMass; | ||||
LauParameter mPoleParam(poleMassSq); | LauParameter mPoleParam(Form("KM_%s_poleMassSq_%i",name_.Data(),poleIndex),poleMassSq); | ||||
tlatham: This parameter has not been given a name, should probably follow line 463. | |||||
mSqPoles_[poleIndex] = mPoleParam; | mSqPoles_[poleIndex] = mPoleParam; | ||||
cout<<"Added bare pole mass "<<poleMass<<" GeV for pole number "<<poleIndex+1<<endl; | cout<<"Added bare pole mass "<<poleMass<<" GeV for pole number "<<poleIndex+1<<endl; | ||||
for (Int_t iChannel = 0; iChannel < nChannels_; iChannel++) { | for (Int_t iChannel = 0; iChannel < nChannels_; iChannel++) { | ||||
Double_t couplingConst = std::atof(theLine[iChannel+3].c_str()); | Double_t couplingConst = std::atof(theLine[iChannel+3].c_str()); | ||||
LauParameter couplingParam(couplingConst); | LauParameter couplingParam(Form("KM_%s_gCoupling_%i_%i",name_.Data(),poleIndex,iChannel),couplingConst); | ||||
Done Inline ActionsIt would be good to use the name_ of this propagator in forming the names of all the parameters, in case we have more than one K-matrix instance in a fit (e.g. for pipi and Kpi S-wave in B -> Kpipi). tlatham: It would be good to use the `name_` of this propagator in forming the names of all the… | |||||
gCouplings_[poleIndex][iChannel] = couplingParam; | gCouplings_[poleIndex][iChannel] = couplingParam; | ||||
cout<<"Added coupling parameter g^{"<<poleIndex+1<<"}_" | cout<<"Added coupling parameter g^{"<<poleIndex+1<<"}_" | ||||
<<iChannel+1<<" = "<<couplingConst<<endl; | <<iChannel+1<<" = "<<couplingConst<<endl; | ||||
} | } | ||||
} | } | ||||
} else { | } else { | ||||
cerr<<"Error in LauKMatrixPropagator::storePole. Expecting "<<nExpect | cerr<<"Error in LauKMatrixPropagator::storePole. Expecting "<<nExpect | ||||
<<" numbers for pole definition but found "<<nWords | <<" numbers for pole definition but found "<<nWords | ||||
<<" values instead"<<endl; | <<" values instead"<<endl; | ||||
} | } | ||||
} | } | ||||
void LauKMatrixPropagator::storeScattering(const std::vector<std::string>& theLine) | void LauKMatrixPropagator::storeScattering(const std::vector<std::string>& theLine) | ||||
{ | { | ||||
// Store the scattering constants (along one of the channel rows). | // Store the scattering constants (along one of the channel rows). | ||||
// Each line will contain: Scatt ScattIndex ScattConstantsPerChannel | // Each line will contain: Scatt ScattIndex ScattConstantsPerChannel | ||||
// Check that the line has nChannels_ + 2 strings | // Check that the line has nChannels_ + 2 strings | ||||
Int_t nWords = static_cast<Int_t>(theLine.size()); | Int_t nWords = static_cast<Int_t>(theLine.size()); | ||||
Int_t nExpect = nChannels_ + 2; | Int_t nExpect = nChannels_ + 2; | ||||
if (nWords == nExpect) { | if (nWords == nExpect) { | ||||
Int_t scattIndex = std::atoi(theLine[1].c_str()) - 1; | Int_t scattIndex = std::atoi(theLine[1].c_str()) - 1; | ||||
if (scattIndex >= 0 && scattIndex < nChannels_) { | if (scattIndex >= 0 && scattIndex < nChannels_) { | ||||
for (Int_t iChannel = 0; iChannel < nChannels_; iChannel++) { | for (Int_t iChannel = 0; iChannel < nChannels_; iChannel++) { | ||||
Double_t scattConst = std::atof(theLine[iChannel+2].c_str()); | Double_t scattConst = std::atof(theLine[iChannel+2].c_str()); | ||||
LauParameter scattParam(scattConst); | LauParameter scattParam(Form("KM_%s_scattConst_%i_%i",name_.Data(),scattIndex,iChannel),scattConst); | ||||
Done Inline ActionsThese parameters have not been given names - should probably be done as per line 463 tlatham: These parameters have not been given names - should probably be done as per line 463 | |||||
fScattering_[scattIndex][iChannel] = scattParam; | fScattering_[scattIndex][iChannel] = scattParam; | ||||
cout<<"Added scattering parameter f("<<scattIndex+1<<"," | cout<<"Added scattering parameter f("<<scattIndex+1<<"," | ||||
<<iChannel+1<<") = "<<scattConst<<endl; | <<iChannel+1<<") = "<<scattConst<<endl; | ||||
} | } | ||||
} | } | ||||
Show All 11 Lines | |||||
void LauKMatrixPropagator::storeParameter(const TString& keyword, const TString& parString) | void LauKMatrixPropagator::storeParameter(const TString& keyword, const TString& parString) | ||||
{ | { | ||||
if (!keyword.CompareTo("msq0")) { | if (!keyword.CompareTo("msq0")) { | ||||
Double_t mSq0Value = std::atof(parString.Data()); | Double_t mSq0Value = std::atof(parString.Data()); | ||||
cout<<"Adler zero constant m0Sq = "<<mSq0Value<<endl; | cout<<"Adler zero constant m0Sq = "<<mSq0Value<<endl; | ||||
mSq0_ = LauParameter("mSq0", mSq0Value); | mSq0_ = LauParameter(Form("KM_%s_mSq0",name_.Data()), mSq0Value); | ||||
} else if (!keyword.CompareTo("s0scatt")) { | } else if (!keyword.CompareTo("s0scatt")) { | ||||
Double_t s0ScattValue = std::atof(parString.Data()); | Double_t s0ScattValue = std::atof(parString.Data()); | ||||
cout<<"Adler zero constant s0Scatt = "<<s0ScattValue<<endl; | cout<<"Adler zero constant s0Scatt = "<<s0ScattValue<<endl; | ||||
s0Scatt_ = LauParameter("s0Scatt", s0ScattValue); | s0Scatt_ = LauParameter(Form("KM_%s_s0Scatt",name_.Data()), s0ScattValue); | ||||
} else if (!keyword.CompareTo("s0prod")) { | } else if (!keyword.CompareTo("s0prod")) { | ||||
Double_t s0ProdValue = std::atof(parString.Data()); | Double_t s0ProdValue = std::atof(parString.Data()); | ||||
cout<<"Adler zero constant s0Prod = "<<s0ProdValue<<endl; | cout<<"Adler zero constant s0Prod = "<<s0ProdValue<<endl; | ||||
s0Prod_ = LauParameter("s0Scatt", s0ProdValue); | s0Prod_ = LauParameter(Form("KM_%s_s0Prod",name_.Data()), s0ProdValue); | ||||
} else if (!keyword.CompareTo("sa0")) { | } else if (!keyword.CompareTo("sa0")) { | ||||
Double_t sA0Value = std::atof(parString.Data()); | Double_t sA0Value = std::atof(parString.Data()); | ||||
cout<<"Adler zero constant sA0 = "<<sA0Value<<endl; | cout<<"Adler zero constant sA0 = "<<sA0Value<<endl; | ||||
sA0_ = LauParameter("sA0", sA0Value); | sA0_ = LauParameter(Form("KM_%s_sA0",name_.Data()), sA0Value); | ||||
} else if (!keyword.CompareTo("sa")) { | } else if (!keyword.CompareTo("sa")) { | ||||
Double_t sAValue = std::atof(parString.Data()); | Double_t sAValue = std::atof(parString.Data()); | ||||
cout<<"Adler zero constant sA = "<<sAValue<<endl; | cout<<"Adler zero constant sA = "<<sAValue<<endl; | ||||
sA_ = LauParameter("sA", sAValue); | sA_ = LauParameter(Form("KM_%s_sA",name_.Data()), sAValue); | ||||
} else if (!keyword.CompareTo("scattsymmetry")) { | } else if (!keyword.CompareTo("scattsymmetry")) { | ||||
Int_t flag = std::atoi(parString.Data()); | Int_t flag = std::atoi(parString.Data()); | ||||
if (flag == 0) { | if (flag == 0) { | ||||
cout<<"Turning off scattering parameter symmetry: f_ji = f_ij will not be assumed"<<endl; | cout<<"Turning off scattering parameter symmetry: f_ji = f_ij will not be assumed"<<endl; | ||||
scattSymmetry_ = kFALSE; | scattSymmetry_ = kFALSE; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | Double_t LauKMatrixPropagator::getPoleDenomTerm(Int_t poleIndex) const | ||||
if (parametersSet_ == kFALSE) {return 0.0;} | if (parametersSet_ == kFALSE) {return 0.0;} | ||||
Double_t poleDenom(0.0); | Double_t poleDenom(0.0); | ||||
poleDenom = poleDenomVect_[poleIndex]; | poleDenom = poleDenomVect_[poleIndex]; | ||||
return poleDenom; | return poleDenom; | ||||
} | } | ||||
LauParameter& LauKMatrixPropagator::getPoleMassSqParameter(Int_t poleIndex) | |||||
{ | |||||
if ( (parametersSet_ == kFALSE) || (poleIndex < 0 || poleIndex >= nPoles_) ) { | |||||
std::cerr << "ERROR from LauKMatrixPropagator::getPoleMassSqParameter(). Invalid pole." << std::endl; | |||||
gSystem->Exit(EXIT_FAILURE); | |||||
} | |||||
return mSqPoles_[poleIndex]; | |||||
} | |||||
Double_t LauKMatrixPropagator::getCouplingConstant(Int_t poleIndex, Int_t channelIndex) const | Double_t LauKMatrixPropagator::getCouplingConstant(Int_t poleIndex, Int_t channelIndex) const | ||||
{ | { | ||||
if (parametersSet_ == kFALSE) {return 0.0;} | if (parametersSet_ == kFALSE) {return 0.0;} | ||||
if (poleIndex < 0 || poleIndex >= nPoles_) {return 0.0;} | if (poleIndex < 0 || poleIndex >= nPoles_) {return 0.0;} | ||||
if (channelIndex < 0 || channelIndex >= nChannels_) {return 0.0;} | if (channelIndex < 0 || channelIndex >= nChannels_) {return 0.0;} | ||||
Double_t couplingConst = gCouplings_[poleIndex][channelIndex].unblindValue(); | Double_t couplingConst = gCouplings_[poleIndex][channelIndex].unblindValue(); | ||||
return couplingConst; | return couplingConst; | ||||
} | } | ||||
LauParameter& LauKMatrixPropagator::getCouplingParameter(Int_t poleIndex, Int_t channelIndex) | |||||
{ | |||||
if ( (parametersSet_ == kFALSE) || (poleIndex < 0 || poleIndex >= nPoles_) || (channelIndex < 0 || channelIndex >= nChannels_) ) { | |||||
std::cerr << "ERROR from LauKMatrixPropagator::getCouplingParameter(). Invalid coupling." << std::endl; | |||||
gSystem->Exit(EXIT_FAILURE); | |||||
} | |||||
//std::cout << "Minvalue + range for " << poleIndex << ", " << channelIndex << ": " << gCouplings_[poleIndex][channelIndex].minValue() << " => + " << gCouplings_[poleIndex][channelIndex].range() << | |||||
// " and init value: " << gCouplings_[poleIndex][channelIndex].initValue() << std::endl; | |||||
return gCouplings_[poleIndex][channelIndex]; | |||||
} | |||||
Double_t LauKMatrixPropagator::getScatteringConstant(Int_t channel1Index, Int_t channel2Index) const | Double_t LauKMatrixPropagator::getScatteringConstant(Int_t channel1Index, Int_t channel2Index) const | ||||
{ | { | ||||
if (parametersSet_ == kFALSE) {return 0.0;} | if (parametersSet_ == kFALSE) {return 0.0;} | ||||
if (channel1Index < 0 || channel1Index >= nChannels_) {return 0.0;} | if (channel1Index < 0 || channel1Index >= nChannels_) {return 0.0;} | ||||
if (channel2Index < 0 || channel2Index >= nChannels_) {return 0.0;} | if (channel2Index < 0 || channel2Index >= nChannels_) {return 0.0;} | ||||
Double_t scatteringConst = fScattering_[channel1Index][channel2Index].unblindValue(); | Double_t scatteringConst = fScattering_[channel1Index][channel2Index].unblindValue(); | ||||
return scatteringConst; | return scatteringConst; | ||||
} | } | ||||
LauParameter& LauKMatrixPropagator::getScatteringParameter(Int_t channel1Index, Int_t channel2Index) | |||||
{ | |||||
if ( (parametersSet_ == kFALSE) || (channel1Index < 0 || channel1Index >= nChannels_) || (channel2Index < 0 || channel2Index >= nChannels_) ) { | |||||
std::cerr << "ERROR from LauKMatrixPropagator::getScatteringParameter(). Invalid chanel index." << std::endl; | |||||
gSystem->Exit(EXIT_FAILURE); | |||||
} | |||||
return fScattering_[channel1Index][channel2Index]; | |||||
} | |||||
Double_t LauKMatrixPropagator::calcSVPTerm(Double_t s, Double_t s0) const | Double_t LauKMatrixPropagator::calcSVPTerm(Double_t s, Double_t s0) const | ||||
{ | { | ||||
if (parametersSet_ == kFALSE) {return 0.0;} | if (parametersSet_ == kFALSE) {return 0.0;} | ||||
// Calculate the "slowly-varying part" (SVP) | // Calculate the "slowly-varying part" (SVP) | ||||
Double_t result(0.0); | Double_t result(0.0); | ||||
Double_t deltaS = s - s0; | Double_t deltaS = s - s0; | ||||
▲ Show 20 Lines • Show All 447 Lines • Show Last 20 Lines |
This parameter has not been given a name, should probably follow line 463.