Skip to content
Snippets Groups Projects
Commit ac3b3901 authored by Julian Pychy's avatar Julian Pychy
Browse files

improved the pbarp L dropping option

parent 1ea2258d
No related branches found
No related tags found
No related merge requests found
......@@ -74,16 +74,6 @@ void pbarpEnv::setup(pbarpParser* thePbarpParser){
_lmax=thePbarpParser->getLMax();
// individual Lmax settings
std::vector<std::string> theLmaxParticles = thePbarpParser->lmaxParticle();
for(auto lmaxIt = theLmaxParticles.begin(); lmaxIt != theLmaxParticles.end(); ++lmaxIt){
std::string particle;
short lmax;
std::stringstream stringStr;
stringStr << (*lmaxIt);
stringStr >> particle >> lmax;
_lmaxParticleData[particle] = lmax;
}
std::vector<std::string> theDropPbarpLForParticles = thePbarpParser->dropPbarpLForParticle();
for(auto ldropIt = theDropPbarpLForParticles.begin(); ldropIt != theDropPbarpLForParticles.end(); ++ldropIt){
std::string particle;
......
......@@ -57,7 +57,6 @@ public:
boost::shared_ptr<pbarpReaction> reaction() {return _pbarpReaction;}
std::vector<std::string>& spinDensityNames(){ return _spinDensity;}
std::map<std::string, short> lmaxParticleData(){ return _lmaxParticleData; }
std::map<std::string, std::vector<short> > dropPbarpLForParticleData(){ return _dropPbarpLForParticleData; }
protected:
......@@ -69,6 +68,5 @@ protected:
boost::shared_ptr<pbarpReaction> _pbarpReaction;
std::vector<std::string> _spinDensity;
std::map<std::string, short> _lmaxParticleData;
std::map<std::string, std::vector<short> > _dropPbarpLForParticleData;
};
......@@ -50,7 +50,6 @@ pbarpParser::pbarpParser(int argc,char **argv):
po::options_description config("Configuration file options");
config.add_options()
("spinDensity", po::value< vector<string> >(&_spinDensity), "particles for spin density matrix calculation")
("lmaxParticle", po::value< vector<string> >(&_lmaxParticle), "individual lmax (pbarp system) for certain particle")
("dropPbarpLForParticle", po::value< vector<string> >(&_dropPbarpLForParticle), "drop l (pbarp system) for certain particle")
;
_config->add(config);
......@@ -72,11 +71,7 @@ bool pbarpParser::parseCommandLine(int argc, char **argv)
std::cout << (*it) << "\n";
}
std::cout << "\nindividual pbarp angular momentum settings " << std::endl;
for (it=_lmaxParticle.begin(); it!=_lmaxParticle.end(); ++it){
std::cout << (*it) << "\n";
}
std::cout << "\ndrop pbarp L " << std::endl;
for (it=_dropPbarpLForParticle.begin(); it!=_dropPbarpLForParticle.end(); ++it){
std::cout << (*it) << "\n";
}
......
......@@ -42,7 +42,6 @@ class pbarpParser : public ParserBase
const unsigned int getLMax() const { return _lMax; }
const float getpbarMomentum() const { return _pbarMomentum; }
const std::vector<std::string>& spinDensityNames() const { return _spinDensity;}
const std::vector<std::string>& lmaxParticle() const{ return _lmaxParticle; }
const std::vector<std::string>& dropPbarpLForParticle() const{ return _dropPbarpLForParticle; }
protected:
......@@ -50,7 +49,6 @@ protected:
unsigned int _lMax;
float _pbarMomentum;
std::vector<std::string> _spinDensity;
std::vector<std::string> _lmaxParticle;
std::vector<std::string> _dropPbarpLForParticle;
};
......
......@@ -32,6 +32,7 @@
#include "PwaUtils/IsobarLSDecay.hh"
#include "PwaUtils/IsobarHeliDecay.hh"
#include "PwaUtils/IsobarTensorDecay.hh"
#include "PwaUtils/ParserBase.hh"
#include "qft++/relativistic-quantum-mechanics/Utils.hh"
#include "ErrLogger/ErrLogger.hh"
#include "Particle/Particle.hh"
......@@ -48,16 +49,11 @@ pbarpReaction::pbarpReaction(std::vector<std::pair<Particle*, Particle*> >& prod
for(itJPCLS = all_JPCLSs.begin(); itJPCLS != all_JPCLSs.end(); ++itJPCLS){
boost::shared_ptr<const jpcRes> currentJPC = (*itJPCLS);
auto minMapIt = _minLMap.find(currentJPC);
if(minMapIt == _minLMap.end()){
_minLMap[currentJPC] = (*itJPCLS)->L;
}
else{
if(_minLMap[currentJPC] > (*itJPCLS)->L)
_minLMap[currentJPC] = (*itJPCLS)->L;
if(std::find(_jpcToJPCLSMap[currentJPC].begin(), _jpcToJPCLSMap[currentJPC].end(), (*itJPCLS)) == _jpcToJPCLSMap[currentJPC].end()){
_jpcToJPCLSMap[currentJPC].push_back(*itJPCLS);
}
_jpcToLMap[currentJPC].push_back((*itJPCLS)->L);
}
for(itJPC = pbarpJPCStatesAll.begin(); itJPC!=pbarpJPCStatesAll.end(); ++itJPC){
......@@ -65,89 +61,70 @@ pbarpReaction::pbarpReaction(std::vector<std::pair<Particle*, Particle*> >& prod
std::vector<std::pair<Particle*, Particle*> >::iterator itPartPairs;
for (itPartPairs=prodPairs.begin(); itPartPairs!= prodPairs.end(); ++itPartPairs){
std::string decName=(*itJPC)->name();
// std::string decName="";
boost::shared_ptr<IsobarLSDecay> currentDec(new IsobarLSDecay( (*itJPC),itPartPairs->first, itPartPairs->second, pbarpEnv::instance(), decName));
if (currentDec->JPCLSAmps().size()>0 &&
CheckLDrop((std::string&)(*itPartPairs).first->name(), *itJPC) &&
CheckLDrop((std::string&)(*itPartPairs).second->name(), *itJPC)){
_prodDecs.push_back(currentDec);
if(!currentDec->JPCLSAmps().size()>0)// &&
continue;
bool acceptProd=false;
for(auto lIt = _jpcToJPCLSMap[*itJPC].begin(); lIt != _jpcToJPCLSMap[*itJPC].end(); ++lIt){
if(CheckJPCLSForParticle((std::string&)(*itPartPairs).first->name(), *lIt) &&
CheckJPCLSForParticle((std::string&)(*itPartPairs).second->name(), *lIt)){
if(std::find(_pbarpJPCLSs.begin(), _pbarpJPCLSs.end(), *lIt) == _pbarpJPCLSs.end())
_pbarpJPCLSs.push_back(*lIt);
acceptProd = true;
}
}
//boost::shared_ptr<IsobarTensorDecay> currentTensorDec(new IsobarTensorDecay( (*itJPC),itPartPairs->first, itPartPairs->second, pbarpEnv::instance(), decName));
//_prodTensorDecs.push_back(currentTensorDec);
if(!acceptProd)
continue;
acceptJPC=true;
_prodDecs.push_back(currentDec);
if(pbarpEnv::instance()->parser()->productionFormalism() == "Tensor"){
boost::shared_ptr<IsobarTensorDecay> currentTensorDec(new IsobarTensorDecay( (*itJPC),itPartPairs->first, itPartPairs->second, pbarpEnv::instance(), decName));
_prodTensorDecs.push_back(currentTensorDec);
}
else if(pbarpEnv::instance()->parser()->productionFormalism() == "Heli"){
boost::shared_ptr<IsobarHeliDecay> currentHeliDec(new IsobarHeliDecay( (*itJPC),itPartPairs->first, itPartPairs->second, pbarpEnv::instance(), decName));
_prodHeliDecs.push_back(currentHeliDec);
acceptJPC=true;
}
}
if(acceptJPC)
_pbarpJPCs.push_back(*itJPC);
}
_pbarpJPCLSs = extractStates(_pbarpJPCs, all_JPCLSs);
//_pbarpJPCLSs = extractStates(_pbarpJPCs, all_JPCLSs);
std::vector< boost::shared_ptr<const JPCLS> > all_pbarpSingletLS = thepbarpStates->singlet_JPCLS_States();
_pbarpJPCLSsinglet = extractStates(_pbarpJPCs, all_pbarpSingletLS);
// fillMap(_pbarpJPCLSsinglet, _prodDecs, _pbarpSingletDecMap);
_pbarpJPCLSsinglet = extractStates(_pbarpJPCLSs, all_pbarpSingletLS);
std::vector< boost::shared_ptr<const JPCLS> > all_pbarpTriplet0LS = thepbarpStates->triplet0_JPCLS_States();
_pbarpJPCLStriplet0 = extractStates(_pbarpJPCs, all_pbarpTriplet0LS);
// fillMap(_pbarpJPCLStriplet0, _prodDecs, _pbarpTriplet0DecMap);
_pbarpJPCLStriplet0 = extractStates(_pbarpJPCLSs, all_pbarpTriplet0LS);
std::vector< boost::shared_ptr<const JPCLS> > all_pbarpTripletp1LS = thepbarpStates->tripletp1_JPCLS_States();
_pbarpJPCLStripletp1 = extractStates(_pbarpJPCs, all_pbarpTripletp1LS);
// fillMap(_pbarpJPCLStripletp1, _prodDecs, _pbarpTripletp1DecMap);
_pbarpJPCLStripletp1 = extractStates(_pbarpJPCLSs, all_pbarpTripletp1LS);
std::vector< boost::shared_ptr<const JPCLS> > all_pbarpTripletm1LS = thepbarpStates->tripletm1_JPCLS_States();
_pbarpJPCLStripletm1 = extractStates(_pbarpJPCs, all_pbarpTripletm1LS);
// fillMap(_pbarpJPCLStripletm1, _prodDecs, _pbarpTripletm1DecMap);
_pbarpJPCLStripletm1 = extractStates(_pbarpJPCLSs, all_pbarpTripletm1LS);
}
bool pbarpReaction::CheckJPCLSForParticle(std::string& particleName, boost::shared_ptr<const JPCLS> theJPCLS){
bool pbarpReaction::CheckLDrop(std::string& particleName, boost::shared_ptr<const jpcRes> theJPC){
std::map<std::string, short> lmaxMap = pbarpEnv::instance()->lmaxParticleData();
std::map<std::string, std::vector<short> > ldropMap = pbarpEnv::instance()->dropPbarpLForParticleData();
auto lmaxIt = lmaxMap.find(particleName);
if(lmaxIt != lmaxMap.end()){
short lmaxParticle = (*lmaxIt).second;
short lMin = 1E4;
for(auto jpcLIt = _jpcToLMap[theJPC].begin(); jpcLIt != _jpcToLMap[theJPC].end(); ++jpcLIt){
if((*jpcLIt) < lMin)
lMin = *jpcLIt;
}
if(lMin > lmaxParticle)
return false;
}
auto ldropIt = ldropMap.find(particleName);
if(ldropIt != ldropMap.end()){
bool accept = false;
short numfound=0;
for(auto jpcLIt = _jpcToLMap[theJPC].begin(); jpcLIt != _jpcToLMap[theJPC].end(); ++jpcLIt){
bool found=false;
for(auto ldropListIt = (*ldropIt).second.begin(); ldropListIt != (*ldropIt).second.end(); ++ldropListIt){
if((*ldropListIt) == (*jpcLIt)){
found = true;
}
}
if(!found)
accept = true;
else
numfound++;
}
if(accept && numfound>0){
Warning << "Could not drop " << numfound << " pbarp L state(s) due to JPC = " << theJPC->J << " " << theJPC->P << " " << theJPC->C <<
" ambiguity. Manual parameter fixing needed." << endmsg;
}
if(ldropIt == ldropMap.end())
return true;
return accept;
for(auto ldropListIt = (*ldropIt).second.begin(); ldropListIt != (*ldropIt).second.end(); ++ldropListIt){
if((*ldropListIt) == theJPCLS->L){
return false;
}
}
return true;
......
......@@ -76,8 +76,7 @@ private:
std::vector< boost::shared_ptr<IsobarHeliDecay> > _prodHeliDecs;
std::vector< boost::shared_ptr<IsobarTensorDecay> > _prodTensorDecs;
std::map< boost::shared_ptr<const jpcRes>, Spin, pawian::Collection::SharedPtrLess > _minLMap;
std::map< boost::shared_ptr<const jpcRes>, std::vector<Spin>, pawian::Collection::SharedPtrLess> _jpcToLMap;
std::map< boost::shared_ptr<const jpcRes>, std::vector< boost::shared_ptr<const JPCLS> >, pawian::Collection::SharedPtrLess> _jpcToJPCLSMap;
bool CheckLDrop(std::string& particleName, boost::shared_ptr<const jpcRes> theJPC);
bool CheckJPCLSForParticle(std::string& particleName, boost::shared_ptr<const JPCLS> theJPCLS);
};
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