Skip to content
Snippets Groups Projects
Commit 7ba674c2 authored by Bertram Kopf's avatar Bertram Kopf
Browse files

improved again performance for calculating ls amplitudes

parent efa964ee
No related branches found
No related tags found
No related merge requests found
......@@ -152,6 +152,8 @@ void AbsLSDecAmps::updateFitParams(fitParams& theParamVal){
double thePhi=phiMap[*it];
_currentParamMags[*it]=theMag;
_currentParamPhis[*it]=thePhi;
complex<double> expi(cos(thePhi), sin(thePhi));
_currentParamMagExpi[*it]=theMag*expi;
}
_absDyn->updateFitParams(theParamVal);
......@@ -173,6 +175,10 @@ void AbsLSDecAmps::fillCgPreFactor(){
_cgPreFactor[*it][lambda1][lambda2]=sqrt(2.*(*it)->L+1)
*Clebsch((*it)->L, 0, (*it)->S, lambda, _JPCPtr->J, lambda)
*Clebsch(_Jdaughter1, lambda1, _Jdaughter2, -lambda2, (*it)->S, lambda );
_cgPreFactor_LamLamLSMap[lambda1][lambda2][*it]=sqrt(2.*(*it)->L+1)
*Clebsch((*it)->L, 0, (*it)->S, lambda, _JPCPtr->J, lambda)
*Clebsch(_Jdaughter1, lambda1, _Jdaughter2, -lambda2, (*it)->S, lambda );
}
}
}
......
......@@ -72,8 +72,11 @@ protected:
double _factorMag;
double _parityFactor;
std::map< std::shared_ptr<const LScomb>, map<Spin,map<Spin, double > >, pawian::Collection::SharedPtrLess > _cgPreFactor;
std::map< Spin, map<Spin, map<std::shared_ptr<const LScomb>, double, pawian::Collection::SharedPtrLess > > > _cgPreFactor_LamLamLSMap;
std::map< std::shared_ptr<const LScomb>, double, pawian::Collection::SharedPtrLess > _currentParamMags;
std::map< std::shared_ptr<const LScomb>, double, pawian::Collection::SharedPtrLess > _currentParamPhis;
std::map< std::shared_ptr<const LScomb>, complex<double>, pawian::Collection::SharedPtrLess > _currentParamMagExpi;
Spin _lam1Min;
Spin _lam1Max;
......
......@@ -158,18 +158,24 @@ complex<double> LSDecNonRefAmps::lsLoop(AbsXdecAmp* grandmaAmp, Spin& lamX, EvtD
std::map<Id3StringType, complex<double> >& currentWignerDMap=theData->WignerDStringId.at(_wignerDKey);
for(Spin lambda1=lam1Min; lambda1<=lam1Max; ++lambda1){
map<Spin, map<std::shared_ptr<const LScomb>, double, pawian::Collection::SharedPtrLess > >& cgPre_LamLSMap= _cgPreFactor_LamLamLSMap.at(lambda1);
for(Spin lambda2=lam2Min; lambda2<=lam2Max; ++lambda2){
Spin lambda = lambda1-lambda2;
if( fabs(lambda)>_JPCPtr->J || fabs(lambda)>_Smax) continue;
map<std::shared_ptr<const LScomb>, double, pawian::Collection::SharedPtrLess >& cgPre_LSMap= cgPre_LamLSMap.at(lambda2);
complex<double> amp(0.,0.);
for (it=_LSs.begin(); it!=_LSs.end(); ++it){
if( fabs(lambda)>(*it)->S) continue;
double theMag=_currentParamMags.at(*it);
double thePhi=_currentParamPhis.at(*it);
complex<double> expi(cos(thePhi), sin(thePhi));
if (_absDyn->isLdependent()) amp+=theMag*expi*_cgPreFactor.at(*it).at(lambda1).at(lambda2)*dynLSs.at((*it)->L);
else amp+=theMag*expi*_cgPreFactor.at(*it).at(lambda1).at(lambda2);
// double theMag=_currentParamMags.at(*it);
// double thePhi=_currentParamPhis.at(*it);
// complex<double> expi(cos(thePhi), sin(thePhi));
// if (_absDyn->isLdependent()) amp+=theMag*expi*_cgPreFactor.at(*it).at(lambda1).at(lambda2)*dynLSs.at((*it)->L);
// else amp+=theMag*expi*_cgPreFactor.at(*it).at(lambda1).at(lambda2);
// if (_absDyn->isLdependent()) amp+=theMag*expi*cgPre_LSMap.at(*it)*dynLSs.at((*it)->L);
// else amp+=theMag*expi*cgPre_LSMap.at(*it);
if (_absDyn->isLdependent()) amp+=_currentParamMagExpi.at(*it)*cgPre_LSMap.at(*it)*dynLSs.at((*it)->L);
else amp+=_currentParamMagExpi.at(*it)*cgPre_LSMap.at(*it);
}
Id3StringType IdJLamXLam12=FunctionUtils::spin3Index(_J, lamX, lambda);
amp *= conj(currentWignerDMap.at(IdJLamXLam12));
......
......@@ -149,9 +149,10 @@ complex<double> LSDecRefAmps::lsLoopRef(AbsXdecAmp* grandmaAmp, std::string& ref
map<Spin,map<Spin, double > >& currentCgFactor=_cgPreFactor.at(*it);
double theMag=_currentParamMags.at(*it);
double thePhi=_currentParamPhis.at(*it);
complex<double> expi(cos(thePhi), sin(thePhi));
// double theMag=_currentParamMags.at(*it);
// double thePhi=_currentParamPhis.at(*it);
// complex<double> expi(cos(thePhi), sin(thePhi));
complex<double> currentMagExpi=_currentParamMagExpi.at(*it);
complex<double> tmpResult(0.,0.);
for(Spin lambda1=lam1Min; lambda1<=lam1Max; ++lambda1){
......@@ -159,8 +160,8 @@ complex<double> LSDecRefAmps::lsLoopRef(AbsXdecAmp* grandmaAmp, std::string& ref
Spin lambda = lambda1-lambda2;
if( fabs(lambda)>_JPCPtr->J || fabs(lambda)>(*it)->S) continue;
Id3StringType IdJLamXLam12=FunctionUtils::spin3Index(_J, lamX, lambda);
complex<double> amp = theMag*expi*currentCgFactor.at(lambda1).at(lambda2)*conj(currentWignerDMap.at(IdJLamXLam12));
// complex<double> amp = theMag*expi*currentCgFactor.at(lambda1).at(lambda2)*conj(currentWignerDMap.at(IdJLamXLam12));
complex<double> amp = currentMagExpi*currentCgFactor.at(lambda1).at(lambda2)*conj(currentWignerDMap.at(IdJLamXLam12));
if(withDecs) amp *=daughterAmp(lambda1, lambda2, theData, lamFs);
tmpResult+=amp;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment