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

classes and appl. for calculation pbarp initial states added

parent d97fe63f
No related branches found
No related tags found
No related merge requests found
...@@ -80,8 +80,9 @@ add_subdirectory (ErrLogger) ...@@ -80,8 +80,9 @@ add_subdirectory (ErrLogger)
add_subdirectory (Particle) add_subdirectory (Particle)
add_subdirectory (Event) add_subdirectory (Event)
add_subdirectory (Setup) add_subdirectory (Setup)
add_subdirectory (PwaUtils)
add_subdirectory (Examples/qft++) add_subdirectory (Examples/qft++)
add_subdirectory (Examples/pbarp)
EXECUTE_PROCESS(COMMAND ps OUTPUT_VARIABLE PSOUTPUT) EXECUTE_PROCESS(COMMAND ps OUTPUT_VARIABLE PSOUTPUT)
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.3 FATAL_ERROR)
MESSAGE("cmake installation for package: Examples/pbarp")
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
SET (INCLUDE_DIRECTORIES
${ROOT_INCLUDE_DIR}
${Minuit2_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR} )
INCLUDE_DIRECTORIES (AFTER
${ROOT_INCLUDE_DIR}
${Minuit2_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}
)
######## Linking pbarpStatesApp ###########################
SET (EXECUTABLENAME pbarpStatesApp)
SET (${EXECUTABLENAME}_SRCS
pbarpStatesApp.cc
)
ADD_EXECUTABLE(${EXECUTABLENAME}
${${EXECUTABLENAME}_SRCS}
)
TARGET_LINK_LIBRARIES (${EXECUTABLENAME} PwaUtils)
TARGET_LINK_LIBRARIES (${EXECUTABLENAME} qft++)
TARGET_LINK_LIBRARIES (${EXECUTABLENAME} ErrLogger)
INSTALL ( TARGETS ${EXECUTABLENAME} DESTINATION bin/${EXECUTABLENAME})
######## End of Linking pbarpStatesApp ###########################
#include <iostream>
#include <cstring>
#include <string>
#include <sstream>
#include <vector>
#include "ErrLogger/ErrLineLog.hh"
#include "PwaUtils/pbarpStates.hh"
int main(int __argc,char *__argv[]){
if( __argc>1 && ( strcmp( __argv[1], "-help" ) == 0
|| strcmp( __argv[1], "--help" ) == 0 ) ){
std::cout << "test application which calculates all initial pbar p states\n"
<< "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"
<< std::endl;
return 0;
}
int optind=1;
std::string msgModeStr="default";
std::string jmaxStr="0";
// decode arguments
while ((optind < (__argc-1) ) && (__argv[optind][0]=='-')) {
bool found=false;
std::string sw = __argv[optind];
if (sw=="-msg"){
optind++;
msgModeStr = __argv[optind];
found=true;
}
if(sw=="-jmax"){
optind++;
jmaxStr = __argv[optind];
found=true;
}
if (!found){
ErrMsg(warning) << "Unknown switch: "
<< __argv[optind] << endmsg;
optind++;
}
while ( (optind < __argc ) && __argv[optind][0]!='-' ) optind++;
}
ErrLineLog* myLogger=0;
if(msgModeStr == "debugging") myLogger= new ErrLineLog(ErrLog::debugging);
else if(msgModeStr == "trace") myLogger= new ErrLineLog(ErrLog::trace);
else if(msgModeStr == "routine") myLogger= new ErrLineLog(ErrLog::routine);
else if(msgModeStr == "warning") myLogger= new ErrLineLog(ErrLog::warning);
else if(msgModeStr == "error") myLogger= new ErrLineLog(ErrLog::error);
else {
myLogger= new ErrLineLog(ErrLog::routine);
ErrMsg(warning) << "ErrorLogger not (properly) set -> Use mode 'ErrLog::routine' " << endmsg;
}
std::stringstream jmaxStrStr(jmaxStr);
int jmax=0;
jmaxStrStr >> jmax;
ErrMsg(routine) << "jmax: " << jmax << endmsg;
pbarpStates thepbarpState(jmax);
thepbarpState.print(std::cout);
if (0!=myLogger) delete myLogger;
return 0;
}
...@@ -87,3 +87,4 @@ TARGET_LINK_LIBRARIES (${EXECUTABLENAME} ...@@ -87,3 +87,4 @@ TARGET_LINK_LIBRARIES (${EXECUTABLENAME}
INSTALL ( TARGETS ${EXECUTABLENAME} DESTINATION bin/${EXECUTABLENAME}) INSTALL ( TARGETS ${EXECUTABLENAME} DESTINATION bin/${EXECUTABLENAME})
######## End of Linking "EtacToa1320pi0fit" ########################### ######## End of Linking "EtacToa1320pi0fit" ###########################
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.3 FATAL_ERROR)
set(PACKAGE_NAME PwaUtils)
MESSAGE("cmake installation for package: " ${PACKAGE_NAME})
set(INCLUDE_DIRECTORIES
${CMAKE_SOURCE_DIR}
)
include_directories( ${INCLUDE_DIRECTORIES})
AUX_SOURCE_DIRECTORY("." SRC)
Set(CCSRC "")
FOREACH (THEFILE ${SRC})
IF (NOT ${THEFILE} MATCHES "(.*)App(.*)")
SET (CCSRC ${CCSRC} ${THEFILE})
ENDIF()
ENDFOREACH(THEFILE)
# BUILD_SHARED_LIBS controls the behavior of ADD_LIBRARY if STATIC/SHARED omitted
IF( PAWIAN_STATIC )
ADD_LIBRARY ( ${PACKAGE_NAME} STATIC ${CCSRC} )
ELSE()
ADD_LIBRARY ( ${PACKAGE_NAME} SHARED ${CCSRC} )
ENDIF( PAWIAN_STATIC )
INSTALL (TARGETS ${PACKAGE_NAME} DESTINATION ${CMAKE_BINARY_DIR}/lib)
#ifndef _DataUtils_H
#define _DataUtils_H
#include "qft++/topincludes/relativistic-quantum-mechanics.hh"
struct jpcRes
{
Spin J;
int P;
int C;
jpcRes(Spin j=0, int p=1, int c=1){
J=j;
P=p;
C=c;
}
};
/// L,S,M combination
struct LSM{
Spin L;
Spin S;
Spin M;
LSM(int l=0, Spin s=0, int m=0){
L=l;
S=s;
M=m;
}
};
struct PbarP{
jpcRes jpc;
LSM lsm;
double ClebschG;
PbarP(const jpcRes& theJPC, const LSM& theLSM, const double theClebschG){
jpc=theJPC;
lsm=theLSM;
ClebschG=theClebschG;
}
};
#endif /* _DataUtils_H */
#include "PwaUtils/pbarpStates.hh"
#include "ErrLogger/ErrLineLog.hh"
pbarpStates::pbarpStates():
_jmax(10),
_pbarJPC(0.5, -1),
_pJPC(0.5, 1){
calcJPCs();
}
pbarpStates::pbarpStates(int jmax):
_jmax(jmax),
_pbarJPC(0.5, -1),
_pJPC(0.5, 1)
{
calcJPCs();
}
pbarpStates::~pbarpStates(){
std::vector<PbarP*>::iterator it;
for ( it=_theStates.begin(); it!=_theStates.end(); ++it){
if (0!= (*it)){
delete (*it);
(*it)=0;
}
}
}
bool pbarpStates::calcJPCs(){
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();
ErrMsg(debugging) << "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,L+S));
ErrMsg(debugging) << "L=" << L <<" S=" << S << " ==> C=" << cparity << endmsg;
for(Spin M = -S; M <= S; M++){
double Clebschg=Clebsch(L,0,S,M, j,M);
ErrMsg(debugging) << "Clebsch(L,0,S,M=" << M << ", j,M=" << M << "): " << Clebschg << endmsg;
if (fabs(Clebschg)>1e-8){
jpcRes theJPC(j,p,cparity);
LSM theLSM(L,S,M);
_theStates.push_back(new PbarP(theJPC, theLSM, Clebschg));
}
}
}
ErrMsg(debugging) << "\n" << endmsg;
}
}
}
void pbarpStates::print(std::ostream& os) const{
os << "initital states of the pbar p annihilation for Jmax = " << _jmax << " are: " << std::endl;
std::vector<PbarP*>::const_iterator it;
for ( it=_theStates.begin(); it!=_theStates.end(); ++it){
if (0!= (*it)){
os <<"J=" << (*it)->jpc.J << " P=" << (*it)->jpc.P << " C=" << (*it)->jpc.C
<<" L=" << (*it)->lsm.L <<" S=" << (*it)->lsm.S <<" lambda=" << (*it)->lsm.M
<<" ClebschGordan=" << (*it)->ClebschG
<< std::endl;
}
}
}
#ifndef _pbarpStates_H
#define _pbarpStates_H
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include "qft++/topincludes/relativistic-quantum-mechanics.hh"
#include "PwaUtils/DataUtils.hh"
class pbarpStates {
public:
/// Default Constructor
pbarpStates();
pbarpStates(int jmax);
/** Destructor */
virtual ~pbarpStates();
void print(std::ostream& os) const;
// std::vector<jpcRes*> allStates();
// std::vector<jpcRes*> lrange(int lmin; int lmax);
// std::vector<jpcRes*> jrange(Spin jmin; Spin jmax);
protected:
private:
int _jmax;
// std::vector<jpcRes*> _theStates;
std::vector<PbarP*> _theStates;
jpcRes _pbarJPC;
jpcRes _pJPC;
bool calcJPCs();
};
#endif /* _pbarpStates_H */
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