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

moved general parts from LSDecAmps to AbsXdecAmp

parent c58e980d
No related branches found
No related tags found
No related merge requests found
......@@ -6,36 +6,63 @@
#include <string>
#include "PwaUtils/AbsXdecAmp.hh"
#include "PwaUtils/AbsDecay.hh"
#include "PwaUtils/XdecAmpRegistry.hh"
#include "qft++/relativistic-quantum-mechanics/Utils.hh"
#include "ErrLogger/ErrLogger.hh"
#include "Particle/Particle.hh"
AbsXdecAmp::AbsXdecAmp(const std::string& name, const std::vector<std::string>& hypVec, Spin spinX, int parity) :
_name(name)
,_hypVec(hypVec)
,_J_X(spinX)
,_parity(parity)
,_currentXMass(0.)
,_currentXWidth(0.)
,_currentgFactorPhiPhi(0.)
,_currentgFactorOmegaPhi(0.)
AbsXdecAmp::AbsXdecAmp(boost::shared_ptr<AbsDecay> theDec) :
_decay(theDec)
, _name(theDec->name())
,_JPCPtr(theDec->motherJPC())
,_key("_"+theDec->fitParSuffix())
,_massKey("")
,_wignerDKey(theDec->wignerDKey())
,_withDyn(theDec->withDynamics())
,_daughter1IsStable(theDec->isDaughter1Stable())
,_daughter2IsStable(theDec->isDaughter2Stable())
,_cacheAmps(false)
,_recalculate(true)
{
}
AbsXdecAmp::AbsXdecAmp(const std::string& name) :
_name(name)
,_recalculate(true)
{
initialize();
}
AbsXdecAmp::~AbsXdecAmp()
{
}
void AbsXdecAmp::initialize(){
if(_withDyn){
if(!_decay->hasMother()){
Alert << "no mother resonance; can not add dynamis" << endmsg;
exit(1);
}
_massKey=_decay->massParKey();
}
if(!_daughter1IsStable){
boost::shared_ptr<AbsDecay> decDaughter1=_decay->decDaughter1();
_decAmpDaughter1=XdecAmpRegistry::instance()->getXdecAmp(decDaughter1);
}
if(!_daughter2IsStable){
boost::shared_ptr<AbsDecay> decDaughter2=_decay->decDaughter2();
_decAmpDaughter2=XdecAmpRegistry::instance()->getXdecAmp(decDaughter2);
}
_Jdaughter1=(Spin) _decay->daughter1Part()->J();
_Jdaughter2=(Spin) _decay->daughter2Part()->J();
}
bool AbsXdecAmp::checkRecalculation(fitParams& theParamVal){
_recalculate=true;
return _recalculate;
}
complex<double> AbsXdecAmp::daughterAmp(Spin lam1, Spin lam2, EvtData* theData, Spin lamFs){
complex<double> result(1.,0.);
if(!_daughter1IsStable) result *= _decAmpDaughter1->XdecAmp(lam1, theData, lamFs);
if(!_daughter2IsStable) result *= _decAmpDaughter2->XdecAmp(lam2, theData, lamFs);
return result;
}
......@@ -13,36 +13,53 @@
#include "PwaUtils/EvtDataBaseList.hh"
#include "PwaUtils/FitParamsBase.hh"
class AbsDecay;
class AbsXdecAmp {
public:
AbsXdecAmp(const std::string& name, const std::vector<std::string>& hypVec, Spin spinX=0, int parity=1);
AbsXdecAmp(const std::string& name);
AbsXdecAmp(boost::shared_ptr<AbsDecay> theDec);
virtual ~AbsXdecAmp();
virtual complex<double> XdecAmp(Spin lamX, EvtData* theData, Spin lamFs)=0;
virtual void getDefaultParams(fitParams& fitVal, fitParams& fitErr)=0;
virtual complex<double> daughterAmp(Spin lam1, Spin lam2, EvtData* theData, Spin lamFs);
virtual void print(std::ostream& os) const=0;
const std::string name() const {return _name;}
const Spin spinX() const {return _J_X;}
const int parity() const {return _parity;}
virtual bool checkRecalculation(fitParams& theParamVal);
boost::shared_ptr<AbsDecay> absDec() {return _decay;}
virtual void cacheAmplitudes(){_cacheAmps=true;}
virtual void updateFitParams(fitParams& theParamVal){return;}
protected:
boost::shared_ptr<AbsDecay> _decay;
const std::string _name;
boost::shared_ptr<const jpcRes> _JPCPtr;
const std::vector<std::string> _hypVec;
Spin _J_X;
int _parity;
int _parity;
boost::shared_ptr<AbsXdecAmp> _decAmpDaughter1;
boost::shared_ptr<AbsXdecAmp> _decAmpDaughter2;
Spin _Jdaughter1;
Spin _Jdaughter2;
std::string _key;
std::string _massKey;
const std::string _wignerDKey;
bool _withDyn;
std::map< boost::shared_ptr<const JPCLS>, double, pawian::Collection::SharedPtrLess > _currentParamMags;
std::map< boost::shared_ptr<const JPCLS>, double, pawian::Collection::SharedPtrLess > _currentParamPhis;
double _currentXMass;
double _currentXWidth;
double _currentgFactorPhiPhi;
double _currentgFactorOmegaPhi;
bool _daughter1IsStable;
bool _daughter2IsStable;
bool _cacheAmps;
bool _recalculate;
std::map<int, std::map<Spin, std::map<Spin, complex<double> > > > _cachedAmpMap;
virtual void initialize();
};
......@@ -10,7 +10,7 @@
#include "ErrLogger/ErrLogger.hh"
#include "PwaUtils/DataUtils.hh"
#include "PwaUtils/IsobarLSDecay.hh"
#include "PwaUtils/XdecAmpRegistry.hh"
//#include "PwaUtils/XdecAmpRegistry.hh"
#include "Particle/Particle.hh"
#ifdef _OPENMP
......@@ -18,19 +18,11 @@
#endif
LSDecAmps::LSDecAmps(boost::shared_ptr<IsobarLSDecay> theDec) :
AbsXdecAmp(theDec->name())
,_decay(theDec)
,_JPCPtr(theDec->motherJPC())
AbsXdecAmp(theDec)
,_JPCLSs(theDec->JPCLSAmps())
,_key("_"+theDec->fitParSuffix())
,_massKey("")
,_wignerDKey(theDec->wignerDKey())
,_daughter1IsStable(theDec->isDaughter1Stable())
,_daughter2IsStable(theDec->isDaughter2Stable())
,_withDyn(theDec->withDynamics())
,_factorMag(1.)
{
initialize();
if(_JPCLSs.size()>0) _factorMag=1./sqrt(_JPCLSs.size());
}
LSDecAmps::~LSDecAmps()
......@@ -167,14 +159,6 @@ int evtNo=theData->evtNo;
return result;
}
complex<double> LSDecAmps::daughterAmp(Spin lam1, Spin lam2, EvtData* theData, Spin lamFs){
complex<double> result(1.,0.);
if(!_daughter1IsStable) result *= _decAmpDaughter1->XdecAmp(lam1, theData, lamFs);
if(!_daughter2IsStable) result *= _decAmpDaughter2->XdecAmp(lam2, theData, lamFs);
return result;
}
void LSDecAmps::getDefaultParams(fitParams& fitVal, fitParams& fitErr){
std::map< boost::shared_ptr<const JPCLS>, double, pawian::Collection::SharedPtrLess > currentMagValMap;
......@@ -210,29 +194,6 @@ void LSDecAmps::print(std::ostream& os) const{
return; //dummy
}
void LSDecAmps::initialize(){
if(_JPCLSs.size()>0) _factorMag=1./sqrt(_JPCLSs.size());
if(_withDyn){
if(!_decay->hasMother()){
Alert << "no mother resonance; can not add dynamis" << endmsg;
exit(1);
}
_massKey=_decay->massParKey();
}
if(!_daughter1IsStable){
boost::shared_ptr<AbsDecay> decDaughter1=_decay->decDaughter1();
_decAmpDaughter1=XdecAmpRegistry::instance()->getXdecAmp(decDaughter1);
}
if(!_daughter2IsStable){
boost::shared_ptr<AbsDecay> decDaughter2=_decay->decDaughter2();
_decAmpDaughter2=XdecAmpRegistry::instance()->getXdecAmp(decDaughter2);
}
_Jdaughter1=(Spin) _decay->daughter1Part()->J();
_Jdaughter2=(Spin) _decay->daughter2Part()->J();
}
bool LSDecAmps::checkRecalculation(fitParams& theParamVal){
_recalculate=false;
......
......@@ -34,32 +34,17 @@ public:
virtual complex<double> XdecAmp(Spin lamX, EvtData* theData, Spin lamFs=0);
virtual complex<double> XdecPartAmp(Spin lamX, Spin lamDec, short fixDaughterNr,
EvtData* theData, Spin lamFs);
virtual complex<double> daughterAmp(Spin lam1, Spin lam2, EvtData* theData, Spin lamFs);
virtual void getDefaultParams(fitParams& fitVal, fitParams& fitErr);
virtual void print(std::ostream& os) const;
virtual bool checkRecalculation(fitParams& theParamVal);
boost::shared_ptr<const jpcRes>& jpcPtr() {return _JPCPtr;}
std::vector< boost::shared_ptr<const JPCLS> >& jpclsVec() {return _JPCLSs;}
boost::shared_ptr<IsobarLSDecay> isobarLSDec() {return _decay;}
void updateFitParams(fitParams& theParamVal);
protected:
boost::shared_ptr<IsobarLSDecay> _decay;
boost::shared_ptr<const jpcRes> _JPCPtr;
std::vector< boost::shared_ptr<const JPCLS> > _JPCLSs;
boost::shared_ptr<AbsXdecAmp> _decAmpDaughter1;
boost::shared_ptr<AbsXdecAmp> _decAmpDaughter2;
Spin _Jdaughter1;
Spin _Jdaughter2;
std::string _key;
std::string _massKey;
const std::string _wignerDKey;
bool _daughter1IsStable;
bool _daughter2IsStable;
bool _withDyn;
double _factorMag;
virtual void initialize();
private:
......
......@@ -11,7 +11,7 @@
#include "PwaUtils/LSDecAmps.hh"
#include "PwaUtils/EvtDataBaseList.hh"
#include "PwaUtils/AbsXdecAmp.hh"
#include "PwaUtils/IsobarLSDecay.hh"
#include "PwaUtils/AbsDecay.hh"
#include "PwaUtils/FitParamsBase.hh"
#include "Particle/Particle.hh"
#include "ErrLogger/ErrLogger.hh"
......@@ -99,8 +99,8 @@ complex<double> pbarpBaseLh::calcProdPartAmp(Spin lamX, Spin lamDec, std::string
std::vector<boost::shared_ptr<LSDecAmps> >::iterator itDec;
for( itDec=decAmps.begin(); itDec!=decAmps.end(); ++itDec){
Particle* particle1 = (*itDec)->isobarLSDec()->daughter1Part();
Particle* particle2 = (*itDec)->isobarLSDec()->daughter2Part();
Particle* particle1 = (*itDec)->absDec()->daughter1Part();
Particle* particle2 = (*itDec)->absDec()->daughter2Part();
complex<double> currentDecAmp;
if(particle1->name() == nameDec)
currentDecAmp=(*itDec)->XdecPartAmp(lamX, lamDec, 1, theData, 0);
......
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