Commit 311f3071 authored by Lynn Garren's avatar Lynn Garren
Browse files

merge in fix to Herwig and Isajet translations

parent a2468719
// $Id: DecayChannelT.icc,v 1.1.1.1.2.1 2004/02/11 22:16:20 garren Exp $
// $Id: DecayChannelT.icc,v 1.1.1.1.2.2 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// DecayChannelT.icc
......
......@@ -57,6 +57,10 @@ pkginclude_HEADERS = \
Version.hh \
QQDecayTable.hh \
StringStream.h \
ParticleName.hh \
ParticleTranslation.hh \
ParticleTranslation.icc \
TranslationList.hh \
defs.h
# Identify generated file(s) to be removed when 'make clean' is requested:
......
// $Id: ParticleID.hh,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// $Id: ParticleID.hh,v 1.1.1.1.2.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// ParticleID.hh
......@@ -16,8 +16,12 @@
#ifndef PARTICLEID_HH
#define PARTICLEID_HH
#include <string>
#include <algorithm> // swap()
// Particle names
#include "CLHEP/HepPDT/ParticleName.hh"
namespace HepPDT {
// convert from 2J+1 to the actual spin value
......@@ -125,6 +129,8 @@ public:
int Z( ) const;
// digit returns the digit at a named location in the PID
unsigned short digit(location) const;
// particle name
const std::string PDTname() const { return particleName( itsPID ); }
private:
......
#ifndef PARTICLENAME_HH
#define PARTICLENAME_HH
// $Id: ParticleName.hh,v 1.1 2004/04/14 23:56:27 garren Exp $
// $Id: ParticleName.hh,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// ParticleName.hh
......
// $Id: ParticleTranslation.hh,v 1.1 2004/04/14 23:56:27 garren Exp $
// $Id: ParticleTranslation.hh,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// ParticleTranslation.hh
......
// $Id: ParticleTranslation.icc,v 1.1 2004/04/14 23:56:27 garren Exp $
// $Id: ParticleTranslation.icc,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// ParticleTranslation.icc
......
#ifndef TRANSLATIONLIST_HH
#define TRANSLATIONLIST_HH
// $Id: TranslationList.hh,v 1.1 2004/04/14 23:56:27 garren Exp $
// $Id: TranslationList.hh,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// TranslationList.hh
......
......@@ -40,6 +40,13 @@ AC_CONFIG_FILES([HepPDT/copy-header.pl], [chmod +x HepPDT/copy-header.pl])
AC_CONFIG_FILES([test/testPID.sh], [chmod +x test/testPID.sh])
AC_CONFIG_FILES([test/testHepPDT.sh], [chmod +x test/testHepPDT.sh])
AC_CONFIG_FILES([test/testHepPDT.input])
AC_CONFIG_FILES([test/listParticleNames.sh], [chmod +x test/listParticleNames.sh])
AC_CONFIG_FILES([test/listQQTranslation.sh], [chmod +x test/listQQTranslation.sh])
AC_CONFIG_FILES([test/listQQTranslation.cc])
AC_CONFIG_FILES([test/listPythiaNames.sh], [chmod +x test/listPythiaNames.sh])
AC_CONFIG_FILES([test/listPythiaNames.cc])
AC_CONFIG_FILES([test/listPDGNames.sh], [chmod +x test/listPDGNames.sh])
AC_CONFIG_FILES([test/listPDGNames.cc])
# ----------------------------------------------------------------------
# Capture post-install information:
......
#
# $Id: GNUmakefile,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
# $Id: GNUmakefile,v 1.1.1.1.2.1 2004/04/21 23:06:33 garren Exp $
#
# makefile for HepPDT examples
#
......@@ -23,21 +23,29 @@ ifndef CXX
endif
ifndef PDTLIB
PDTLIB = ../../../lib/libCLHEP-g++.1.8.0.0.a
PDTLIB = $(CLHEP_DIR)/lib/libCLHEP-HepPDT-1.9.0.0.a
endif
ifndef INCDIR
INCDIR = -I../../../include
INCDIR = -I$(CLHEP_DIR)/include
endif
ifdef HERWIG_DIR
INCDIR += -I$(HERWIG_DIR)/src
endif
ifndef F77
F77 = g77
endif
ifndef FFLAGS
FFLAGS = $(DFLG) -fno-second-underscore $(INCDIR)
endif
AR=ar
ARFLG = -urs
CXXFLAGS = $(DFLG) $(INCDIR)
ifeq "$(CXX)" "KCC"
CXXFLAGS += +K0 -O0 --no_implicit_include --one_per
PDTLIB = ../../../lib/libCLHEP-KCC.1.7.0.0.a
endif
SOURCE = $(wildcard *.cc)
......@@ -47,6 +55,8 @@ include $(SOURCE:.cc=.d)
all: build_test run_test
list: examListHerwig examListIsajet
test: run_test
build_test: examReadPDG examReadPythia examReadEvtGen examReadQQ \
......@@ -83,6 +93,21 @@ examReadEvtGen: examReadEvtGen.o $(PDTLIB)
$(PDTLIB) -lm
rm -rf ti_files
examListHerwig: examListHerwig.o examListHerwigInterface.o $(PDTLIB)
$(CXX) $(CXXFLAGS) -o $@ \
examListHerwig.o examListHerwigInterface.o \
$(HERWIG_DIR)/lib/hwudat.o \
-L$(HERWIG_DIR)/lib -lherwig -lherdum \
$(PDTLIB) -lm -lg2c
rm -rf ti_files
examListIsajet: examListIsajet.o examListIsajetInterface.o $(PDTLIB)
$(CXX) $(CXXFLAGS) -o $@ \
examListIsajet.o examListIsajetInterface.o \
$(ISAJET_DIR)/isajet.a \
$(PDTLIB) -lm -lg2c
rm -rf ti_files
run_test: examReadPDG examReadPythia examReadEvtGen examMyPDT examReadQQ
examReadPDG > examReadPDG.log
diff examReadPDG.out examReadPDG.out.save
......@@ -105,15 +130,16 @@ clean:
rm -f *.d
rm -rf ti_files
rm -f examReadPDG examReadPythia examReadEvtGen
rm -f examMyPDT examDMF examReadQQ
rm -f examMyPDT examDMF examReadQQ examListHerwig examListIsajet
rm -f *.out *.log
#------------------------------------------
.PHONY: clean cleanobjs
.SUFFIXES : # cancel implicit rules
.SUFFIXES : .o .cc .cpp
.SUFFIXES : .o .cc .cpp .F .inc .h .hh
%.d: %.cc
@$(SHELL) -ec '$(CXX) -M $(CXXFLAGS) $< | sed '\''s/$*.o/& $@/g'\'' > $@'
......@@ -132,3 +158,10 @@ clean:
%_g.o: %.cpp %.d
$(CXX) $(CXXFLAGS) -c -o $@ $<
%.o: %.F
$(F77) $(FFLAGS) -c -o $@ $<
%_g.o: %.F
$(F77) $(FFLAGS) -c -o $@ $<
// $Id: examListHerwig.cc,v 1.1 2004/04/14 23:56:27 garren Exp $
// $Id: examListHerwig.cc,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// -------------------------------------------------------------------
//
// List the herwig translation
......
// $Id: examListIsajet.cc,v 1.1 2004/04/14 23:56:27 garren Exp $
// $Id: examListIsajet.cc,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// -------------------------------------------------------------------
//
// List the isajet translation
......
......@@ -7,59 +7,64 @@ INCLUDES = -I$(top_builddir)
lib_LTLIBRARIES = libCLHEP-HepPDT-@VERSION@.la
libCLHEP_HepPDT_@VERSION@_la_SOURCES = \
Constituent.cc \
DMFactory.cc \
DefTable.cc \
PDGtoQQTable.cc \
QQChannel.cc \
QQDecay.cc \
QQDecayTable.cc \
ResonanceStructure.cc \
SimpleDecayModel.cc \
TempParticleData.cc \
addEvtGenParticles.cc \
addPDGParticles.cc \
addPythiaParticles.cc \
addQQParticles.cc \
buildTable.cc \
calculateWidthFromLifetime.cc \
digit.cc \
extraBits.cc \
fundamentalID.cc \
hasMethods.cc \
ion.cc \
isBaryon.cc \
isDiQuark.cc \
isHadron.cc \
isLepton.cc \
isMeson.cc \
isNucleus.cc \
isValid.cc \
jSpin.cc \
lSpin.cc \
lifetime.cc \
quarks.cc \
readQQchannel.cc \
readQQstream.cc \
sSpin.cc \
spindtoi.cc \
spinitod.cc \
stringtodouble.cc \
threeCharge.cc \
translateEvtGentoPDT.cc \
translateGeanttoPDT.cc \
translateHerwigtoPDT.cc \
translateIsajettoPDT.cc \
translatePDGtabletoPDT.cc \
translatePDTtoEvtGen.cc \
translatePDTtoGeant.cc \
translatePDTtoHerwig.cc \
translatePDTtoIsajet.cc \
translatePDTtoPDGtable.cc \
translatePDTtoPythia.cc \
translatePDTtoQQ.cc \
translatePythiatoPDT.cc \
translateQQtoPDT.cc \
version.cc \
write.cc \
Constituent.cc \
DMFactory.cc \
DefTable.cc \
PDGtoQQTable.cc \
ParticleName.cc \
QQChannel.cc \
QQDecay.cc \
QQDecayTable.cc \
ResonanceStructure.cc \
SimpleDecayModel.cc \
TempParticleData.cc \
listPythiaTranslation.cc \
listPDGTranslation.cc \
addEvtGenParticles.cc \
addPDGParticles.cc \
addPythiaParticles.cc \
addQQParticles.cc \
buildTable.cc \
calculateWidthFromLifetime.cc \
digit.cc \
extraBits.cc \
fundamentalID.cc \
getPDGpid.cc \
getPythiaid.cc \
hasMethods.cc \
ion.cc \
isBaryon.cc \
isDiQuark.cc \
isHadron.cc \
isLepton.cc \
isMeson.cc \
isNucleus.cc \
isValid.cc \
jSpin.cc \
lSpin.cc \
lifetime.cc \
quarks.cc \
readQQchannel.cc \
readQQstream.cc \
sSpin.cc \
spindtoi.cc \
spinitod.cc \
stringtodouble.cc \
threeCharge.cc \
translateEvtGentoPDT.cc \
translateGeanttoPDT.cc \
translateHerwigtoPDT.cc \
translateIsajettoPDT.cc \
translatePDGtabletoPDT.cc \
translatePDTtoEvtGen.cc \
translatePDTtoGeant.cc \
translatePDTtoHerwig.cc \
translatePDTtoIsajet.cc \
translatePDTtoPDGtable.cc \
translatePDTtoPythia.cc \
translatePDTtoQQ.cc \
translatePythiatoPDT.cc \
translateQQtoPDT.cc \
version.cc \
write.cc \
writeTranslations.cc
// $Id: ParticleName.cc,v 1.1 2004/04/14 23:56:28 garren Exp $
// $Id: ParticleName.cc,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// ParticleName.cc
......
// $Id: addPDGParticles.cc,v 1.3 2003/08/13 20:00:11 garren Exp $
// $Id: addPDGParticles.cc,v 1.3.2.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// addPDGParticles.cc
// Author: Lynn Garren
//
// this has the functions used by addPDGParticles
//
......@@ -9,6 +10,7 @@
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include "CLHEP/HepPDT/defs.h"
......@@ -26,26 +28,6 @@ void parsePDGline( TempParticleData & tpd, std::string & pdline );
bool CheckPDGEntry( TempParticleData & tpd, const std::string &,
const std::string &, double, double );
void getPDGpid( std::vector<int> & idlist, std::string & pdline )
{
int sl, cl, id1, id2, id3, id4;
sl = pdline.length();
cl = pdline.find('*');
// make sure the vector is empty
idlist.clear();
if( cl != 0 && sl > 60 ){
// this is a valid line, so parse it
// initialize possible ID's to zero
id1 = id2 = id3 = id4 = 0;
std::istringstream idnet( pdline.substr(1,32).c_str() );
idnet >> id1 >> id2 >> id3 >> id4;
if( id1 > 0 ) { idlist.push_back( id1 ); }
if( id2 > 0 ) { idlist.push_back( id2 ); }
if( id3 > 0 ) { idlist.push_back( id3 ); }
if( id4 > 0 ) { idlist.push_back( id4 ); }
}
}
void parsePDGline( TempParticleData & tpd, std::string & pdline )
{
double v, e1, e2, err;
......
// $Id: addPythiaParticles.cc,v 1.2 2003/08/13 20:00:11 garren Exp $
// $Id: addPythiaParticles.cc,v 1.2.2.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// addPythiaParticles.cc
......@@ -25,20 +25,6 @@ void parsePythiaLine( TempParticleData & tpd, int & anti, std::string & aname, c
void parsePythiaDecayLine( TempParticleData & tpd, const std::string & pdline );
TempDecayData getPythiaDecay( const std::string & pdline );
bool getPythiaid( int & id, const std::string & pdline )
{
int sl = pdline.length();
std::string firstc = pdline.substr(0,1);
id = 0;
if( sl > 30 && firstc == " " ){
std::istringstream var1( pdline.substr(0,10).c_str() );
var1 >> id; // if var1 is blank, id is not changed
return true;
} else {
return false;
}
}
void parsePythiaLine( TempParticleData & tpd, int & anti, std::string & aname, const std::string & pdline )
{
// this line defines a particle
......
// $Id: getPDGpid.cc,v 1.1 2004/04/14 23:56:28 garren Exp $
// $Id: getPDGpid.cc,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// getPDGpid.cc
......
// $Id: getPythiaid.cc,v 1.1 2004/04/14 23:56:28 garren Exp $
// $Id: getPythiaid.cc,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// getPythiaid.cc
......
// $Id: listPDGTranslation.cc,v 1.1 2004/04/14 23:56:28 garren Exp $
// $Id: listPDGTranslation.cc,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// listPDGTranslation.cc
......
// $Id: listPythiaTranslation.cc,v 1.1 2004/04/14 23:56:28 garren Exp $
// $Id: listPythiaTranslation.cc,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// ----------------------------------------------------------------------
//
// listPythiaTranslation.cc
......
// $Id: translateHerwigtoPDT.cc,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// $Id: translateHerwigtoPDT.cc,v 1.1.1.1.2.1 2004/04/21 23:06:33 garren Exp $
// ------------------------------------
//
// translateHerwigtoPDT.cc
......@@ -46,10 +46,10 @@ int kqn=(ida/1000000000)%10;
std::cout << " HWTRAN 3: nonallowed ion" << std::endl;
} else if(ida < 100){
// ..Higgs, etc.
hwtran=itabj[ida];
hwtran=itabj[ida-1];
// ..check for illegal antiparticles
if(id < 0){
hwtran = -itabj[ida];
hwtran = -itabj[ida-1];
if(hwtran >= -99 && hwtran <= -81) { hwtran=0; }
for( i=0; i < 7; ++i ) {
if(hwtran == noant[i]) { hwtran=0; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment