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

removed pbarpStates

parent 35e7a1a0
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
#include <vector>
#include "ErrLogger/ErrLogger.hh"
#include "PwaUtils/AbsStates.hh"
#include "PwaUtils/pbarpStates.hh"
#include "PwaUtils/pbarpStatesLS.hh"
#include "PwaUtils/DataUtils.hh"
int main(int __argc,char *__argv[]){
......@@ -17,15 +17,15 @@ int main(int __argc,char *__argv[]){
<< "output: JPC states with contributed LS combinations + helicicty + corresponding Clebsch-Gordan coefficient\n"
<< "The application can be started with two flags: \n"
<< "with -msg <errorLogMode>: choose the mode for the error logger \n"
<< "with -jmax <value>: choose the maximum Spin J \n"
<< "e.g. type: ./pbarpStatesApp -jmax 6 -msg debugging \n"
<< "with -lmax <value>: choose the maximum Spin J \n"
<< "e.g. type: ./pbarpStatesApp -lmax 6 -msg debugging \n"
<< std::endl;
return 0;
}
int optind=1;
std::string msgModeStr="default";
std::string jmaxStr="0";
std::string lmaxStr="0";
// decode arguments
while ((optind < (__argc-1) ) && (__argv[optind][0]=='-')) {
......@@ -36,9 +36,9 @@ int main(int __argc,char *__argv[]){
msgModeStr = __argv[optind];
found=true;
}
if(sw=="-jmax"){
if(sw=="-lmax"){
optind++;
jmaxStr = __argv[optind];
lmaxStr = __argv[optind];
found=true;
}
if (!found){
......@@ -62,75 +62,16 @@ int main(int __argc,char *__argv[]){
std::stringstream jmaxStrStr(jmaxStr);
int jmax=0;
jmaxStrStr >> jmax;
std::stringstream lmaxStrStr(lmaxStr);
int lmax=0;
lmaxStrStr >> lmax;
Info << "jmax: " << jmax << endmsg;
Info << "lmax: " << lmax << endmsg;
pbarpStates thepbarpState(jmax);
std::vector< boost::shared_ptr<const jpcRes> > jpcStatesRequest;
std::vector< boost::shared_ptr<const jpcRes> > theJPCStates=thepbarpState.jpcStates();
Info << "The pbarp JPC states are: " << endmsg;
std::vector< boost::shared_ptr<const jpcRes> >::const_iterator it1;
for ( it1=theJPCStates.begin(); it1!=theJPCStates.end(); ++it1){
if (0!= (*it1))(*it1)->print(std::cout);
std::cout << std::endl;
if ( (*it1)->J==1 || (*it1)->J==4) jpcStatesRequest.push_back(*it1);
}
std::vector< boost::shared_ptr<const JPCLSM> >::const_iterator it;
std::vector< boost::shared_ptr<const JPCLSM> > pbarpExtract=thepbarpState.extractJPCLSMStates(jpcStatesRequest);
Info << "The requested pbarp states (JPCSML) are: " << endmsg;
for ( it=pbarpExtract.begin(); it!=pbarpExtract.end(); ++it){
if (0!= (*it))(*it)->print(std::cout);
}
std::vector< boost::shared_ptr<const JPCSM> >::const_iterator itJPCSM;
std::vector< boost::shared_ptr<const JPCSM> > pbarpJPCSMExtract=thepbarpState.extractJPCSMStates(jpcStatesRequest);
Info << "The requested pbarp states (JPCSM) are: " << endmsg;
for ( itJPCSM=pbarpJPCSMExtract.begin(); itJPCSM!=pbarpJPCSMExtract.end(); ++itJPCSM){
if (0!= (*itJPCSM))(*itJPCSM)->print(std::cout);
}
pbarpStatesLS thepbarpState(lmax);
thepbarpState.print(std::cout);
std::vector< boost::shared_ptr<const jpcRes> >::const_iterator itjpc;
std::vector< boost::shared_ptr<const jpcRes> > theSingletStates=thepbarpState.singletStates();
Info << "The pbarp singlet states are: " << endmsg;
for ( itjpc=theSingletStates.begin(); itjpc!=theSingletStates.end(); ++itjpc){
if (0!= (*itjpc))(*itjpc)->print(std::cout);
std::cout << std::endl;
}
std::vector< boost::shared_ptr<const jpcRes> > theTripletM0States=thepbarpState.tripletM0States();
Info << "The pbarp triplet states with helicity=0 are: " << endmsg;
for ( itjpc=theTripletM0States.begin(); itjpc!=theTripletM0States.end(); ++itjpc){
if (0!= (*itjpc))(*itjpc)->print(std::cout);
std::cout << std::endl;
}
std::vector< boost::shared_ptr<const jpcRes> > theTripletMp1States=thepbarpState.tripletMp1States();
Info << "The pbarp triplet states with helicity=1 are: " << endmsg;
for ( itjpc=theTripletMp1States.begin(); itjpc!=theTripletMp1States.end(); ++itjpc){
if (0!= (*itjpc))(*itjpc)->print(std::cout);
std::cout << std::endl;
}
std::vector< boost::shared_ptr<const jpcRes> > theTripletMm1States=thepbarpState.tripletMm1States();
Info << "The pbarp triplet states with helicity=-1 are: " << endmsg;
for ( itjpc=theTripletMm1States.begin(); itjpc!=theTripletMm1States.end(); ++itjpc){
if (0!= (*itjpc))(*itjpc)->print(std::cout);
std::cout << std::endl;
}
return 0;
}
#include "PwaUtils/pbarpStates.hh"
#include "Utils/MathUtils.hh"
#include "ErrLogger/ErrLogger.hh"
pbarpStates::pbarpStates():
AbsStates(),
_jmax(10),
_pbarJPC(0.5, -1),
_pJPC(0.5, 1)
{
calcStates();
}
pbarpStates::pbarpStates(int jmax):
AbsStates(),
_jmax(jmax),
_pbarJPC(0.5, -1),
_pJPC(0.5, 1)
{
calcStates();
}
pbarpStates::~pbarpStates(){
}
bool pbarpStates::calcStates(){
for (int j=0; j<=_jmax; j++)
{
for (int p=-1; p<=1; p+=2){
vector<LS> motherLSs=GetValidLS(j, p, _pbarJPC.J,_pbarJPC.P, _pJPC.J, _pJPC.P);
int num_ls = (int) motherLSs.size();
DebugMsg << "valid LS combinations for JP(pbar p)=" << j <<" " << p << endmsg;
for(int ls = 0; ls < num_ls; ls++){
Spin L= motherLSs[ls].L;
Spin S= motherLSs[ls].S;
int cparity(pow(-1,int(L+S)));
DebugMsg << "L=" << L <<" S=" << S << " ==> C=" << cparity << endmsg;
boost::shared_ptr<const jpcRes> jpcPtr(new jpcRes(j,p,cparity));
std::vector<Spin> theMs;
for(Spin M = -S; M <= S; M++){
double Clebschg=Clebsch(L,0,S,M, j,M);
DebugMsg << "Clebsch(L,0,S,M=" << M << ", j,M=" << M << "): " << Clebschg << endmsg;
if (fabs(Clebschg)>1e-8) theMs.push_back(M);
}
if (theMs.size()>0){
fillVec(jpcPtr, _jpcStates);
boost::shared_ptr<const JPCLS> tmpJPCLS(new JPCLS(jpcPtr, L, S) );
_allJPCLS.push_back(tmpJPCLS);
std::vector<Spin>::const_iterator itM;
for ( itM=theMs.begin(); itM!=theMs.end(); ++itM){
boost::shared_ptr<const JPCSM> tmpJPCSM( new JPCSM(jpcPtr, S, (*itM) ));
_allJPCSM .push_back(tmpJPCSM);
double Clebschg1=Clebsch(L,0,S,(*itM), j, (*itM));
boost::shared_ptr<const JPCLSM> tmpJPCLSM(new JPCLSM(tmpJPCLS, (*itM), Clebschg1) );
_allStates.push_back(tmpJPCLSM);
if (S==0) fillVec(jpcPtr, _singletStates);
else if (S==1){
if ((*itM)==0) fillVec(jpcPtr, _tripletM0States);
else if ((*itM)==1) fillVec(jpcPtr, _tripletMp1States);
else if ((*itM)==-1) fillVec(jpcPtr, _tripletMm1States);
else {
Alert << "pbar p state with S=" << S << " and M="<< (*itM) <<" cannot exitst!!!"
<< cparity << endmsg;
exit(1);
}
}
else {
Alert << "pbar p state with S=" << S << " cannot exitst!!!" << cparity << endmsg;
exit(1);
}
}
}
}
}
DebugMsg << "\n" << endmsg;
}
return true;
}
void pbarpStates::fillVec(boost::shared_ptr<const jpcRes> currentRes,
std::vector< boost::shared_ptr<const jpcRes> >& theVec){
const jpcRes* jpcCurrent=currentRes.get();
if (0==jpcCurrent) {
Alert << "shared object containss 0 pointer!!!" << endmsg;
exit(1);
}
std::vector< boost::shared_ptr<const jpcRes> >::const_iterator it;
bool found=false;
for (it=theVec.begin(); it!=theVec.end(); ++it){
const jpcRes* jpcIt=(*it).get();
if (0==jpcIt) {
Alert << "shared object containss 0 pointer!!!" << endmsg;
exit(1);
}
if ( (*jpcIt) == (*jpcCurrent) ){
found=true;
continue;
}
}
if (!found) theVec.push_back(currentRes);
}
std::vector< boost::shared_ptr<const jpcRes> > pbarpStates::extractSingletStates(std::vector< boost::shared_ptr<const jpcRes> >& theJPCStates) const{
return extractJPCStates(theJPCStates,_singletStates);
}
std::vector< boost::shared_ptr<const jpcRes> > pbarpStates::extractTripletM0States(std::vector< boost::shared_ptr<const jpcRes> >& theJPCStates) const{
return extractJPCStates(theJPCStates, _tripletM0States);
}
std::vector< boost::shared_ptr<const jpcRes> > pbarpStates::extractTripletM1States(std::vector< boost::shared_ptr<const jpcRes> >& theJPCStates) const{
return extractJPCStates(theJPCStates, _tripletMp1States);
}
std::vector< boost::shared_ptr<const jpcRes> > pbarpStates::extractJPCStates(std::vector< boost::shared_ptr<const jpcRes> > theJPCRequests, std::vector< boost::shared_ptr<const jpcRes> > jpcStatesAll) const{
std::vector< boost::shared_ptr<const jpcRes> > result;
std::vector< boost::shared_ptr<const jpcRes> >::const_iterator itJPC;
std::vector< boost::shared_ptr<const jpcRes> >::const_iterator itAllStates;
for ( itJPC=theJPCRequests.begin(); itJPC!=theJPCRequests.end(); ++itJPC){
const jpcRes* jpcRequest=(*itJPC).get();
for ( itAllStates=jpcStatesAll.begin(); itAllStates!=jpcStatesAll.end(); ++itAllStates){
const jpcRes* jpcCurrent=(*itAllStates).get();
if (( *jpcCurrent) == (*jpcRequest)){
result.push_back(*itAllStates);
continue;
}
}
}
return result;
}
std::vector< boost::shared_ptr<const JPCLSM> > pbarpStates::extractJPCLSMStates(std::vector< boost::shared_ptr<const jpcRes> >& theJPCStates) const{
std::vector< boost::shared_ptr<const JPCLSM> > result;
std::vector< boost::shared_ptr<const jpcRes> >::const_iterator itJPC;
std::vector< boost::shared_ptr<const JPCLSM> >::const_iterator itAllStates;
for ( itJPC=theJPCStates.begin(); itJPC!=theJPCStates.end(); ++itJPC){
const jpcRes* jpcRequest=(*itJPC).get();
for ( itAllStates=_allStates.begin(); itAllStates!=_allStates.end(); ++itAllStates){
const JPCLSM* jpcsmCurrent=(*itAllStates).get();
if (( *jpcsmCurrent) == (*jpcRequest)){
result.push_back(*itAllStates);
continue;
}
}
}
return result;
}
std::vector< boost::shared_ptr<const JPCSM> > pbarpStates::extractJPCSMStates(std::vector< boost::shared_ptr<const jpcRes> >& theJPCStates) const{
std::vector< boost::shared_ptr<const JPCSM> > result;
std::vector< boost::shared_ptr<const jpcRes> >::const_iterator itJPC;
std::vector< boost::shared_ptr<const JPCSM> >::const_iterator itAllStates;
for ( itJPC=theJPCStates.begin(); itJPC!=theJPCStates.end(); ++itJPC){
const jpcRes* jpcRequest=(*itJPC).get();
for ( itAllStates=_allJPCSM.begin(); itAllStates!=_allJPCSM.end(); ++itAllStates){
const JPCSM* jpcsmCurrent=(*itAllStates).get();
if (( *jpcsmCurrent) == (*jpcRequest)){
result.push_back(*itAllStates);
continue;
}
}
}
return result;
}
std::vector< boost::shared_ptr<const JPCLS> > pbarpStates::extractJPCLSStates(boost::shared_ptr<const jpcRes> theJPCState) const{
std::vector< boost::shared_ptr<const JPCLS> > result;
std::vector< boost::shared_ptr<const JPCLS> >::const_iterator it;
for ( it=_allJPCLS.begin(); it!=_allJPCLS.end(); ++it){
// const jpcRes* currentJPC= (jpcRes*) (*it).get();
// const jpcRes* currentJPC=dynamic_cast<const jpcRes*> ((*it).get());
// if ( *(currentJPC) == *(theJPCState.get())) result.push_back( (*it) );
if (*((*it).get())==*(theJPCState.get())) result.push_back( (*it) );
}
return result;
}
void pbarpStates::print(std::ostream& os) const{
os << "initital states of the pbar p annihilation for Jmax = " << _jmax << " are: " << std::endl;
AbsStates::print(os);
}
#pragma once
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <boost/shared_ptr.hpp>
#include "qft++/topincludes/relativistic-quantum-mechanics.hh"
#include "PwaUtils/AbsStates.hh"
#include "PwaUtils/DataUtils.hh"
class pbarpStates : public AbsStates {
public:
pbarpStates();
pbarpStates(int jmax);
virtual ~pbarpStates();
virtual void print(std::ostream& os) const;
virtual std::vector< boost::shared_ptr<const jpcRes> > singletStates() const {
return _singletStates;
}
virtual std::vector< boost::shared_ptr<const jpcRes> > tripletM0States() const {
return _tripletM0States;
}
virtual std::vector< boost::shared_ptr<const jpcRes> > tripletMp1States() const {
return _tripletMp1States;
}
virtual std::vector< boost::shared_ptr<const jpcRes> > tripletMm1States() const {
return _tripletMm1States;
}
virtual std::vector< boost::shared_ptr<const jpcRes> >
extractSingletStates(std::vector< boost::shared_ptr<const jpcRes> >&) const;
virtual std::vector< boost::shared_ptr<const jpcRes> >
extractTripletM0States(std::vector< boost::shared_ptr<const jpcRes> >&) const;
virtual std::vector< boost::shared_ptr<const jpcRes> >
extractTripletM1States(std::vector< boost::shared_ptr<const jpcRes> >&) const;
virtual std::vector< boost::shared_ptr<const JPCLSM> > allStates() const {
return _allStates;
}
virtual std::vector< boost::shared_ptr<const jpcRes> > jpcStates() const {
return _jpcStates;
}
virtual std::vector< boost::shared_ptr<const JPCLS> > jpclsStates() const {
return _allJPCLS;
}
virtual std::vector< boost::shared_ptr<const JPCLSM> >
extractJPCLSMStates(std::vector< boost::shared_ptr<const jpcRes> >&) const;
virtual std::vector< boost::shared_ptr<const JPCSM> >
extractJPCSMStates(std::vector< boost::shared_ptr<const jpcRes> >&) const;
virtual std::vector< boost::shared_ptr<const JPCLS> >
extractJPCLSStates(boost::shared_ptr<const jpcRes>) const;
protected:
virtual bool calcStates();
std::vector< boost::shared_ptr<const JPCLSM> > _allStates;
std::vector< boost::shared_ptr<const JPCSM> > _allJPCSM;
std::vector< boost::shared_ptr<const JPCLS> > _allJPCLS;
std::vector< boost::shared_ptr<const jpcRes> > _jpcStates;
private:
int _jmax;
jpcRes _pbarJPC;
jpcRes _pJPC;
std::vector< boost::shared_ptr<const jpcRes> > _singletStates;
std::vector< boost::shared_ptr<const jpcRes> > _tripletM0States;
std::vector< boost::shared_ptr<const jpcRes> > _tripletMp1States;
std::vector< boost::shared_ptr<const jpcRes> > _tripletMm1States;
void fillVec(boost::shared_ptr<const jpcRes>,
std::vector< boost::shared_ptr<const jpcRes> >&);
std::vector< boost::shared_ptr<const jpcRes> >
extractJPCStates(std::vector< boost::shared_ptr<const jpcRes> > ,
std::vector< boost::shared_ptr<const jpcRes> > ) const;
};
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